Hi, I’m new to grafana and unfortunately couldn’t find any help yet related to my topic. First of all I’m using grafana version 6.6.1 with influxdb version 1.7.9.
I have a sensor that stores the state of the sensor in the Influxdb every minute. The state is either 0 or 1. I already have a graph (see picture) where I can see what the state is over the selected interval. In addition, I want to get the total number of hours and minutes over the interval where the status is 1 and display it in a singlestat panel. Is that possible somehow? I would appreciate some help, as I have no idea how to do this.
This is my query:
SELECT sum(“value”) FROM “state” WHERE (“entity_id” = ‘irrigation_motor’) AND $timeFilter GROUP BY time($__interval) fill(previous)
Thanks!