I just wanted to share with everyone what I have done with the PLEG plugin that I thought was pretty cool.
I have a motorized Kwikset deadbolt on my front door, I also have linked into my home security system which will let me know when the front door is open or not. So the logic below will automatically closed the front door 15 minutes after the last time the door was opened (FrontDoorOpened)or the last time it was unlocked (FrontDoorUnlocked), whichever is later. But it will not lock the front door if it is currently open (FrontDoorState), or if I have set the virtual switch which set a variable (FrontDoorVariable) to either enable or disable the automatic closing of the front door. I also have another virtual switch which is similar to the variable which is just a bypass to disable auto closing of any door including the garage door. This is typically used for when babysitters or other family are at the house and we are not.
This is what I have put within within the conditions field to make this happen:
((FrontDoorUnlocked AND (FrontDoorUnlocked; NOW > 15:00) AND (FrontDoorOpened; NOW > 15:00)) AND (FrontDoorState == 0) AND (FrontDoorVariable eq “Enable”)) AND (AtHomeBypass == 0)
Thought I would share this seeing that learning from examples is usually the easiest way to learn.