Technically, your rule should work. It could definitely use some consolidation - there are ways to avoid needing that many nested ifs. But the rule should work ok - if it was a standalone app. But rule machine rules can get messed up by repeated triggers when there are nested ifs, using repeats, and/or delays. There are ways to avoid it, so you can make a rule that will work.
First a couple of suggestions. Instead of doing so many separate IF statements, you can use AND in the condition to put a whole bunch of conditions into one IF statement. For example:
IF the time is between 11 pm and 7 am AND the alarm mode=off AND the doors are all closed AND the motions sensors are all inactive THENā¦
Also, you are checking conditions twice, because things might change during the delay. The only situation where the time would be out of range after the delay would be for any triggers that happen after 6:35 am. If you get a trigger at 6:34 am, after the 25 minute delay it will still be before 7 am, but a trigger at 6:35 or later will be at or beyond 7 am. So just end the time range at 6:35, then you don't need to recheck the time again after the delay.
Since, the placement of delays in conditional statements can get touchy, you might try moving the delay to before the repeat. You will get exactly the same results, with less chance of an error. It will wait 25 minutes, then do the stuff in the repeat, then repeat that stuff every 25 minutes. That way you donāt need delay inside the repeat.
Your ruleactive variable should prevent repeats of the rule, but there is currently bug in Rule Machine. āStop Repeating Actionsā takes awhile to totally stop things. If you have a 25 minute repeat, you stop repeating actions, and then get another trigger within the next 25 minutes, your repeat will be un-stopped. I had pointed this out in another thread, and Bruce Ravenel looked at it and said it there is something not working right and hopefully it will be fixed in the next release. But there are ways to make a rule that avoids that problem. Your error actually involves the delay - ā(delayedActsCancel)ā is mentioned in the error - but could also be a result of having the delay inside an IF statement and then repeating it - and the repeats may be caused by the bug I mentioned.
You definitely want to cancel delayed actions. Also, you really only need your motion triggers to look for Active, not changed. That can cut down on extra triggers.
Before going any further, I have a couple questionsā¦
If the alarm is armed, will the motion sensors set off the alarm? Is that why you are waiting 25 minutes after the motion stops?
Sometimes a solution to problems like this would be to break the rule up into a couple of smaller rules. It can probably be done in one rule, but it may be simpler with more than one. A lot of people prefer to have one rule and donāt want to use a two rule solution. What is your preference on that?