02.11.2020, 14:57
Pure conversion of this script in to dimming of 3 objects is this but I'm not sure if this is what you need. Most likely you would have to calculate saturation.
Code:
addressbyteoutput1 = '32/1/1'
addressbyteoutput2 = '32/1/2'
addressbyteoutput3 = '32/1/3'
stepsize = 10
value = event.getvalue()
current1 = grp.getvalue(addressbyteoutput1)
current2 = grp.getvalue(addressbyteoutput2)
current3 = grp.getvalue(addressbyteoutput3)
if value < 8 and value ~= 0 then
log('down',value)
if current1 <= stepsize then
output = 0
if current1 ~= output then
grp.write(addressbyteoutput1, output)
end
else
output = current1 - stepsize
if current1 ~= output then
grp.write(addressbyteoutput1, output)
end
end
if current2 <= stepsize then
output = 0
if current2 ~= output then
grp.write(addressbyteoutput2, output)
end
else
output = current2 - stepsize
if current2 ~= output then
grp.write(addressbyteoutput2, output)
end
end
if current3 <= stepsize then
output = 0
if current3 ~= output then
grp.write(addressbyteoutput3, output)
end
else
output = current3 - stepsize
if current3 ~= output then
grp.write(addressbyteoutput3, output)
end
end
elseif value > 8 then
log('up',value)
if current1 >= (100 - stepsize) then
output = 100
if current1 ~= output then
grp.write(addressbyteoutput1, output)
end
else
output = current1 + stepsize
if current1 ~= output then
grp.write(addressbyteoutput1, output)
end
end
if current2 >= (100 - stepsize) then
output = 100
if current2 ~= output then
grp.write(addressbyteoutput2, output)
end
else
output = current2 + stepsize
if current2 ~= output then
grp.write(addressbyteoutput2, output)
end
end
if current3 >= (100 - stepsize) then
output = 100
if current3 ~= output then
grp.write(addressbyteoutput3, output)
end
else
output = current3 + stepsize
if current3 ~= output then
grp.write(addressbyteoutput3, output)
end
end
end
------------------------------
Ctrl+F5
Ctrl+F5