I have a Schlage BE469NX deadbolt and an Ecolink DW-ZWAVE2 door/window sensor.
I’m using UI5 with a VeraLite controller.
What’s the proper way (triggers, Luup code?) to lock the deadbolt after 20 minutes after the deadbolt was unlocked if the window/door sensor is closed?
This is the logic:
- Deadbolt is unlocked AND door sensor is opened (IOW, door was unlocked and opened)
- Start counting down 20 minutes.
- The door may be opened and closed repeatedly during this time. Deadbolt is unchanged.
- At 20 mins, lock the deadbolt IF the door sensor is closed (IOW, if the door is closed)
- Keep trying until the door sensor is closed and the deadbolt is locked
Right now I simply just have a 20 minute delay after the deadbolt is unlocked, then the deadbolt is locked. It often locks the deadbolt with the door wide open when I don’t bother closing the door. I’m not sure how to integrate the window/door sensor into the equation.
PLEG is ideal for this.
Input Timer:
CountDown On - Self retrigger … Off Interval 20:00
Input Trigger:
DoorUnlocked Door Indicates unlocked
DoorOpen Door Indicates opened (tripped)
WindowOpen Window Indicates opened (tripped)
Conditions:
ReadyToLock DoorUnlocked and !WindowOpen and !DoorOpen
LockDoor ReadyToLock and (ReadyToLock; CountDown)
Actions:
ReadyToLock Use the advanced tab, add the PLEG device, StartTimer action, TimeName = CountDown
LockDoor Lock the door
[hr]
I could not determine if you have both a door and a window sensor or a single sensor that could be a door or window sensor.
If the latter then just delete the WindowOpen trigger and it’s use in ReadyToLock
[quote=“RichardTSchaefer, post:2, topic:185771”]PLEG is ideal for this.
Input Timer:
CountDown On - Self retrigger … Off Interval 20:00
Input Trigger:
DoorUnlocked Door Indicates unlocked
DoorOpen Door Indicates opened (tripped)
WindowOpen Window Indicates opened (tripped)
Conditions:
ReadyToLock DoorUnlocked and !WindowOpen and !DoorOpen
LockDoor ReadyToLock and (ReadyToLock; CountDown)
Actions:
ReadyToLock Use the advanced tab, add the PLEG device, StartTimer action, TimeName = CountDown
LockDoor Lock the door
[hr]
I could not determine if you have both a door and a window sensor or a single sensor that could be a door or window sensor.
If the latter then just delete the WindowOpen trigger and it’s use in ReadyToLock[/quote]
Thanks RTS.
I have a single sensor that could be used for door/window.
Which RTS product(s) do I need to install? Do I install the Program Logic Core, Program Logic Event Generator, or both?
I might have asked for something else in my original message, but on second-thought, I’d like the countdown timer to start after the door is closed and if the lock is still open.
I’m trying to understand how PLEG works, but I’m having trouble getting the CountDown timer to start when the !DoorOpen condition is met.
What’s happening is, as soon as the !DoorOpen condition is met, the LockDoor event fires without delay immediately. If the door is opened again before the CountDown expires, then it should restart the CountDown timer from the top when the door is closed again.
I’ll try and figure it out, but I’d welcome any help.