https://github.com/solectrus/mqtt-collector
Collect data from MQTT broker and push it to InfluxDB 2 for use with SOLECTRUS
https://github.com/solectrus/mqtt-collector
mqtt photovoltaic smarthome
Last synced: 11 days ago
JSON representation
Collect data from MQTT broker and push it to InfluxDB 2 for use with SOLECTRUS
- Host: GitHub
- URL: https://github.com/solectrus/mqtt-collector
- Owner: solectrus
- License: other
- Created: 2023-03-14T15:39:08.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2026-06-03T14:46:05.000Z (16 days ago)
- Last Synced: 2026-06-03T16:19:08.633Z (16 days ago)
- Topics: mqtt, photovoltaic, smarthome
- Language: Ruby
- Homepage:
- Size: 852 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://github.com/solectrus/mqtt-collector/actions/workflows/push.yml)
[](https://qlty.sh/gh/solectrus/projects/mqtt-collector)
[](https://wakatime.com/badge/user/697af4f5-617a-446d-ba58-407e7f3e0243/project/233968fc-9ac5-4c50-952f-ec1a37b3df85)
[](https://qlty.sh/gh/solectrus/projects/mqtt-collector)
# MQTT collector
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](https://www.iobroker.net/) with the integrated MQTT broker and the [SENEC Home 2.1 adapter](https://github.com/nobl/ioBroker.senec)
- [evcc](https://evcc.io/) with the [senec-home template](https://github.com/evcc-io/evcc/blob/master/templates/definition/meter/senec-home.yaml) and the [HiveMQ MQTT Broker](https://www.hivemq.com/public-mqtt-broker/)
Note: For a SENEC device there is a dedicated [senec-collector](https://github.com/solectrus/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.
## Requirements
- InfluxDB 2
- MQTT broker
- Linux machine with Docker installed
## Getting started
1. Make sure that your MQTT broker and InfluxDB2 database are ready (not subject of this README)
2. Prepare an `.env` file (see `.env.example`)
3. Run the Docker container on your Linux box:
```bash
docker compose up
```
The Docker image supports multiple platforms: `linux/amd64`, `linux/arm64`, `linux/arm/v7`
## Development
For development you need a recent Ruby setup. On a Mac, I recommend [rbenv](https://github.com/rbenv/rbenv).
### Run the app
```bash
bundle exec app.rb
```
### Run tests
```bash
bundle exec rake
```
### Run linter
```bash
bundle exec rubocop
```
## License
Copyright (c) 2023-2026 Georg Ledermann and contributors.\
Inspired by code provided by Sebastian Löb (@loebse) and Michael Heß (@GrimmiMeloni)