Collect data from MQTT broker and push it to InfluxDB 2. The mappings of MQTT topics to InfluxDB fields and measurements is customizable.
The main use case is to collect data for SOLECTRUS, but it can be used for other purposes as well, where you want to collect data from MQTT and store it in InfluxDB.
It has been tested in the following setups:
- ioBroker with the integrated MQTT broker and the SENEC Home 2.1 adapter
- evcc with the senec-home template and the HiveMQ MQTT Broker
Note: For a SENEC device there is a dedicated senec-collector available which communicates directly with the SENEC device via its API and does not require a MQTT broker. Also, it is able to collect additional and more accurate data from the SENEC device.
- InfluxDB 2
- MQTT broker
- Linux machine with Docker installed
-
Make sure that your MQTT broker and InfluxDB2 database are ready (not subject of this README)
-
Prepare an
.env
file (see.env.example
) -
Run the Docker container on your Linux box:
docker compose up
The Docker image supports multiple platforms: linux/amd64
, linux/arm64
, linux/arm/v7
For development you need a recent Ruby setup. On a Mac, I recommend rbenv.
bundle exec app.rb
bundle exec rake
bundle exec rubocop
Copyright (c) 2023-2024 Georg Ledermann [email protected] and contributors.
Inspired by code provided by Sebastian Löb (@loebse) and Michael Heß (@GrimmiMeloni)