This object is in archive! 

Do rules use a snapshot of values from when the rule was triggered?

Mattias Backman shared this question 9 years ago
Need Answer

It seems that changes to switches and meters that happen during a rules execution do not take effect.


I have for instance a rule to dim down lights in a room after a period of inactivity. So the rule is basically

WHEN ( room NO_MOTION)

WAIT timeout

IF ( dimmerlevel < 40 ) {

ACTION dimmerlevel GOTOLEVEL 40

}


When I leave the room, the rule triggers (NO_MOTION) and a bit later I turn that light completely off manually, maybe when leaving home. After the timeout, the light goes to 40 even if it was lower than 40 or even completely off.


It seems that the rule takes a snapshot of the dimmerlevel when the rule starts. I would expect it to check the value of the dimmer when the IF is reached, not before. Are my rules weird again, or have anyone else noticed this?

Replies (3)

photo
2

You can solve your problem by inserting a refreshall after the wait. I think that some kind of snapshot is taken.

photo
1

So that's what refreshall is for... :) Thanks, I'll try that.

photo
1

Thanks John, that seems to have solved my problem.

Leave a Comment
 
Attach a file