This is my DZvents script:
Code: Select all
return {
on = {
devices = {
63,
}
},
execute = function(domoticz, device)
local lightIds = {}
for i=1,#domoticz.helpers.SpotsRight do
lightIds[#lightIds+1] = domoticz.helpers.SpotsRight[i]
end
for i=1,#domoticz.helpers.SpotsLeft do
lightIds[#lightIds+1] = domoticz.helpers.SpotsLeft[i]
end
local function color2Params(color)
return color.r, color.g, color.b, color.brightness, color.cw, color.ww, color.m, color.t
end
local function displaycolors(color)
return 'r:' .. color.r .. ', g:' .. color.g .. ', b:' .. color.b.. ', br:' .. color.brightness .. ', cw:' .. color.cw.. ', ww:' .. color.ww.. ', mm:' .. color.m .. ', tt:' .. color.t
end
for i=1,#lightIds do
if not(domoticz.devices(lightIds[i]).state == device.state) then
domoticz.devices(lightIds[i]).setState(device.state)
end
if device.state == 'On' then
domoticz.devices(lightIds[i]).setColor(color2Params(device.getColor()))
end
end
domoticz.log('Device ' .. device.name .. ' was changed: ' .. displaycolors(device.getColor()), domoticz.LOG_INFO)
end
}
- Changing from WW to Color and vise versa does not work. Only after switching the LEDs off and on again it shows the correct color.
Is this an Domoticz issue, a dzVents issue, or a Marque issue?