/mqtt-collector

Collect data from MQTT broker and push it to InfluxDB 2 for use with SOLECTRUS

Primary LanguageRubyOtherNOASSERTION

Continuous integration Maintainability wakatime Test Coverage

MQTT collector

Collect data from MQTT broker and push it to InfluxDB 2 for use with SOLECTRUS.

BEWARE: This project has just started and should be considered experimental. If you encounter any problems, please open an issue.

It has been roughly tested in the following setups:

I'm very interested in your feedback, especially if you are using other devices or MQTT brokers. Please open an issue or use the forum.

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 support 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/main.rb

Run tests

bundle exec rake

Run linter

bundle exec rubocop

Build Docker image by yourself

Example for Raspberry Pi:

docker buildx build --platform linux/arm64 -t mqtt-collector .

License

Copyright (c) 2023 Georg Ledermann georg@ledermann.dev and contributors.
Inspired by code provided by Sebastian Löb (@loebse) and Michael Heß (@GrimmiMeloni)