Good morning.
I have a 2 vera.
I have a motion sensor and a 3 in 1 made elctrique controlled by vera.
I’d like to light a lamp plugged into the outlet when my son this up at night.
and the day the lamp will not light.
can you tell me if the code is good luup?
if (luup.is_night ()) then
return false
end
local Device3 = 14
local RandOnTime3 = 3600
DelayOn3 function ()
luup.call_action (“urn: upnp-org: ServiceId: SwitchPower1”, “setTarget” {newTargetValue = “1”}, Device3)
luup.call_timer (“StayOn3”, 1, On3, “”, “”)
end
It sound like you’re interested in turning a light on for a few minutes when motion is detected?
Have you considered using the available events (i.e. no code) to accomplish (most of) this? You could then add the [tt]luup.is_night()[/tt] bit to only run it at night.
Yes. You could create two separate scenes, one for On and one for Off, if you can control the delay / on-time of your sensor. The sensor will then notify Vera when it’s tripped, and when it’s not tripped anymore. Vera can then turn the light on/off in response to those events.
See if you can get that to work, then add the [tt]luup.is_night[/tt] part.
Best Home Automation shopping experience. Shop at Ezlo!