I have a rule which triggers on a value getting above a level and staying there:
Unfortunately, that doesn't seem to actually be happening. What I see in the logs is this:
Obviously it's above 600 (and has been for hours), yet it continues to be "still waiting to stay for 0:10:00". It almost seems as if the 10-minute clock is being reset each time a new power reading is received, or perhaps as if it's never realizing that ten minutes have passed.
Where should I look to debug this?
I've not used a trigger in this way, but i suspect your Surmise is correct. The countdown is getting reset on every trigger.
Perhaps a trigger of changed and a conditional action would work better?
S.
I've considered that; if it were a binary outcome, it seems like it would be easy to just keep a Boolean local variable. (Something like legacy Rule Machine's trigger on truth change.) This rule has three states, and I'm trying to damp increases in state while rapidly responding to decreases in state.
Thinking about it, I might be able to conditionally set a variable, use a variable delay, then compare current and future state and cancel delayed actions if conditions no longer indicate an increase.
(Edit: A tad simpler, it turns out; I already set the bandMax and bandMin, so if I'm within the current bands, I just always cancel delayed actions. There's a case that should never delay and a case that should always delay, so only one case needs to use the variable delay trick. Of course, I'll build a queue of scheduled events to move up a level over the course of those ten minutes, then cancel the others once the first set executes, but I think that works.)
That said, it doesn't seem like that's how a typical user would expect the feature to work; I'd like to understand whether it's the behavior or my expectations that are incorrect.