02.11.2020, 15:30
(02.11.2020, 14:57)Daniel. Wrote: 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.Thanks for the quick answer. That would work, but like dimming 3 independent lights.
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
I think the theorical way should be, first, to convert those 3 1byte objects in a 3byte RGB value (232.600). After that, to "dim" that value and, finally, go the other way round.
The problem is I can't achieve that
.