I'm looking for a solution to create an output that is the timestamp (hopefully to the second) of when another attribute goes above a particular value (in this case 0). While this other attribute remains above 0, I want my new output to remain at the same timestamp, only resetting to 'unit offline' when the other attribute goes below 0 again.
This is my attempt below, x2 is the calculation in question. I have highlighted in green a point where this solution did not seem to work well.
Does anyone have any suggestions for improvements?