Skip to content

Reads OpenDTU topics from an MQTT server and imports them into InfluxDB

License

Notifications You must be signed in to change notification settings

smainz/OpenDTU-MQTT-Telegraf-influxdb-integration

Repository files navigation

OpenDTU-MQTT-Telegraf-influxdb-integration

This is a telegraf configuration which collects data sent by an OpenDTU and imports it into an InfluxDB (Version 2.0).

The idea is to transform the current structure of MQTT topic sent by the OpenDTU to the format which is compatible with the future structure of the MQTT topics.

Additionally a Grafana dashboard is provided using the data in the InfluxDB.

What you get

Grafana dasboard for your pv system (sunrise / sunset times might not work for you, if you do not import your local weather form the OpenWeatherMap API):

Overview Overview

Details Details

And of course the telegraf configuration to import the data from a MQTT server into [Inflxdb V2].

How to use it

Prerequisites

Quite some prerequisites need to be fulfilled. Just check the linked pages, is you not already have these:

  1. OpenDTU set up and running
  2. A MQTT server (e.g. Mosquitto) up and running
  3. Grafana installed
  4. Docker engine and the Docker compose plugin installed

MQTT configuration

Create a user / password on your MQTT server which is entitled to read the OpenDTO topics (/solar/# if you left the defaults. )

InfluxDB configuration

Go to your influxdb web frontend and:

  • create a bucket called solar/actual
  • create an API token, which is permitted to write to this bucket

Setup and run Telegraf importer

  • Adjust configurtion Copy the file telegraf-settings.env.example to telegraf-settings.env and edit it to fit your local setup. I.e.insert MQTT username/ password and InfluxDb API token.

  • Run using docker compose Check docker-compose.yml and adapt to your needs and run it with:

    docker-compose up -d

Grafana dashboard

  • Create an InfluxDB datasource if you not already have it,
  • Create a Sun and Moon datasource
  • import the dashboard from grafana/solar.json,
  • connect it to your Influx datasource solar/actual, and
  • edit the template variables of the imported dashboard (for sun altitude and sunrise/sunset)

About

Reads OpenDTU topics from an MQTT server and imports them into InfluxDB

Resources

License

Stars

Watchers

Forks

Packages

No packages published