Recommendation for visualisation of device operating time

Hi everyone,
I am a Grafana (v9.5.2 ) / InfluxDB (v2.1.1) novice and struggling with displaying the operating time of 13 devices (fan_1 to fan_13) with boolean values (0=off, 1=on). When grouped in individual queries using ‘Status History’ chart type, I encounter ‘too many datapoints’ error. Here is a condensed version with 4 of the 13 parameters.

What would be the best practise approach to visualise the device operating time over time ?

Current query snippet below:

from(bucket: “nodered9”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r[“_measurement”] == “fan_13”)
|> filter(fn: (r) => r[“_field”] == “value”)
|> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
|> yield(name: “last”)

Thanks in advance,
Max

You have too fine time granularity, so many datapoints is generated. I would try to increase time window (no idea how to do that with flux) and use min/max aggregation.