Hi all, I don’t know why I’m finding this so incredibly difficult. Frustrating because it seems like it should be very simple.
I have grafana/influx integrated into my HA setup. Grafana is able to plot out any entity_id value over time.
I have a pi on the network which has various python code publishing mqtt topics.
For example I publish home/stat/ which has a payload of
{
"dba": 44
}
I’m simplifying the example but I’m sending dba sound levels as part of the json payload.
In HA, I’ve set up a very basic automation just so that an entity_id is created that Grafana can see. I don’t actually need to trigger or take any action right now – I just want to map the values from one of the json keys to be the “value” of this visible in Grafana over time.
After having this automation setup, Grafana is able to see this entity_id but it’s value is always either 0 or 1. If I trigger the topic publish, grafana graphs “1” but doesn’t log the actual value from the payload.
So it sounds like I don’t need an automation at all, but to create an mqtt sensor. Everything I could find says these are created in the configuration.yaml – curious, is there no other way to edit one through HA without using file editor. Sort of like how automations can be managed in settings without editing YAML directly
I did create a sensor this way and reloaded HA, but I don’t see it showing up as an entity_id in Grafana. I seem to only see the mqtt automations there but not mqtt sensors. Is there something else I have to do other than create it in the configuration yml?
Does the sensor show up correctly in Home Assistant?
You will have to restart home assistant after creating the sensor config. A config reload will not be sufficient for the first time you use any new integration.
How are you sending data to Grafana, are you using InfluxDB?