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.
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):
And of course the telegraf configuration to import the data from a MQTT server into [Inflxdb V2].
Quite some prerequisites need to be fulfilled. Just check the linked pages, is you not already have these:
- OpenDTU set up and running
- A MQTT server (e.g. Mosquitto) up and running
- Grafana installed
- Docker engine and the Docker compose plugin installed
Create a user / password on your MQTT server which is entitled to read the OpenDTO topics (/solar/#
if you left the defaults. )
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
-
Adjust configurtion Copy the file
telegraf-settings.env.example
totelegraf-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
- 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)