Scene help required

Hello All

I want a Luup which does the followings:
-When the Door is opened
-the program will wait 30 seconds
-after this 30 seconds if the door sensor is Armed it will activate a Sound (device# 21) for 10 seconds and send a Notification via Powrl
-if the door is Bypass it will only turn on device# 8

i have done the followings but i always got an error and i couldn’t make the 10 seconds which the alarm will be activated at.

function tuning()
local doorstatus = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Armed”, 6)
if (doorstatus == “1”) then
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 21)


return true

else luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”, “SetTarget”, {newTargetValue = “1”}, 8)


luup.call_delay(“tuning”, 30)

any help would be appreciate it

I think this could help you, it’s a very similar setup:,8996.msg58772.html#msg58772

You could do something like this to achieve the ten seconds:

luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "1"}, 21) luup.sleep(10000) luup.call_action("urn:upnp-org:serviceId:SwitchPower1", "SetTarget", {newTargetValue = "0"}, 21)

It worked thank you :smiley:

i just needed this luup.sleep thing

i searched the forum couldn’t find it


Basically you wouldn’t even need to do the delay with luup, you could just add that in the normal scene with delays.

Still glad it worked.