/
telegraf.conf
57 lines (52 loc) · 1.79 KB
/
telegraf.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
[global_tags]
[agent]
interval = "10s"
round_interval = true
metric_batch_size = 1000
metric_buffer_limit = 10000
collection_jitter = "0s"
flush_interval = "10s"
flush_jitter = "0s"
precision = ""
hostname = "MyHome" #this is what will the TAG for host in influxDB
omit_hostname = false
[[outputs.influxdb]]
urls = ["http://YOUR_Influxdb_Internal_IP:8086"]
database = "YOUR_DB"
timeout = "5s"
username = "YourUsername"
password = "YourPassword"
[[inputs.mqtt_consumer]]
servers = ["tcp://IP:1883"] #MQTT IP and Port
#All Topics you want to subscribe to - you can use "zigbee2mqtt/#" if you want, i specifically select the topics i am interested in
topics = [
"zigbee2mqtt/Bath2/#",
"zigbee2mqtt/Bath3/#",
"zigbee2mqtt/Bath4/#",
"zigbee2mqtt/Bath5/#",
"zigbee2mqtt/BathTemp/#",
"zigbee2mqtt/C1/#",
"zigbee2mqtt/C2/#",
"zigbee2mqtt/C3/#",
"zigbee2mqtt/C4/#",
"zigbee2mqtt/C5/#",
"zigbee2mqtt/C6/#",
"zigbee2mqtt/E1/#",
"zigbee2mqtt/E2/#",
"zigbee2mqtt/K1/#",
"zigbee2mqtt/K2/#",
"zigbee2mqtt/K3/#",
"zigbee2mqtt/K4/#",
"zigbee2mqtt/KitchenMotionSensor/#",
"zigbee2mqtt/LightSLivingRoom/#",
]
#As i am using Zigbee2MQQT the data is in JSON and needs to be parsed as data format JSON - you can use JSONv2 if you want
data_format = "json"
json_time_key = ""
# AS state and occupancy from MQTT are not boolean but string you need to define it as string fields, add as much fields you need and coming from your MQTT
json_string_fields = ["state","occupancy"]
#This is to define the Measurement(Its like Table name in InfluxDB) and the TAG , so all data coming from MQTT will be located in measurement zigbee2mqqt and will get TAG equal to the devicename
[[inputs.mqtt_consumer.topic_parsing]]
topic = "zigbee2mqtt/+"
measurement = "measurement/_"
tags = "_/Device"