I’m just dipping my toes into messing around with Rule Machine, and I have a question. I’m trying to set up some rules where specific lights will turn on when motion is detected and then off after a delay once motion stops. How I have it now is the lights will turn on when motion is [TRUE] and then turn off after a delay if motion is [FALSE]. It just occurred to me that having it set up this way may cause a constant loop of it trying to turn off the lights every 5 minutes if there’s no motion. What I'd like is for it to only trigger when the sensor goes from active to not.
Look in your Live Logs, I think you'll find it doesn't.
Rules only fire when there is a change of rule truth. So a rule being false over and over won't do anything. Also, rules are event driven. Your rule will be evaluated every time there is a motion event, but not otherwise (it isn't just sitting there looking at the state of the world).
You probably want to use turn off after a delay with Cancel on rule truth change. Here is the sequence: motion active, rule becomes true, lights turn on. Motion stops, rule becomes false, timer starts for the delay. Motion starts again before the lights have turned off, rule becomes true again, and the lights are already on. Motion stops again, rule becomes false, and the timer starts. Eventually the timer will run down without there being a new motion active event, and the lights will turn off. At that point, the rule is false. The next motion event will cause a change in rule truth, so it will turn on the lights....
Terrific, thank you!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.