I would like to create a scene that makes the lights flicker when a certain even has been triggered, i have the trigger in mind, but i need help with how i can have the lights flicker for like 5 seconds, when this scene is triggered.
Unless the device controlling the light(switch/relay) has a flicker feature, very few do, then you will not be able to get flickering. What you can do is have a scene turn a light On and Off several times. Just remember that a Z-Wave command takes about a second to send the command and receive the acknowledgment that the command was received and performed. For this reason, you should not send too many or too fast commands.
To do this with a scene, you could create an immediate action to turn the light On, then a 1 second delayed action to turn Off, then another 1 second delay and On again…
You could also write a bit of Lua/LUUP code, a loop that sends the toggle command to the light however many times you like. See this thread for an example of using LUUP to blink lights.
@Z-Waver, thank you so much for pointing me to the resource. Surely it helped me.
The script below found on the 2nd post of the page works perfectly for me.
--Enter the device ID's here in the array with your device id's
local array_lights = {1,2,3}
local original_status={}
local counter = 10
local delay = 3
function set_switch(device,value)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=value },device)
end
function tree_on()
for i, device in ipairs(array_lights) do
set_switch(device,“1”)
end
luup.call_delay( ‘tree_off’, delay )
end
function tree_off()
counter = counter-1
if counter > 0 then
for i, device in ipairs(array_lights) do
set_switch(device,"0")
end
luup.call_delay( 'tree_on', delay )
else
–Set to original status
for i, device in ipairs(array_lights) do
set_switch(device,original_status[i])
end
end
end
–Save Original status
for i, device in ipairs(array_lights) do
original_status[i] = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”, device)
end
I’m in the process of creating something similar using PLEG to make my porch light blink.
For fun I decided I want my porch light to flash red and blue if my home alarm goes off, still working out the kinks I can get the flashing/blinking effect of on and off and I can get the color change, now I just need to program it to make that all repeat for as long as the alarm is active and then go back to what ever state it was in before the alarm triggered the flashing, so if off it would turn off, if on it would stay on but go back to the color it was before the red and blue flashing.
Best Home Automation shopping experience. Shop at Ezlo!