- Platform information:
- Hardware: Raspberry Pi 4 Model B Rev 1.1
- OS: Raspbian GNU/Linux 10
- Java Runtime Environment: OpenJDK Runtime Environment (Zulu 8.50.0.259-CA-linux_aarch32hf) (build 1.8.0_272-b17)
- openHAB version: openHAB 2.5.10-1 (Release Build)
Hi guys,
I am a little bit confused with the Color item behavior of my Philips Hue White & Color Ambiance E27 LED lamps.
I have quite a number of rules that are controlling my lamps and I didn’t want to deal with all the code required to control a HSBType. Therefore, I decided to create some virtual String items that hold the final state definition of my scenarios. I have defined them as
Group Lichtfarben "Farben" <colorlight> (Einstellungen)
String cHueSzeneHell "Hell" <colorlight> (Lichtfarben,RestoreOnStartup)
String cHueSzeneNormal "Normal" <colorlight> (Lichtfarben,RestoreOnStartup)
String cHueSzeneGedimmt "Gedimmt" <colorlight> (Lichtfarben,RestoreOnStartup)
String cHueSzeneEntspannung "Entspannung" <colorlight> (Lichtfarben,RestoreOnStartup)
String cHueSzeneNachtlicht "Nachtlicht" <colorlight> (Lichtfarben,RestoreOnStartup)
String cHueSzeneWeihnachtslicht "Weihnachtslicht" <colorlight> (Lichtfarben,RestoreOnStartup)
and they are initialized during system startup:
rule "Farben definieren"
when
System started
then
cHueSzeneHell.postUpdate("49,36,100")
cHueSzeneNormal.postUpdate("49,36,80")
cHueSzeneGedimmt.postUpdate("44,72,30")
cHueSzeneEntspannung.postUpdate("44,72,70")
cHueSzeneNachtlicht.postUpdate("44,72,1")
cHueSzeneWeihnachtslicht.postUpdate("44,72,60")
end
When I now want to update a lamp I simple send a command with the state of the corresponding virtual configuration item as:
rule "Flur_Licht_Standard"
when
Channel "homematic:HmIP-WRC6:xxx:yyy:1#BUTTON" triggered "SHORT_PRESSED"
then
Flur_Treppenlicht.sendCommand(cHueSzeneNormal.state.toString)
end
This worked well for quite some time now, but all of a sudden, the light does no longer match my expectation. I debugged the situation and found out, that the final color that is set by sending the String via the HUE Binding to the lamp is in fact depending on the previous color set on the lamp!
In the logs I see that the values that are set and send to the HUE bridge are always the same! But they get interpreted differently: If I set an arbitrary color via the HUE app on my smartphone the result of the command execution is different than that, if I set an arbitrary whiteness value via the HUE app.
Is this a known behavior? I thought that setting a HSB value on the Openhab side should always result in the same state of the lamp, but this does not seem to be true. What am I doing wrong? Would the actual use of a HSBType within the command avoid that behavior?
Thanks.