SetRGB has weird behaviour

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

Post Reply
elgringo
Posts: 102
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

SetRGB has weird behaviour

Post 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)?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SetRGB has weird behaviour

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
elgringo
Posts: 102
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Re: SetRGB has weird behaviour

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: SetRGB has weird behaviour

Post 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 ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
elgringo
Posts: 102
Joined: Thursday 18 May 2017 8:08
Target OS: Raspberry Pi / ODroid
Domoticz version: Left
Contact:

Re: SetRGB has weird behaviour

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest