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:
- Can I put this in a scene under the LUUP tab? Not sure if that is how to do this.
- 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