Notify based on delay/conditions

I am new to Vera. I have a garage door sensor. I have it notify me when it opens or closes. I would like it to notify me only if the door is open for more than 5 minutes.

I searched the forums and found and modified this code.

[code]urn:schemas-micasaverde-com:device:MotionSensor:1

local SENSOR = 3 – The door/window sensor device number
local DELAY = 300-- Seconds

local SES_SID = “urn:schemas-micasaverde-com:device:MotionSensor:1”

luup.call_delay( “NotifyGD”, DELAY)

function “NotifyGD”, ()
local tripped = luup.variable_get( SES_SID, “Tripped”, SENSOR) or “0”
local lastTrip = luup.variable_get( SES_SID, “LastTrip”, SENSOR) or os.time()
if (tripped == “1” and (os.time() - lastTrip >= DELAY)) then
—need notfication code

end

end[/code]

I’d rather not use any plugins.

My questions are:

  1. Can I put this in a scene under the LUUP tab? Not sure if that is how to do this.
  2. How do I get it to send the notification? As I said, I’d rather not use a plugin if I don’t have to for various reasons.

Thanks

Bump :slight_smile:

I’m trying to figure this out right now as well… having a hard time figuring out the delays in UI7, I might need to learn LUUP.

[quote=“Dnomyar220, post:2, topic:180544”]Bump :slight_smile:

I’m trying to figure this out right now as well… having a hard time figuring out the delays in UI7, I might need to learn LUUP.[/quote]

To learn about language syntax: http://www.lua.org

To learn about the Vera implementation of LUA and API: http://wiki.micasaverde.com/index.php/Special:AllPages