Replies: 1 comment
-
Here is my solution
First I map all the values larger than 0 to 1 because I don't care about the power value. I just need to know if it's on or off. Then I apply "increase()" which sums up the changes from 0 to 1 which are essentially the times the device was powered on. |
Beta Was this translation helpful? Give feedback.
-
Hi community,
I'm a little lost with the following problem. Hopefully someone has an idea how to solve it.
I'm injecting power value measurements (Watts) into Influx and want to detect power ons on that data later.
So I need to count how often there is a zero value followed by a value larger than zero. Maybe I'm just missing the right key word to search. Technically it's like detecting a rising edge,
I've found these but they don't fit exactly:
https://docs.influxdata.com/flux/v0/stdlib/universe/increase/
https://docs.influxdata.com/flux/v0/stdlib/universe/difference/
Any help is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions