Temp sensor not recorded in influx/grafana?

Having a problem with one of my temp sensors. In grafana it looks empty (look at Movie Room)

However, in HA, both of these sensors have values:


The HA log is empty, no error messages. But the values seem to be missing from influxdb.

How can I query the influxdb to see if values are indeed stored there?

1 Like

Hm, seems like values are indeed stored. I played around with the grafana settings and when I switch to displaying a bar graph it shows me some measurements:

But shouldnā€™t it show me a line graph anyway, even if there are a lot fewer samples?

Check the ā€˜fillā€™ value in grafana panel editorā€¦ I have the same issue with some sensors that only change very seldom, so I have to enable fill(previous) on those ones to get nice proper looking line graphs.

ā€¦Iā€™ve actually edited the HA components and added force_update to all the types of sensors I use, so that even if the data doesnā€™t change from the previous value it still logs the current value and now I donā€™t need to use ā€˜fill(previous)ā€™ anymore.

(The change Iā€™ve made needs to be re-done every HA update, but it makes everything look properly in grafana, so Iā€™m not that bothered about editing 4 text files every time there is a HA update.)

Aha, seems like I made a mistake setting up the graphā€¦ The ā€œfillā€ is correct, but the problem was the ā€œNull valueā€ setting. It should be set to ā€œconnectedā€ to get the display I want.

1 Like

Yeah thatā€™ll do it lol.

When Iā€™m setting up new / extra graphs, I usually just duplicate the one that is working nicely already in grafana then change the entity id and alias for it in the panel editor.

Thatā€™s what I did, or at least I thought I did :slight_smile:

Does anyone know of any good ā€œGrafana for newbiesā€ resources? Itā€™s a very powerful tool, but sometimes I get lost in all the options and Iā€™m not sure if my problem is with Grafana or with influxdb.

For example, I have a power meter that gives me the current kWh value at certain intervals. Obviously this value is always increasing and the absolute value is not very interesting. I want to compare hourly or daily values, so I can see my daily usage. This sounds like an easy thing to do, but I canā€™t understand which function I am supposed to use.

SELECT derivative(mean("value"), 1s) FROM "cpu_value" WHERE "type_instance" = 'interrupt' AND $timeFilter GROUP BY time($interval) fill(null)

The key here is derivative.
So in your select: field (value) - mean() - derivative(1s).

That should do the trick. Change the 1s to your interval.

Thanks, that did the trick!