Hi There, i have done a lot of stuff with grafana already, but now i am a bit stuck…
I have several sensors that report 1 when the machine/heater is on, 0 when off. report interval of the sensors may differ over time.
I would like to display the operating hours per day for these 1/0 sensor values.
In the single stat it should show the avg hours per day for the selected timerange,
in the graph i would like to have the on-hours per day for the selected timerange.
I guess it must be quite simple to do that, but i am totally lost here. I tried to do something like sum(sensor) / count(sensor) which should give the avg over time, but i somehow need to agregate that to hours per day.
SELECT sum(“Brenner”) /count(Brenner) FROM “sensors” WHERE (“location” = ‘heizung’) AND $timeFilter GROUP BY time(1d) fill(null)
I have a similar situation. My heater counts the secounds, when it is on. The counter pauses, when heater is off, and continues, when it goes on again. The value I send to influx every 5 secounds. Making a graph in grafana shows a horizontal line when heater is off and an “upward slope” when it was on. That’s ok so far, as I from the lenght of the slope I can see for how long it was on.
But I would like to have also a daily “on” time value. Is it possible somehow to tell grafana to look for the first and last value of the day/week/month and show only the difference?