Telegraf Configuration


telegraf.conf file

#################################################
#                  OUTPUT PLUGINS               #
#################################################

# Configuration for sending metrics to InfluxDB
[[outputs.influxdb]]
urls = ["http://192.168.x.xxx:8086"]
database = "telegraf"
username = "influxuname"
password = "influxpw"

[[outputs.influxdb_v2]]
urls = ["http://192.168.x.xxx:9999"]
##token = "$INFLUX_TOKEN"
token = "fghfghfghhsdrhssdfhhehreerrhererhxxx"
organization = "myorg"
bucket = "homedata"

#################################################
#                   INPUT PLUGINS               #
#################################################

# # Read metrics from MQTT topic(s)
# # You need the server name (and the username/pass if there is one)
[[inputs.mqtt_consumer]]
servers = ["tcp://192.168.x.xxx:1883"]

# Put the topics you want to read here.  Remember the more you read the bigger the database
# will grow.  You can read based on wild cards, or individual topics.
topics = [
	 "zigbee2mqtt/#",
	 "stat/#",
	 "tele/#"
   ]

## This is important as it gives the type of tagging that goes into the database
## The majority of my mqtt data is in json format, but there are other options (see below)
#topic_tag = "topic"
data_format = "json"
#json_query = ""
tag_keys = []

## You can have multiple inputs the same, and this is the second mqtt input
## With the second input, you can give it a name override so you can refer to it in
## the db or grafana etc.
## In this case I need a data_type of float (not json) and if you have multiple types, you really
## need more than one mqtt_consumer input 
[[inputs.mqtt_consumer]]
name_override = "weewx_weather"
servers = ["tcp://192.168.x.xxx:1883"]
topics = ["weewx/#"]
data_format = "value"
data_type = "float"


--
CategoryDocker
CategoryHomeAutomation
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki