Lock door after it has been closed for 5 minutes?

Hi all,

Could someone provide steps on how I can configure my VeraEdge to automatically lock my Yale deadbolt after the door has been closed for 5 minutes? I have a door sensor and a Yale touchscreen deadbolt connected to the controller.


You can take the simplest approach …
Create a scene that is triggered when the door is closed.
In that scene create a 5 minute delayed action that locks the door.

Problems with this scenario:

  1. If Vera restarts during that 5 minute interval … the garage will not lock
  2. If you Go through the door 4:30 seconds later … it will still lock the door 5 minutes from the first event.

You can work around #2 with LUA code, or Countdown Timer Plugin and a couple of scenes or using the PLEG plugin.
There are plenty of examples of all of these solutions if you search the forums.

If you want to handle both problems then you need the Countdown Timer OR PLEG plugin solution.

As author of PLEG I recommend PLEG.


Yes, I am interested in using the PLEG plug-in. So I would also need to use the PLTS as well?

Do you see anyway to resolve both issues you mention? This is going to be my first attempt with Vera is it’s a bit daunting.


I have three Plugins:
c) PLC

PLEG has the most flexibility. One plugin can replace dozens of scenes. (i.e. use the same plugin for multiple tasks).
But it does not have a User Interface to control the logic. It’s more oriented towards automation.

PLTS pre-dates PLEG, and was motivated as a replacement for Countdown Timer, without the need of multiple external scenes.
It has buttons to start/restart/cancel a timer as well as attach actions and complex conditions to these buttons.

PLC is common code to both of these. So you will need this for either/both PLEG or PLTS.

@RexBecket has done a great job at providing intro guides for both of these.


I think I’ve got it working. I want the door to auto lock when it has been unlocked for at least 5 minutes and the door has been closed for at least 5 minutes. This way if the door is closed and I unlock it it won’t auto lock immediately, giving me time to exit.

I’ve attached the report for my setup. Can you look it over and see if you see anything wrong with it? Or recommend any improvements?


This can be reduced and simplified as:

ClosedAndUnLocked pFrontDoor == 0 AND pFrontDoorLock == 0
AutoLock ClosedAndUnLocked and (ClosedAndUnLocked; NOW > 5:00)

Thanks for the input. Can you tell me what the implications of having multiple NOW checks in a condition would have? Would it decrease performance? Maybe force more checks of the condition unnecessarily?

It does not matter how many times you references it.
Using it in ANY condition will cause all of the conditions to be evaluated once per minute.

My recommended simplifications are for user consumption.