This is what I found on the forum… it’s working for me
–Blink lights
–Enter the device ID’s here in the array with your device id’s
local array_lights = {XX, XX, XX, XX }
local original_status={}
local counter = 4
– set the counter value higher since you’ll probably want the light to flash for a while if the alarm is triggered
local delay = 1
function set_switch(device,value,value1)
luup.call_action(“urn:upnp-org:serviceId:SwitchPower1”,“SetTarget”,{ newTargetValue=value },device)
luup.call_action(“urn:dcineco-com:serviceId:MiLightRGBW1”,“SetWhiteMode”,value,device)
end
function light_on()
for i, device in ipairs(array_lights) do
set_switch(device,“1”)
end
luup.call_delay( ‘light_off’, delay )
end
function light_off()
counter = counter-1
if (luup.variable_get("urn:micasaverde-com:serviceId:AlarmPartition2", "Alarm", deviceID) == "None") then
--Set to original status
for i, device in ipairs(array_lights) do
set_switch(device,original_status[i])
end
elseif counter > 0 then
for i, device in ipairs(array_lights) do
set_switch(device,"0")
end
luup.call_delay( 'light_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
light_off()