Uptime/operating hours per day

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)

Thanks for your help/ideas.