There are some other ones out here but perhaps not as complex as this one I used to have in WebCoRE. I am still pretty new to rule machine and I am stumped. Any suggestions on how to do this one would be more than welcome.
Specifically I am trying to build in 4.0 an auto lock rule which attempts to lock the door after it has been unlocked manually or digitally.
-If the door never opens after unlock it should wait 2 minutes and then attempt to lock.
-If the door does open then it should wait for it to close for 5 minutes. if it does Close then attempt to lock after a full two minute delay.
-IF after Opening, the door doesn't close for 5 minutes, it should send a notification that the door was left open.
-If after attempting to lock the door the door fails to lock then attempt to lock the door 3 more times waiting 15 seconds or so between attempts. If after three more attempts the door still doesn't lock then send a message that the door is jammed.
-Also, if the door closes and then reopens during the two minute delay before locking then the two minute Delay before locking should be stopped and retest the above conditions for open and locked states.
I am hesitant to use the Door is changed as the trigger because after the door auto locks it will trigger the rule again. Just seems inefficient. Does rule machine have a way to check a condition that specifies the state change from one value to another?