I admit I may have this logic wrong or going about this the wrong way. I have random issues with Schlage locks not always following commands (Schlage BE469NX connectivity issues / unreliable), so I have a rule to notify me if own doesn't lock. I came back tonight and unlocked a lock to test and it told me everything was fine.
Can a rule be delayed after a trigger and set to re-evaluate the state? That's what I intended to do, but I fully expect I did it wrong.
I don't see anything wrong with the rule, the problem you have probably this rule will not solve it, the 469 lock sometimes doesn't follow commands or not update the status, so with this rule maybe you get a message that all is safe but is not, one lock is unlocked but the state is incorrect. You could add a rule to your doors for a 15 min refresh, but this could impact the battery, it would be great if we can add locks to the poller app... I will look something, maybe helps you.
I went back by the lock to unlock it after it locked and verified it showed as unlocked. My thinking is the only thing delayed was the notification and that the rule didnāt re-evaluate.
Why would the rule re-evaluate? The trigger didn't occur. You have to have a trigger for the triggered-rule to fire. You can only force re-evaluation of a regular rule to re-determine if it's true or false. However, I think you could do the same thing with a regular rule and move the two modes to Restrictions rather than triggers. The rule will only fire when the mode changes, not when the locks state change. A regular rule will evaluate whenever the sate of one of the conditions changes.
Understood, but I donāt want it to run constantly while away or asleep, I want it to run when the mode changes to away or sleep, pause for 2 minutes, evaluate if the locks are locked, if not, lock them and send me a message.
Is there a way to have an action delayed after a trigger, have it evaluate something, and do something based on if true or false? I got it working by removing the trigger, but that seems to have the check run constantly when in those two modes.
Seems like you're trying to solve: I told it to lock, if it didn't, tell me.
Why not just code that and not have to burden this with why you told it to lock?
In other words, two Rules, one is to lock the lock and test the lock 2 min later and tell you of the fail. The second Trigger is at Away and Sleep you invoke the Lock and Test Rule?
So have this as the 2nd rule and call it from the Trigger that is doing the locks when going away/asleep? I guess I wanted to have the notification in there but only if one was found unlocked so I could keep track of how jacked up Schlage Zwave locks with the Hubitat driver are.
That's not how rules work. They "run" when one of the subscribed devices triggers an event that they subscribe to. So, if your locks are the device, when one of them locks or unlocks, that would be the event that triggers the rule to re-evaluate as true or false. When you have a trigger, the only thing that can cause that is the trigger event. Your rules are technically always running...they just don't do anything until there is a state change from true to false or false to true.
Here's an example that may help. When my front door is closed but unlocked, then it waits three minutes and locks the front door. As @Ryan780 wrote, it's not running all the time. In this case, either the door being closed triggers or the lock being unlocked creates an event that is then tested in the rule. If they both are true, then the rule executes with the delay. If the door is opened or the lock is locked during the 3 minutes, the rule then cancels.
It's not the same as yours, but hopefully it'll give you some idea of how to make yours work the way you want it to.