~martijnbraam/mqtt2influxdb

MQTT to InfluxDB gateway

refs

master
browse  log 

clone

read-only
https://git.sr.ht/~martijnbraam/mqtt2influxdb
read/write
git@git.sr.ht:~martijnbraam/mqtt2influxdb

You can also use your local clone with git send-email.

#mqtt2influxdb

This is a python daemon that connects to a MQTT and InfluxDB server and bridges incoming MQTT messages to InfluxDB measurements.

It supports MQTT topics that receive a scalar value and MQTT topics that receives JSON encoded data.

#Configuration example

# The mqtt and influxdb section set the connection information and the rest of the sections are
# the data channels
[mqtt]
host=127.0.0.1
port=1883

[influxdb]
database=mydb
username=myusername
password=secret

[volt]
# Value of the mqtt data is a single raw value instead of a json blob
mode=scalar
# Flask-style route placeholders to extract data from the topic
topic=world/<module>/modbus/<int:index>/volt
# Values extracted from the topic that will be turned into tags
tags=module,index
# Final InfluxDB measurement name is volt
measurement=volt

[multivalue]
mode=scalar
# Instead of defining a channel per value sent in the system it's possible to use a placeholder
# from the topic to define the influxdb measurement
topic=world/<module>/example/<int:index>/<dataseries>
tags=module,index
# Final InfluxDB measurement name is the value from the dataseries placeholder in the topic
measurement-key=dataseries

[json]
# JSON mode will decode the mqtt payload as json and use all the toplevel scalar values as fields
mode=json
topic=world/<module>/jsondemo
tags=module
measurement=example