Python framework - Set Color - Brightness
Moderator: leecollings
Python framework - Set Color - Brightness
When Set Color is used as documented here are the information we can received:
https://www.domoticz.com/wiki/DzVents:_ ... .2FApplamp
"m":3, Color Mode
"t":0, Kelvin Temp
"r":0, Red
"g":0, Green
"b":50, Blue
"cw":0, Cold white level
"ww":0, Warm white level (also used as level for monochrome white)
br:100 Brightness
However 'br' seems to be never sent to the plugin via the onCommand() call
Set Color for Device: 6b6d EPout: 0b Unit: 31 DeviceType: ColorControlFull Level: 100 Color: {"b":43,"cw":27,"g":255,"m":4,"r":44,"t":227,"ww":215}
How can we get the Brighness level which is mainly provided when using the RGBWWWZ ?
https://www.domoticz.com/wiki/DzVents:_ ... .2FApplamp
"m":3, Color Mode
"t":0, Kelvin Temp
"r":0, Red
"g":0, Green
"b":50, Blue
"cw":0, Cold white level
"ww":0, Warm white level (also used as level for monochrome white)
br:100 Brightness
However 'br' seems to be never sent to the plugin via the onCommand() call
Set Color for Device: 6b6d EPout: 0b Unit: 31 DeviceType: ColorControlFull Level: 100 Color: {"b":43,"cw":27,"g":255,"m":4,"r":44,"t":227,"ww":215}
How can we get the Brighness level which is mainly provided when using the RGBWWWZ ?
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Python framework - Set Color - Brightness
Not sure why you goto dzVents wiki for this. the setcolor method described there is not the same as the domoticz API (described here )pipiche wrote: Tuesday 10 December 2019 21:22 When Set Color is used as documented here are the information we can received:
https://www.domoticz.com/wiki/DzVents:_ ... .2FApplamp
How can we get the Brighness level which is mainly provided when using the RGBWWWZ ?
the API is
Code: Select all
http:// <domoticz ip>:<domoticz port>/json.htm?type=command¶m=setcolbrightnessvalue&idx=<id>&color={"m":3,"t":0,"r":<r>,"g":<g>,"b":<b>,"cw":0,"ww":0}&brightness=<brightness>Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Python framework - Set Color - Brightness
Nevertheless the Brightness is not reaching the python plugin Framework which is our problem ?
SO imagine you have a Domoticz Widget created as an RGBWWZ Type, the brightness part is not coming to the onCommand() callback function
SO imagine you have a Domoticz Widget created as an RGBWWZ Type, the brightness part is not coming to the onCommand() callback function
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Python framework - Set Color - Brightness
Can't you just use the sValue ? (is state aka level)pipiche wrote: Tuesday 10 December 2019 21:49 Nevertheless the Brightness is not reaching the python plugin Framework which is our problem ?
SO imagine you have a Domoticz Widget created as an RGBWWZ Type, the brightness part is not coming to the onCommand() callback function
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Python framework - Set Color - Brightness
Ok, let me explain.waaren wrote: Tuesday 10 December 2019 21:55Can't you just use the sValue ? (is state aka level)pipiche wrote: Tuesday 10 December 2019 21:49 Nevertheless the Brightness is not reaching the python plugin Framework which is our problem ?
SO imagine you have a Domoticz Widget created as an RGBWWZ Type, the brightness part is not coming to the onCommand() callback function
You have an RGBWWZ device . In Domoticz you can set the 5 channels R G B CW WW and BR , then it is send to the Python Plugin Framework, so a python plugin get a call back on onCommand() and receive 4 parameters and nothing more:
Parameter 1 is the Unit (of the device)
Parameter 2 is the Command ( in that case 'Set Color')
Parameter 3 is the Level
Parameter 4 is the Color is a json format
For more information this is documented https://www.domoticz.com/wiki/Developin ... hon_plugin
Currently it looks like the Python Framework is only proving to the onCommand call back Color RGB,CW,WW,T,M but the brightness is omitted !
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Python framework - Set Color - Brightness
If this isn't the sValue of the device do you know what it is ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Python framework - Set Color - Brightness
I’m afraid we are not talking to the same thing.
I’m talking about a plugin developed in python and the issue is when the plugin get the onCommand() call back.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Python framework - Set Color - Brightness
Probably a language thing but I just want to understand what this Level parm is. Where does it come from and what is it used for ?
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Re: Python framework - Set Color - Brightness
When from the DOmoticz UI you change the Level ( Dimmer ) , this is refelected into the Python Plugin Framework into a callback function onCommand() which is called with 4 parameters:
Parameter 1 is the Unit (of the device)
Parameter 2 is the Command ( in that case 'Set Color')
Parameter 3 is the Level
Parameter 4 is the Color is a json format
Now how the Level is calculated/computed this is into the Python Framework code and I have no clue. Is that reflecting the Brightness I'm not sure if you have a RGBWWZ subtype.