Home Assistant's built-in history charts are fine. But if you want to visualize months of energy data, overlay temperature trends across rooms, or build a monitoring screen that makes your friends jealous, Grafana is the answer. Free, local, and ridiculously powerful.
Jump to a section
Home Assistant can show you what's happening right now. Grafana shows you what happened over the past year, in stunning detail. Think of it as the difference between checking a thermometer and reading a climate report.
See how your energy usage changed month over month. Track whether your new insulation actually reduced heating costs. Spot patterns you never noticed in daily views.
Plot indoor temperature, outdoor temperature, and heating runtime on the same chart. Correlate humidity spikes with window open/close events. Grafana makes comparisons easy.
Set up alerts directly in Grafana when sensors go out of range. Get notified if your freezer temperature rises, or if your solar production drops below expected levels.
Grafana's kiosk mode is perfect for wall-mounted tablets or old laptops turned into monitoring screens. Auto-rotating dashboards with dark themes look fantastic.
Grafana OSS is open source and completely free. Everything runs on your local network. No cloud subscriptions, no data leaving your home, no vendor lock-in.
The Grafana plugin ecosystem is massive. Worldmap panels, 3D charts, Plotly integration, clock panels, discrete status timelines, and hundreds more. If you can imagine it, there's probably a plugin for it.
They solve different problems. Home Assistant dashboards are great for controlling your home. Grafana is great for understanding your home's data. Most power users run both.
The classic Home Assistant + Grafana stack has three layers. Understanding how they connect makes setup and troubleshooting much easier.
Home Assistant (Data Source)
Your smart home hub collects data from all sensors and devices. The InfluxDB integration sends selected entity states to InfluxDB in real time. You choose which entities to include or exclude.
InfluxDB (Database)
A time-series database optimized for exactly this kind of data. It stores temperature readings, energy measurements, state changes, and everything else Home Assistant sends. Much faster than SQLite for historical queries.
Grafana (Visualization)
Connects to InfluxDB and renders the data as beautiful charts, graphs, gauges, and tables. You build dashboards by dragging panels and writing queries. Supports dark themes, auto-refresh, and kiosk mode for wall displays.
InfluxDB 1.x vs 2.x
InfluxDB 1.8 uses InfluxQL (SQL-like, easier for beginners). InfluxDB 2.x uses Flux (more powerful but steeper learning curve). For most Home Assistant users, InfluxDB 1.8 is the easier choice and still works perfectly with Grafana. If you're running Docker and want the latest features, go with 2.x.
Two paths depending on your install type. Both get you to the same result: a Grafana dashboard pulling real-time data from your smart home.
The simplest route. Install both as official add-ons. No Docker knowledge needed.
Step 1: Install InfluxDB add-on
Go to Settings > Add-ons > Add-on Store and search for "InfluxDB." Install it, then start it. The add-on creates a database automatically. Open the InfluxDB web UI and create a database called homeassistant and a user with read/write access.
Step 2: Configure Home Assistant to send data
Add this to your configuration.yaml:
influxdb:
host: a0d7b954-influxdb
port: 8086
database: homeassistant
username: homeassistant
password: YOUR_PASSWORD
max_retries: 3
include:
entity_globs:
- sensor.*temperature*
- sensor.*humidity*
- sensor.*energy*
- sensor.*power*
- sensor.*battery*
domains:
- climate
- weather Tip: Start with a focused include list. You can always add more entities later. Sending everything fills your database fast.
Step 3: Install Grafana add-on
Back in the Add-on Store, search for "Grafana." Install and start it. Open the Grafana web UI (default port 3000). Log in with the credentials from the add-on configuration page.
Step 4: Connect Grafana to InfluxDB
In Grafana, go to Configuration > Data Sources > Add data source. Select InfluxDB. Set the URL to http://a0d7b954-influxdb:8086, database to homeassistant, and enter your InfluxDB credentials. Click "Save & Test." Green checkmark means you're connected.
Step 5: Build your first dashboard
Click + > New Dashboard > Add visualization. Select your InfluxDB data source. In the query editor, select a measurement (like "ยฐC" or "W"), pick an entity, and hit Run. Your first chart should appear. Save the dashboard and start adding more panels.
For Home Assistant Container users or anyone who prefers Docker. More control, same result.
Docker Compose snippet
services:
influxdb:
image: influxdb:1.8
container_name: influxdb
restart: unless-stopped
ports:
- "8086:8086"
volumes:
- ./influxdb/data:/var/lib/influxdb
environment:
- INFLUXDB_DB=homeassistant
- INFLUXDB_HTTP_AUTH_ENABLED=true
- INFLUXDB_ADMIN_USER=admin
- INFLUXDB_ADMIN_PASSWORD=your_admin_password
- INFLUXDB_USER=homeassistant
- INFLUXDB_USER_PASSWORD=your_ha_password
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: unless-stopped
ports:
- "3000:3000"
volumes:
- ./grafana/data:/var/lib/grafana
environment:
- GF_SECURITY_ALLOW_EMBEDDING=true
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
depends_on:
- influxdb Then configure your configuration.yaml the same way, but use host: influxdb (the container name) or your server's IP address.
Once your data is flowing, the fun begins. Here are the dashboards that Home Assistant users build most often.
Daily, weekly, and monthly energy consumption with cost overlays. Compare solar production vs grid consumption. Track per-device usage from smart plugs. Bar charts for daily totals, line graphs for real-time power draw.
Key panels: Stat (total kWh), Time series (power curve), Bar gauge (top consumers), Table (cost breakdown)
Temperature and humidity across every room on a single screen. Overlay outdoor weather data. Spot rooms that are consistently too cold or too humid. Perfect for optimizing heating schedules and catching drafts.
Key panels: Time series (multi-room temp), Gauge (current per room), Heatmap (hourly patterns), Stat (min/max/avg)
Real-time solar production, daily yield, monthly totals, and year-over-year comparison. Self-consumption ratio, grid export tracking, and battery state of charge. Know exactly what your panels are earning you.
Key panels: Time series (production curve), Stat (daily yield), Bar chart (monthly comparison), Gauge (self-consumption %)
Monitor battery levels across all your Zigbee sensors, smart locks, and remotes. Sort by lowest battery. Track discharge rates to predict when each device needs a new battery, before it dies and stops reporting.
Key panels: Table (all batteries, sorted), Bar gauge (levels), Time series (discharge curves), Alert (below 20%)
CPU usage, memory, disk space, and database size of your Home Assistant server. Track HA restart events, integration load times, and Zigbee network quality. Catch performance issues before they become problems.
Key panels: Gauge (CPU/RAM/disk), Time series (load over time), Stat (uptime), Log panel (errors)
CO2, PM2.5, and VOC levels over time. Correlate air quality with ventilation habits, cooking events, or outdoor pollution. Set alerts for when CO2 exceeds 1000 ppm so you know exactly when to open a window.
Key panels: Time series (CO2/PM2.5), Stat (current readings), Threshold lines (WHO guidelines), Heatmap (daily patterns)
Copy these into your Grafana panels to get started quickly. All use InfluxQL (for InfluxDB 1.x). Replace entity names with your own.
Average temperature per room (last 24h)
SELECT mean("value")
FROM "ยฐC"
WHERE "entity_id" =~ /temperature/
AND time > now() - 24h
GROUP BY time(30m), "entity_id"
FILL(previous)Daily energy consumption (last 30 days)
SELECT spread("value")
FROM "kWh"
WHERE "entity_id" = 'sensor.total_energy'
AND time > now() - 30d
GROUP BY time(1d)
FILL(none)All battery levels (current)
SELECT last("value")
FROM "%"
WHERE "entity_id" =~ /battery/
AND time > now() - 1h
GROUP BY "entity_id"Power consumption heatmap (hourly average)
SELECT mean("value")
FROM "W"
WHERE "entity_id" = 'sensor.total_power'
AND time > now() - 7d
GROUP BY time(1h)
FILL(0)Grafana visualizes data, but Home Assistant acts on it. These automations complement your dashboards by alerting you or taking action when the data tells a story.
Battery Low Alert
When any sensor battery drops below 20%, send a notification with the device name and current level. You'll see the discharge curve in Grafana and get warned before the device goes offline.
automation:
- alias: "Low battery alert"
trigger:
- platform: numeric_state
entity_id:
- sensor.front_door_battery
- sensor.motion_sensor_battery
- sensor.temp_sensor_battery
below: 20
action:
- service: notify.mobile_app
data:
title: "๐ Low Battery"
message: >
{ trigger.to_state.name }
is at { trigger.to_state.state }%Energy Spike Detection
Get alerted when power consumption exceeds your normal range. Great for catching appliances left on or detecting unusual usage patterns.
automation:
- alias: "Energy spike alert"
trigger:
- platform: numeric_state
entity_id: sensor.total_power
above: 3000
for:
minutes: 10
action:
- service: notify.mobile_app
data:
title: "High Power Usage"
message: >
Power draw has been above 3kW for
10 minutes: { states('sensor.total_power') }WDaily Energy Report
Send yourself a nightly summary of the day's energy usage and cost. Compare it with the detailed Grafana charts the next morning.
automation:
- alias: "Daily energy report"
trigger:
- platform: time
at: "23:00:00"
action:
- service: notify.mobile_app
data:
title: "๐ Daily Energy"
message: >
Today: { states('sensor.daily_energy') } kWh
Cost: โฌ{ (states('sensor.daily_energy')
| float * 0.25) | round(2) }Humidity Warning
When humidity exceeds 70% in any room for more than 30 minutes, send a notification. High humidity causes mold. Your Grafana dashboard shows the trend, this automation tells you to act.
automation:
- alias: "High humidity warning"
trigger:
- platform: numeric_state
entity_id:
- sensor.bathroom_humidity
- sensor.bedroom_humidity
- sensor.kitchen_humidity
above: 70
for:
minutes: 30
action:
- service: notify.mobile_app
data:
title: "๐ง High Humidity"
message: >
{ trigger.to_state.name }:
{ trigger.to_state.state }%
for 30+ minutes. Open a window!Server Health Monitor
Track your Home Assistant server's CPU temperature and disk usage. Get warned before your SD card fills up or your Pi overheats.
automation:
- alias: "Server health alert"
trigger:
- platform: numeric_state
entity_id: sensor.processor_temperature
above: 80
- platform: numeric_state
entity_id: sensor.disk_use_percent
above: 85
action:
- service: notify.mobile_app
data:
title: "๐ฅ๏ธ Server Warning"
message: >
{ trigger.to_state.name }:
{ trigger.to_state.state }
{ trigger.to_state.attributes
.unit_of_measurement }Why switch between two interfaces when you can have Grafana charts right inside your Home Assistant dashboard?
Enable embedding in Grafana
If using Docker, add these environment variables (already included in the Docker Compose above):
GF_SECURITY_ALLOW_EMBEDDING=true
GF_AUTH_ANONYMOUS_ENABLED=true
GF_AUTH_ANONYMOUS_ORG_ROLE=Viewer
GF_SECURITY_COOKIE_SAMESITE=disabled For HAOS add-on, set these in the add-on's configuration tab under "env_vars."
Get the embed URL
Open any Grafana panel, click the title, select "Share," then choose the "Embed" tab. Copy the iframe URL. It looks something like:
http://YOUR_IP:3000/d-solo/abc123/
energy?orgId=1&panelId=2
&from=now-24h&to=now
&theme=darkAdd to Home Assistant dashboard
Use a Webpage card (or the custom iframe-panel from HACS) in your HA dashboard. Paste the Grafana embed URL. Set the aspect ratio to match your panel. The Grafana chart now updates live inside your HA dashboard.
Lessons learned from the community so you don't have to make the same mistakes.
๐ฏ Filter your entities
Don't send everything to InfluxDB. Use the include filter in your InfluxDB config to select only the entities you actually want to graph. Sending all 500+ entities fills your database quickly and makes queries slow. Start with temperature, humidity, energy, and battery sensors. Add more as needed.
โฐ Set retention policies
InfluxDB can automatically delete old data. Create a retention policy like CREATE RETENTION POLICY "one_year" ON "homeassistant" DURATION 365d REPLICATION 1 DEFAULT. You can also use continuous queries to downsample old data: keep per-minute readings for 7 days, then switch to hourly averages for the rest of the year.
๐ Use dark themes
Grafana's dark theme looks amazing on wall displays and matches most Home Assistant themes. Set it as the default in Grafana's settings, or append &theme=dark to embed URLs. For kiosk mode on wall tablets, add &kiosk to the URL to hide the top bar and sidebar.
Use variables for reusable dashboards
Grafana's template variables let you build one dashboard that works for all rooms. Create a variable that pulls entity IDs from InfluxDB, then use dropdown menus to switch between rooms or devices. One dashboard, infinite views.
๐พ Back up your dashboards
Grafana dashboards are stored in its database, not in YAML files. Export them as JSON from the dashboard settings menu and save those files alongside your Home Assistant backups. If you're using Docker, the grafana/data volume contains everything.
๐ Try these Grafana plugins
Worldmap Panel for showing sensor locations on a map. Discrete for timeline views of binary sensors (door open/closed history). Plotly for advanced 3D or scatter plots. Clock for adding a simple clock to your wall display. Install them from Grafana's plugin catalog.
You can have Grafana running in an afternoon. Here's a realistic timeline.
Install InfluxDB + Grafana
Add-on or Docker, get both services running and talking to each other.
Configure Home Assistant InfluxDB integration
Edit configuration.yaml, restart HA, verify data is flowing to InfluxDB.
Connect Grafana to InfluxDB
Add InfluxDB as a data source in Grafana and test the connection.
Build your first dashboard
Start with temperature charts, add energy panels, customize colors and thresholds.
Let data accumulate and refine
Grafana gets better with more data. After a week you'll see daily patterns. After a month, you'll spot trends. After a year, you'll wonder how you lived without it.
Grafana is a free, open-source data visualization platform. While Home Assistant has its own dashboards, Grafana is purpose-built for time-series data. It gives you professional-grade charts, graphs, and panels that can display weeks, months, or years of sensor history. If you want to track energy costs over time, compare temperature trends across rooms, or build a monitoring screen that rivals a power plant control room, Grafana is the tool for the job.
Not strictly, but it is the recommended approach. Home Assistant stores history in its built-in SQLite or MariaDB database, but these are not optimized for the kind of time-series queries Grafana excels at. InfluxDB is designed specifically for time-series data and handles queries like "average temperature over the last 30 days" much faster. You can also connect Grafana directly to the Home Assistant API using the JSON datasource, but InfluxDB gives you the best performance and flexibility.
It depends on how many entities you track and your retention policy. A typical setup tracking 50 to 100 sensors with a 1-year retention policy uses roughly 1 to 5 GB. If you track hundreds of entities or keep data indefinitely, expect 10 GB or more. You can control this by filtering which entities send data to InfluxDB and setting retention policies to automatically delete old data.
Yes. You can embed Grafana panels directly into Home Assistant dashboards using iframe cards or the custom Grafana panel card from HACS. You need to configure Grafana to allow embedding by setting allow_embedding to true and adjusting the cookie_samesite setting. Many people run Grafana on a wall-mounted tablet alongside their Home Assistant dashboard.
Yes. Grafana OSS (open source) is completely free. You install it as a Home Assistant add-on or run it in Docker alongside InfluxDB. There is no subscription needed, no cloud dependency, and everything runs locally on your network. Grafana Cloud offers a free tier too, but running locally gives you full control and keeps all your data at home.
For most Home Assistant users, InfluxDB 1.8 is the simpler choice. It uses InfluxQL, which is similar to SQL and has tons of community examples. InfluxDB 2.x uses Flux, a more powerful but harder query language. If you're starting fresh and comfortable with Docker, 2.x gives you a nicer web UI and built-in task scheduling. But you won't miss anything critical with 1.8.
Grafana itself runs independently and doesn't affect HA performance. The InfluxDB integration adds a small write load as it sends entity data, but it's minimal for most setups. If you're running on a Raspberry Pi, you might notice a slight increase in CPU and memory usage. On a mini PC or NAS, you won't notice any difference.
Yes, using the same methods as remote Home Assistant access. If you use Nabu Casa, you can access Grafana through the HAOS add-on's Ingress interface. If you use a reverse proxy (Nginx, Caddy, Traefik), add a route for Grafana. Tailscale and WireGuard VPNs also work perfectly. Just make sure you have authentication enabled if exposing Grafana to the internet.
Start with a free scan to see what devices you have and how they'd look in Grafana. Or check out our dashboard examples for more inspiration.