SENSOR = 7
SES_SID = "urn:micasaverde-com:serviceId:SecuritySensor1"
period = 90
function checkLastTrip()
local LastTrip = luup.variable_get (SES_SID, "LastTrip", SENSOR) or os.time()
if (os.difftime (os.time(), tonumber (LastTrip)) >= period) then
luup.inet.wget('http://192.168.1.9:80/set_alarm.cgi?motion_armed=0&mail=0&user=USER&pwd=MYPASSWORD')
else
luup.call_delay ("checkLastTrip", period)
end
end
local Tripped = luup.variable_get(SES_SID, "Tripped", SENSOR)
if (Tripped == "1") then
luup.inet.wget('http://192.168.1.9:80/set_alarm.cgi?motion_armed=1&mail=1&user=USER&pwd=MYPASSWORD')
end
luup.call_delay ("checkLastTrip", period)
return true
I made a mistake : there are two LUUP tab , one in the trigger you use to start a scene ,and another one at the top of the page : “device triggers luup advanced”
I tried each time to place my luup code in the last one ,then realise ,there was another tab called luup event.
I dont really know the meaning of all this ,but now ,my vera is less useless ;D