Notification of Door open for a period of time

Hi, I am attempting to create a scene that notifies me after 15 minutes if my door is open. The door opens, my DSC door sensor is “open”, timer for 15 minutes then notify me. Th issue is that I get notified overyime the door is open since I can figure out how to cancel the scene is the door sensor “closes” within the 15 minutes timeframe.

Any help on this for anyone? Thanks.

There are plenty of PLEG examples for this.

I guess that Richard refers to this: in the PLEG manual:
[i]There is a special predefined term that may be used in sequence expressions. Now is effectively an
interval timer with a one-minute period. Its presence in an expression will cause the expression to be
evaluated every minute. Now will have a timestamp of the current time when the evaluation takes
place. Note that Now is not a variable containing the current time although you could use #Now to
get its timestamp which is effectively the same thing.

LightOff LightOn and (LightOn; Now > 5:00)
LightOff will become true if LightOn remains true for 5 minutes.

Where does the Pleg code get placed? Where the luup code sectopn is? I would like to start learning this code instead of using standard scenes settings in vera. Which is easier Lua or Pleg. and can they be used interchangeably inside of vera gui iu5?

For PLEG Details See:,21603.0.html

You need to install the PLC and PLEG plugins … (The first is the common code, 90%, shared between PLEG and PLTS).

Yes PLEG can interact with Vera Scenes (why would you want to ???) and LUA.
PLEG does everything a Vera Scene can do and more … and better (relative to restarts).

THe latest versions of PLEG are UI7 only … you can get a UI5 version (quite stable!!!) from the end first post:,14446.0.html

Somewhat unrelated to the OP, but I’ve had a few cases where I’d have PLEG trigger a vera scene. It’s nice having the Vera scene there so a human can trigger it manually via the web UI or mobile app.

A quick and dirty way of doing this would be as follows:

Create a scene that uses the door open event as a trigger. You then run LUA code in the scene as follows:

[code]luup.call_delay (“eval_door_open”, DELAY, “”)

function eval_door_open(empty)
local Door_Status = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,Door_ID)
if (Door_Status == “1”) then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },DoorAlert_ID)
return (true)

The DELAY is how long in seconds you want your “open for” period of time to be. Door_ID is the ID number of the door sensor that triggered the scene in the first place - you’re checking to see if it’s -still- open after the delay period. DoorAlert_ID is a virtual switch or similar that will trigger another scene that does nothing but send you an alert than it ran and then turns the switch back off.

This will NOT track for the door being opened, closed, and then opened again within the delay window - that would require some extra coding and the use of device-level variables where you would keep track of “last open” time and determine if the last time it was opened was also the delay interval you’re looking for.

It was pretty easy to do with altUI workflows. I can post if interested.

Sent from my Nexus 5X using Tapatalk