Looking for a special solution for total uptime and counting on/off switching

Hello @ArminPP,
I think I understand your problem but please let me know if I’m missing anything. I’m not sure about the best way to do this with Grafana, but I can help on the Influx side.

First I would run a task with a threshold that assigns the data to a “on” or “off” status (or potentially a deadman alert would work here? I don’t know if you have no data coming in during the off period or data=0). I believe the monitor states documentation will be useful to you.

I also hope these blogs will be useful to you:

Now to answer your specific questions:

  1. and 2. I would use monitor.stateChanges() within a task to count the number of “on” states.

3 and 4. I would use the stateDuration() to monitor the time of each signal.

  1. After defrosting you could perform another task to add a tag to the data to identify that work has been performed. For example set() might work.

  2. Alternatively you could just write a point to InfluxData to include these markers. This blog talks about the various ways to easily write one point (or a few points) to InfluxDB. TL;DR Tech Tips — How to Construct a Table with Flux | InfluxData