This repository houses the configuration for the InfluxDB + Grafana + Telegraf setup I have running to pull temperature and humidity data from esp32-sensor-reader-mqtt, air quality data from esp32-air-quality-reader-mqtt, and power usage data from powerwall-to-pvoutput-uploader.
- Create a
.env
file at the root of this repository with the following contents (theINFLUXDB_TOKEN
andINFLUXDB_ORG
values will be filled out after InfluxDB has been started up for the first time):
MQTT_BROKER_ADDRESS=tcp://<your-broker-address>:1883
INFLUXDB_TOKEN=""
INFLUXDB_ORG=""
- Run
docker compose up
to bring all the containers up. - Load the InfluxDB UI at localhost:8086 and create a new user, organisation, and three buckets:
weather
,power
, andair-quality
, plus a read/write token for the bucket. - Set the token and organisation name in the
.env
file from Step 1 then restart the Telegraf container withdocker compose restart telegraf
. - Log in to the Grafana UI at localhost:3000 with the default
admin
/admin
username and password. - Add a new data source for InfluxDB, set the Query Language to "Flux", and the organisation, token, and default bucket to use.
- Optionally import the dashboard.