Home Assistant integration for Grafana Cloud
Home Assistant is an open source home automation tool that puts local control and privacy first. It is created and powered by a worldwide community of tinkerers and DIY enthusiasts and perfect for running on a Raspberry Pi or a local server.
Use the walkthrough in Grafana Cloud to install the Home Assistant integration
Pre-installation configuration for the Home Assistant integration
In order for the integration to work, you must configure the built-in Prometheus exporter for Home Assistant.
At minimum you’ll need to add the prometheus:
directive to your configuration.yaml
file:
# Example configuration.yaml entry
prometheus:
You may optionally add a namespace
which will prefix each of the metrics emitted by the in-built Prometheus exporter.
Post-install configuration for the Home Assistant integration
In the Grafana Agent configuration file, the Grafana Agent must be pointed to server, such as hass:8123
in the example below.
You will also need to create a long-lived access token which will be used to authenticate Grafana agent with Home Assistant.
metrics:
wal_directory: /tmp/wal
configs:
- name: integrations
scrape_configs:
- job_name: integrations/hass
metrics_path: /api/prometheus
bearer_token: '<your long lived HASS API token>'
scheme: https
static_configs:
- targets: ['hass:8123']
remote_write:
- url: http://cortex:9009/api/prom/push
Custom Namespace/Prefix
If you chose to set a custom namespace when enabling the in-build Prometheus exporter for Home Assistant, you must specify that in the prefix
variable of the dashboard in order for it to properly query your metrics.
Unsupported Sensors
The in-built Prometheus exporter for Home Assistant has relatively narrow coverage of the possible sensors and values which could be monitored by Home Assistant.
These will be emitted as metrics prefixed with sensor_unit_
followed by the unit of the sensor.
The Home Assistant integration will show you the number of these metrics as “Unsupported Sensors”.
A full list of unsupported sensors can be found in a table at the bottom of this dashboard.
You can use component_config
and component_config_glob
, combined with override_metric
in your Home Assistant configuration file to rewrite unsupported sensors to supported values.
An example of a full configuration with these overrides can be found in the documents for the in-built Prometheus exporter.
Resizing Panels
Please do not be afraid to change this dashboard to editable, and make changes to the size of the panels which are included.
Your particular Home Assistant may have many more sensors, or lights, and making the panels larger will dramatically improve the usability and visual impact of the dashboard.