Grafana
Grafana is a powerful data visualization tool. It is commonly used for dashboards with time-series data (e.g., sensor data).
Choosing a Data Source
Grafana supports many data sources: PostgreSQL (recommended), MySQL, InfluxDB, Prometheus, and many more. For new projects, I recommend PostgreSQL with the TimescaleDB extension. For existing installations with InfluxDB, everything continues to work.
Installation
Add the following template to your docker-compose.yml and then run ei23 dc.
Template
grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- "3000:3000"
volumes:
- ./volumes/grafana:/var/lib/grafana
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=password_placeholder
restart: unless-stopped
First Start
- After starting, you can access Grafana at
http://[IP]:3000 - Login with admin / admin (or the password set in docker-compose)
- On first login, you will be prompted to set a new password
Add Data Source
The most common combination is Grafana with InfluxDB:
- Go to Connections → Data Sources
- Click Add data source
- Select InfluxDB
- Configure the connection:
- URL:
http://influxdb:8086(if InfluxDB runs in Docker) - Database: Your InfluxDB database (e.g.,
homeassistant) - User/Password: If configured
- URL:
Home Assistant Data
If you use Home Assistant with InfluxDB, you can visualize all sensor data in Grafana.
Create Dashboards
Grafana offers two ways to create dashboards:
Import Community Dashboards
- Go to Dashboards → New → Import
- Enter a dashboard ID (e.g., from grafana.com/grafana/dashboards)
- Select your data source and click Import
Create Your Own Dashboard
- Click + → Create new dashboard
- Add panels and configure queries
- Save the dashboard
Recommended Dashboards
| ID | Name | Description |
|---|---|---|
| 11074 | Home Assistant | All HA sensors |
| 9096 | System Metrics | CPU, RAM, Disk |
| 12065 | Docker Metrics | Container status |
Notes
- Data is stored in
./volumes/grafana/ - Dashboards can be exported/imported as JSON
- Grafana supports alerts via email, Telegram, Discord, etc.
- The default port is 3000