The logs should show the triggers, evaluation of the conditions, and the resulting actions. You should be able to see which condition is evaluating correctly. But you have to turn the logging options on in the rule.
I would suggest you add a “Cancel delayed actions” at the beginning. Otherwise, the rule will re-trigger if say a lock was locked, it triggered a delay, then before the delay is over, someone opened one of the doors, closed it and locked it again.
Also, not required, but a good practice to add an “End-if” at the end of the rule.
Hey @Sebastien thank you! I actually came here to type exactly that. I looked at the log and it looks like once the delay has started if someone unlocks it does not cancel. Could you please guide me on how to add the "Cancel delayed actions" to avoid this. I see the Cancel delayed action but don't know how to add it to the logic
@Sebastien is probably best to guide you through it, but I'll have a go and offer a couple of suggestions along the way....
I would expect the delay action to have a cancelable option, you need to turn that on.
Next insert a new action in before the delay to cancel actions from this rule.
My suggestion would be to introduce an else at the end to cater for when any of the doors are opened or unlocked. You should also cancel the delay in that case as well. Would you also want to adjust the mode in this situation as well?
One thing I am not sure about is what happens to the mode change, whether cancelling just means the rule moves on to the next action. Hopefully someone can offer some insight or you can test it and find out.
I don't think you need an IF as part of the ELSE. With the triggers you have and the IF condition at the beginning, there are essentially two main scenarios:
Rule triggers when something changes with your doors or locks:
Scenario 1 - IF condition is true when doors are all locked and closed
Scenario 2 - when the IF condition is false, then the rules drops into the ELSE block, so you know that either a door is open or unlocked, so you don't need to re-check this. It's not incorrect, just not necessary, but could lead to problems if you change the criteria for some reason earlier in the rule, better to define that once in the IF condition.
I know how to actually add it before but since the delay is part of the If block I don't know what you mean by add the cancel delay (part of the else block) above the delay? Here is what I have so far.
Thinking about it now, you don't actually need that one... The cancel in the ELSE caters for the house being opened up and then closed / locked again. Still not a bad idea to just leave it in there now that you have it.
If you want to simplify it, you could move the first “Cancel Delayed Actions” to the very top (before the “IF”) and then eliminate the else and the second “Cancel Delayed Action”. The result will be the same since it is currently called regardless of the condition.