Good day Sirs.
I want to make following:
The door at toilet is always closed. If someone wants to go to the toilet, he opens the door (the door sensor is triped) and the lights on, he entered to the toilet closed the door and the light is still on). Then he has finished his deals, he wants to leave the toilet - opens the door and the light is off. Sometimes may happen, if someone opened the toilet door by mistake and left it opened - the light will remain ON. How can I automatically switch it off for example after 10 minutes if the door is opened.
To resolve this situation, I’ve created to scenes:
- “Turning the lights on”. The start value of sensor is Bypassed. the trigger is set if the device is tripped, than turn On the light and set the sensor status in 5 seconds to Armed. The LUUP code is following:
local lul_tmp = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Armed”, 46)
if (lul_tmp == “1”) then
return false
end
- “Turning the lights off”. The start value of sensor is Bypassed. the trigger is set if the device is tripped, that turn Off the light and set the sensor status in 5 seconds to Bypass. The LUUP code is following:
local lul_tmp = luup.variable_get(“urn:micasaverde-com:serviceId:SecuritySensor1”, “Armed”, 46)
if (lul_tmp == “0”) then
return false
end
This procedure is working very good. But I can’t understand how to set the scene, if someon will leave door opened, the system will shut down the light automatically in 10 minutes.
Please advice your ideas.
Thanks in advance.