When you install the prometheus addon in HomeAssistant, it can be strange to see that the metrics do not show up in your Grafana dashboard. That is because the entity names are part of the labels, not of the metric name.
In HomeAssistant, you have created an api key for accessing HomeAssistant in the Profile -> Security page. That API key is no longer readable, but if all is well you have it as part of your Prometheus/Victoriametrics scrape config:
- job_name: homeassistant
scrape_interval: 60s
metrics_path: /api/prometheus
authorization:
credentials: "<your home assistant api key>"
static_configs:
- targets:
- <your homeassistant ip>:8123
With that info, you can also fetch the raw metrics yourself. For instance, to find everything with the word “buiten” in it:
curl -H "Authorization: Bearer <your home assistant api key>" \
<your homeassistant ip>:8123/api/prometheus | grep buiten
You will find that some of your sensor data lives in funny places, like :
homeassistant_state_change_total{domain="sensor",entity="sensor.buiten_batterij",friendly_name="Buiten Batterij"} 1.0
homeassistant_state_change_total{domain="sensor",entity="sensor.buiten_temperatuur",friendly_name="Buiten Temperatuur"} 379.0
homeassistant_state_change_total{domain="sensor",entity="sensor.buiten_luchtvochtigheid",friendly_name="Buiten Luchtvochtigheid"} 299.0
homeassistant_state_change_created{domain="sensor",entity="sensor.buiten_batterij",friendly_name="Buiten Batterij"} 1.762457097086816e+09
homeassistant_state_change_created{domain="sensor",entity="sensor.buiten_temperatuur",friendly_name="Buiten Temperatuur"} 1.762457097096043e+09
homeassistant_state_change_created{domain="sensor",entity="sensor.buiten_luchtvochtigheid",friendly_name="Buiten Luchtvochtigheid"} 1.7624570971024454e+09
homeassistant_entity_available{domain="sensor",entity="sensor.buiten_batterij",friendly_name="Buiten Batterij"} 1.0
homeassistant_entity_available{domain="sensor",entity="sensor.buiten_temperatuur",friendly_name="Buiten Temperatuur"} 1.0
homeassistant_entity_available{domain="sensor",entity="sensor.buiten_luchtvochtigheid",friendly_name="Buiten Luchtvochtigheid"} 1.0
homeassistant_last_updated_time_seconds{domain="sensor",entity="sensor.buiten_batterij",friendly_name="Buiten Batterij"} 1.762457097083181e+09
homeassistant_last_updated_time_seconds{domain="sensor",entity="sensor.buiten_temperatuur",friendly_name="Buiten Temperatuur"} 1.762716687465655e+09
homeassistant_last_updated_time_seconds{domain="sensor",entity="sensor.buiten_luchtvochtigheid",friendly_name="Buiten Luchtvochtigheid"} 1.76271742018229e+09
homeassistant_sensor_battery_percent{domain="sensor",entity="sensor.buiten_batterij",friendly_name="Buiten Batterij"} 100.0
homeassistant_sensor_temperature_celsius{domain="sensor",entity="sensor.buiten_temperatuur",friendly_name="Buiten Temperatuur"} 9.6
homeassistant_sensor_humidity_percent{domain="sensor",entity="sensor.buiten_luchtvochtigheid",friendly_name="Buiten Luchtvochtigheid"} 85.2
I hope this explains why you don’t see the metrics you expected, or at least helps you to find the metrics you are looking for.
Have fun!