25.08.2020, 11:32
(25.08.2020, 10:45)Erwin van der Zwart Wrote: Hi,yes, I do.... and I use 05.001 scale for R, G, B and W.
Just tested it and works as it should, are you using dpt 12.600?
BR,
Erwin
Maybe it depends about when both scprits are enabled, they generate a sort of loop back.
Here are my script:
EVENT SCRIPT 'mergeRGBW'
R= grp.getvalue('32/3/1')
G = grp.getvalue('32/3/2')
B= grp.getvalue('32/3/3')
W = grp.getvalue('32/3/4')
RGBW = R * 0x1000000 + G * 0x10000 + B * 0x100 + W
if RGBW ~= grp.getvalue('32/1/20') then
grp.update('32/1/20', RGBW) --- icon address
alert (RGBW)
end
EVENT SCRIPT 'splitRGB'
value = event.getvalue() ---- from 32/1/20 icon address
-- Split
R = bit.rshift(bit.band(value,0xff000000),24)
G = bit.rshift(bit.band(value,0x00ff0000),16)
B = bit.rshift(bit.band(value,0x0000ff00),8)
W = bit.band(value,0x000000ff)
if R ~= grp.getvalue('32/3/1') then
grp.update('32/3/1', R)
alert®
end
if R ~= grp.getvalue('32/3/2') then
grp.update('32/3/2', G)
alert(G)
end
if R ~= grp.getvalue('32/3/3') then
grp.update('32/3/3', B)
alert(B)
end
if R ~= grp.getvalue('32/3/4') then
grp.update('32/3/4', W)
alert(W)
end
That's all. Still, there is a visualization issue like a reattach here