Page 1 of 1

SetRGB has weird behaviour

Posted: Tuesday 20 November 2018 21:04
by elgringo
I have created a simple script to change my rgb garden light.

The lights are RGBWWCW bulb from Zipto. If I send certain R,G,B value I don;t see them in the logging:

Code: Select all

2018-11-20 20:54:34.294 Status: dzVents: !Info: Tuin autolight(Tuin 1) changed light to (R,G,B) (92,150,82), Level [100-800]:324
2018-11-20 20:54:34.371 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-11-20 20:54:34.386 Status: setcolbrightnessvalue: ID: 111, bri: 58, color: '{m: 3, RGB: 25ff00, CWWW: 0000, CT: 0}'
And when I set it to 30,30,30 it ends up:

Code: Select all

2018-11-20 21:00:03.888 Status: setcolbrightnessvalue: ID: 111, bri: 11, color: '{m: 1, RGB: ff00ff, CWWW: 0000, CT: 0}'
How can I set the actual RGB (and possible WW/CW values)?

Re: SetRGB has weird behaviour

Posted: Tuesday 20 November 2018 22:39
by waaren
elgringo wrote: Tuesday 20 November 2018 21:04 I have created a simple script to change my rgb garden light.

The lights are RGBWWCW bulb from Zipto. If I send certain R,G,B value I don;t see them in the logging:

Code: Select all

2018-11-20 20:54:34.294 Status: dzVents: !Info: Tuin autolight(Tuin 1) changed light to (R,G,B) (92,150,82), Level [100-800]:324
2018-11-20 20:54:34.371 Status: EventSystem: Script event triggered: /home/pi/domoticz/dzVents/runtime/dzVents.lua
2018-11-20 20:54:34.386 Status: setcolbrightnessvalue: ID: 111, bri: 58, color: '{m: 3, RGB: 25ff00, CWWW: 0000, CT: 0}'
And when I set it to 30,30,30 it ends up:

Code: Select all

2018-11-20 21:00:03.888 Status: setcolbrightnessvalue: ID: 111, bri: 11, color: '{m: 1, RGB: ff00ff, CWWW: 0000, CT: 0}'
How can I set the actual RGB (and possible WW/CW values)?
the setRGB method in dzVents does calculate the HSB values (Hue, Saturation and Brightness) of the given RGB and uses that to populate the json
for setting the parms hue, brightness and isWhite for the API setcolbrightnessvalue
If that does not work for your situation you could try to set the colortable {"m":3,"t":0,"r":0,"g":0,"b":0,"cw":0,"ww":0} and brightness value and use that to populate the same json and send that to domoticz using domoticz.openURL.
A lot of information on this can be found here

Re: SetRGB has weird behaviour

Posted: Wednesday 21 November 2018 7:37
by elgringo
Makes sence, but the logging is inconsistent :)
It is also possible to set RGB and ww cw at the same time? It is possible using json

Re: SetRGB has weird behaviour

Posted: Wednesday 21 November 2018 9:53
by waaren
elgringo wrote: Wednesday 21 November 2018 7:37 Makes sence, but the logging is inconsistent :)
Inconsistent in a sense that dzVents shows the values entered and domoticz shows the JSON received (the calculated HSB) or do you mean something else ?
It is also possible to set RGB and ww cw at the same time? It is possible using json
That is not implemented yet in the device-adapter for RGBWW devices. If I try this (using mode 4 with the JSON command) , I see no change in the color, brightness or colortemp of my Hue lights. What do you see ?

Re: SetRGB has weird behaviour

Posted: Wednesday 21 November 2018 18:48
by elgringo
Yes dzvents and json report report something different. Json show the color struct with mode, rgb, ww and cw and DzVents the converted HSB values.

When using mode 4 my bulb does change with additional white.