Skip to content

solectrus/mqtt-collector

Folders and files

NameName
Last commit message
Last commit date

Latest commit

8d509c5 · Mar 28, 2025
Jan 27, 2025
Mar 20, 2024
Mar 7, 2025
Mar 7, 2025
Jul 15, 2024
Mar 7, 2025
Sep 9, 2024
May 21, 2023
Mar 20, 2024
Mar 3, 2025
Feb 16, 2025
Feb 16, 2025
Sep 9, 2024
Mar 28, 2025
Apr 25, 2024
Jan 2, 2025
Jan 2, 2025
Mar 20, 2024
Jan 2, 2025
Jul 15, 2024

Repository files navigation

Continuous integration Maintainability wakatime Test Coverage

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:

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.

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:

    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.

Run the app

bundle exec app.rb

Run tests

bundle exec rake

Run linter

bundle exec rubocop

License

Copyright (c) 2023-2025 Georg Ledermann [email protected] and contributors.
Inspired by code provided by Sebastian Löb (@loebse) and Michael Heß (@GrimmiMeloni)