I have a siren, and a door sensor.
When i’m in the Away mode, and if the door is opened. I have a delay action with the siren like the siren scream 20 seconds after a delay.
If in the lap times between 0 and 20 seconds I go in the HOME Mode, I would like the action siren cancels.
Presently, I had done the test : When I open the door, the delay action runs, if I enter to the HOME Mode, it doesn’t stop the delay action…
Without PLEG you would need to create a bit of LUA code in the scene that runs the delayed action and in that action checks the home status. Something like this, but I do not know the call_action details to sound the alarm, but I think it works like a switch.
-- replace xx with thedevice number of the Siren device.
local cALARM_DEV = xx
-- Check Home (house mode = 1) status and sound alarm if not
function finishAlarmCheck()
local house_mode = luup.attr_get("Mode",0)
if (house_mode ~= "1" ) then
luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget",{newTargetValue="1"}, cALARM_DEV)
end
end
-- Schedule for action to turn on device in 20 secs
luup.call_delay("finishAlarmCheck", 20)
-- Return True to let scene finish.
return true
Have fun.
Cheers Rene
Best Home Automation shopping experience. Shop at Ezlo!