setRGB problem
Posted: Tuesday 15 December 2020 17:55
I'm using dzVents code to set the colour of a RGB switch, which is ultimately sent to a WLED device by the plugin. When I set the colour, the result is not correct. Often, the blue part seems to be ignored - I specify white and get yellow, etc.
Code:
That should produce a slightly off-white colour. It gives me yellow. The RGB wheel in the UI shows the position at the edge of the wheel in the yellow segment.
Log:
When I set the colour of the RGB device from the domoticz UI, the WLED goes to the correct colour. However, the dzVents view of the RGB values is once again not correct - e.g., for a slightly blueish white:
Note that in both cases, the reported blue value is ZERO and the red, green are 255.
It's not always b=0; if I set the RGB to a strong blue, I get this reported:
... but here, there is nowhere near that much green in the colour and there's no red at all; I chose almost pure blue.
@waaren, any idea what's going wrong here, please?
Code:
Code: Select all
domoticz.devices('WLED Lounge TV').setRGB(255,255,200,100) -- I've tried many combinations, with and without brightness; same result
domoticz.log('WLED colour is ' .. domoticz.devices('WLED Lounge TV').color)
Log:
Code: Select all
2020-12-15 16:47:56.809 Status: User: Admin (IP: 192.168.10.36) initiated a switch command (1731/Test switch 2/On)
2020-12-15 16:47:56.919 Status: dzVents: Info: Handling events for: "Test switch 2", value: "On"
2020-12-15 16:47:56.919 Status: dzVents: Info: ------ Start internal script: TEST2: Device: "Test switch 2 (Scene trigger dummy switches)", Index: 1731
2020-12-15 16:47:56.919 Status: dzVents: Info: ******** TEST2
2020-12-15 16:47:56.920 Status: dzVents: Info: WLED colour is {"b":0,"cw":0,"g":255,"m":3,"r":255,"t":0,"ww":0}
2020-12-15 16:47:56.921 Status: dzVents: Info: ------ Finished TEST2
2020-12-15 16:47:56.922 Status: EventSystem: Script event triggered: /home/domoticz/domoticz/dzVents/runtime/dzVents.lua
2020-12-15 16:47:56.940 Status: setcolbrightnessvalue: ID: a20, bri: 100, color: '{m: 3, RGB: ffff00, CWWW: 0000, CT: 0}'Code: Select all
2020-12-15 16:52:18.154 Status: dzVents: Info: WLED colour is {"b":0,"cw":0,"g":255,"m":3,"r":255,"t":0,"ww":0}It's not always b=0; if I set the RGB to a strong blue, I get this reported:
Code: Select all
2020-12-15 16:53:49.569 Status: dzVents: Info: WLED colour is {"b":181,"cw":0,"g":248,"m":3,"r":255,"t":0,"ww":0}@waaren, any idea what's going wrong here, please?