Grafana is an open-source data visualisation and analytics platform that turns time-series data into interactive dashboards. In the Home Assistant ecosystem it serves as the visualisation layer for data stored in InfluxDB — where InfluxDB handles long-term storage and efficient querying of sensor history, Grafana handles the presentation: customisable graphs, gauge panels, stat displays, heatmaps, and alert thresholds that give your smart home data a level of detail and clarity that Home Assistant’s built-in history panels cannot match.
Grafana connects to InfluxDB as a data source — a one-time configuration step where you provide the InfluxDB server address, database name, and credentials. Once connected, Grafana’s query editor lets you build panels by writing InfluxQL or Flux queries against your Home Assistant data, selecting which measurements and tags to plot and how to aggregate them. A typical energy monitoring dashboard might include a time-series graph of hourly power consumption, a stat panel showing today’s total kWh, a gauge displaying current solar production, and a bar chart comparing daily consumption across the past two weeks — all pulling from the same InfluxDB instance, all updating in real time.
Grafana runs as a Home Assistant add-on, installed and managed through the standard add-on interface alongside InfluxDB and Mosquitto. The add-on exposes Grafana’s web interface on a local port, accessible from any browser on your network. Grafana also supports embedding individual panels as iframes, which makes it possible to include Grafana visualisations directly inside a Home Assistant Lovelace dashboard using the webpage card — combining the automation and device control of Lovelace with the analytical depth of Grafana in a single interface.
Pro Tip: Use Grafana for analysis, Lovelace for control
Grafana and Lovelace serve different purposes and work best when kept separate. Lovelace is optimised for real-time device control and status — turning lights on and off, checking which doors are open, seeing the current temperature. Grafana is optimised for historical analysis — understanding patterns, spotting anomalies, comparing periods. A wall tablet showing Lovelace for daily use and a browser tab with Grafana for weekly energy review is the natural division of labour between the two tools.
Beyond InfluxDB, Grafana supports dozens of additional data sources — PostgreSQL, MySQL, Prometheus, Elasticsearch, and many others — as well as the Home Assistant data source plugin available through Grafana’s plugin library, which queries Home Assistant’s WebSocket API directly without requiring InfluxDB as an intermediary. This direct integration is simpler to set up for basic visualisation needs, though it lacks the long-term retention and aggregation performance that the InfluxDB stack provides for serious historical analysis.
🏠 Fun Fact: Grafana was created by Torkel Ödegaard in 2014 as a fork of Kibana — the visualisation layer for the Elasticsearch stack — because he wanted better time-series graphing than Kibana offered for infrastructure monitoring. It has since grown into one of the most widely deployed observability tools in the world, used by NASA, CERN, and thousands of enterprises for infrastructure monitoring — and by tens of thousands of Home Assistant users for tracking their electricity bills.