This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

How to use new datatype RGB-W
#9
(25.08.2020, 10:45)Erwin van der Zwart Wrote: Hi,

Just tested it and works as it should, are you using dpt 12.600?

BR,

Erwin
yes, I do.... and I use 05.001 scale for R, G, B and W.

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

Attached Files Thumbnail(s)
   
Reply


Messages In This Thread
How to use new datatype RGB-W - by gdimaria - 14.08.2020, 12:30
RE: How to use new datatype RGB-W - by Daniel - 14.08.2020, 12:57
RE: How to use new datatype RGB-W - by admin - 14.08.2020, 12:59
RE: How to use new datatype RGB-W - by gdimaria - 25.08.2020, 11:32
RE: How to use new datatype RGB-W - by admin - 25.08.2020, 11:38
RE: How to use new datatype RGB-W - by admin - 25.08.2020, 13:00
RE: How to use new datatype RGB-W - by Daniel - 25.08.2020, 15:57
RE: How to use new datatype RGB-W - by admin - 26.08.2020, 08:12
RE: How to use new datatype RGB-W - by Daniel - 26.08.2020, 08:12
RE: Urgent! - by gdimaria - 18.09.2020, 08:07
RE: How to use new datatype RGB-W - by Daniel - 18.09.2020, 08:09
RE: How to use new datatype RGB-W - by admin - 18.09.2020, 08:12
RE: How to use new datatype RGB-W - by Daniel - 22.09.2020, 13:52
RE: How to use new datatype RGB-W - by Daniel - 22.09.2020, 15:20
RE: How to use new datatype RGB-W - by Daniel - 23.09.2020, 07:55
RE: How to use new datatype RGB-W - by Daniel - 23.09.2020, 08:18
RE: How to use new datatype RGB-W - by Daniel - 24.09.2020, 08:44

Forum Jump: