1
0
Fork 0
mirror of https://github.com/Luzifer/mqtt2influx.git synced 2024-12-20 09:31:23 +00:00
MQTT to InfluxDB transport
Find a file
Knut Ahlers b8b947b4cc
Upgrade PyYAML for dep pinning
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2023-07-22 20:12:02 +02:00
.dockerignore Initial version 2020-07-11 18:20:49 +02:00
.gitignore Initial version 2020-07-11 18:20:49 +02:00
config_sample.yml Initial version 2020-07-11 18:20:49 +02:00
Dockerfile Pin deps and python version 2022-09-16 20:25:51 +02:00
influx.py Use SSL in influx connection 2023-03-05 13:49:26 +01:00
LICENSE Add LICENSE 2020-07-11 19:56:43 +02:00
main.py Fix messed up time-format 2020-07-11 20:11:54 +02:00
Makefile Initial version 2020-07-11 18:20:49 +02:00
README.md Add more info to README 2020-07-11 20:05:02 +02:00
requirements.txt Upgrade PyYAML for dep pinning 2023-07-22 20:12:02 +02:00
vault.py Initial version 2020-07-11 18:20:49 +02:00
yaml_lambda.py Initial version 2020-07-11 18:20:49 +02:00

Luzifer / mqtt2influx

MQTT to InfluxDB transport: uses mapping config including transformer functions to pull data from MQTT topics and write those values into InfluxDB.

The motivation behind this was for me to have a lot of Tasmota sensors sending data through MQTT to Home-Assistant. Home-Assistant is capable of writing those metrics into InfluxDB but sadly it only writes them on change. So if a value does not change for an extended period of time for example Grafana dashboards will stop to display the metric as it contains no data.

As those sensors are sending values in different forms (value only, value embedded in JSON, ...) I needed a way to configure the transform of the values in a way no code needs to change for a new transmission method. Therefore I came to use Python with extra support for lambda functions in the configuration.

A word of warning: If you plan to run this in an untrusted environment you will compromise your environment! Lambda functions in config which execute code on random values sent through MQTT aren't a good idea. So only use them if you are 110% sure you only will get the expected values / data in a fully trusted environment!