When emergency services (fire/ambulance/police) are responding to a call in an urban setting, time can be wasted by the responders having to search for the correct address, especially at night. If you are the one having the emergency, you can direct them to your house by causing your porch light to blink. The blinking light draws them in, saving precious time, which in some types of emergencies, that time can be the difference between life and death.
You can get Vera to blink your porch light, using the LUA code. I created a Vera scene, which has the below LUA code associated with it. I then programmed some of my scene controllers to envoke my “emergency” Vera scene.
A couple of notes on the code. My porch light is device 19. The third parameter of call_timer is the time (in seconds), and I am specifying a 1 second interval (for further informaton on the call_timer function, refer to the Wiki). And most importantly, there must be a way to stop the blinking once started (besides power cycling Vera). The LUA code is written so that if the scene is envoked a second time, the “sBlink” global variable gets reset, indicating to stop the cycle. One other suggestion is to not use CFL (florescent) bulbs in your porch fixture that will be blinked, as CFLs do not like to be blinked.
The LUA code:
function DipOnPorchLight(stuff)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“1” },19)
if (sBlink == “1”) then
luup.call_timer(“DipOffPorchLight”, 1, “1”, “”, “”)
end
end
function DipOffPorchLight(stuff)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=“0” },19)
if (sBlink == “1”) then
luup.call_timer(“DipOnPorchLight”, 1, “1”, “”, “”)
end
end
if (sBlink == “1”) then
sBlink = “0”
else
sBlink = “1”
luup.call_timer(“DipOffPorchLight”, 1, “1”, “”, “”)
end