Skip to content

Instantly share code, notes, and snippets.

@geekman
Created January 3, 2022 16:41
Show Gist options
  • Save geekman/9272f3edb41b1692b74c130bf25734b3 to your computer and use it in GitHub Desktop.
Save geekman/9272f3edb41b1692b74c130bf25734b3 to your computer and use it in GitHub Desktop.
Telegraf configuration to ingest Zigbee2MQTT messages
#
# configuration for zigbee2mqtt ingestation
# monitors all exposed devices, while ignoring the z2m bridge
#
[[inputs.mqtt_consumer]]
servers = ["tcp://localhost:1883"]
topics = ["zigbee2mqtt/#"]
data_format = "json"
name_override = "zigbee"
topic_tag = "dev"
precision = "100ms"
# don't include messages about the z2m bridge itself
# also note the single square brackets used here
[inputs.mqtt_consumer.tagdrop]
dev = ["zigbee2mqtt/bridge/*"]
# strip the base topic (typically "zigbee2mqtt") from the dev tag
[[processors.regex]]
namepass = ["zigbee"]
[[processors.regex.tags]]
key = "dev"
pattern = '^zigbee2mqtt/(?P<device>.+)$'
replacement = "${device}"
# for debugging
#[[outputs.file]]
#files = ["stdout"]
[[outputs.influxdb_v2]]
urls = ["http://localhost:8086"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment