(21.03.2024, 09:13)admin Wrote: Try using xy_to_rgb from user.hue v2.lua: https://forum.logicmachine.net/showthrea...50#pid6250
I'm trying to use xy_to_rgb from user.hue v2.lua. But I can't be doing it right. I have copied the function into common functions. Then I have in the event script:
Code:
xy = zb.cmdsync('getxy', addr)
rgb = xy_to_rgb(xy['x'],xy['y'])
log(rgb)
But I get the excact same rgb value wether I have red or blue light. (255,0,0) or (0,0,255) gives the same rgb value. But the lamp is red or blue correctly. For colours without blue the result makes sense I think, but it seems like blue and red is mixed up somehow.
Value of variable rgb is 16711680 for both (255,0,0) and (0,0,255)...
I can see that the x and y values differ (45913,19614) for red and (8880,2613) for blue - so the result shouldn't be equal...
Any hints?