30.11.2020, 07:26
Try adding this to the script before -- Color:
Code:
-- color temperature
name = addressmapping[item.name]
if name and item.state.ct then
addr = addressmapping[item.name]['ct']
if addr and addr ~= '' then
newvalue = math.floor(1000000 / item.state.ct)
currentvalue = addressmapping[item.name]['ctvalue']
if currentvalue ~= newvalue then
grp.update(addr, newvalue)
addressmapping[item.name]['ctvalue'] = newvalue
if logging == true then
log('lamp ' .. item.name .. ' color temperature is: ' .. newvalue .. ' K')
end
end
end
end