Java Runtime Environment: openjdk version “1.8.0_152”
openHAB version: OpenHABian 2.4.0
Issue of the topic:
I use two Tink-Lamps (color + white), these use the ZigBee protocol. For this I use a Philips Hue, the lamps are found and I can control the color as well as the temperature.
Now I wanted to integrate it into OpenHab2. So I installed the Hue Binding. The lamps are also found.
So far everything works great.
Next I wanted to create an item file:
Group gBettlampe
"Bettlampe"
<light>
(Bedroom)
Dimmer Bettlampe_Farbtemperatur
"Farbtemperatur"
<rgb>
(gBettlampe)
{channel="hue:0210:...:12:color_temperature"}
Color Bettlampe_Farbe
"Farbe"
<colorwheel>
(gBettlampe)
{channel="hue:0210:...:12:color"}
The sitemap looks like this:
sitemap wohnung_produktiv label="Wohnung" {
Frame label="Vincent"{
Group item=Bedroom
Group item=LivingRoom
}
Frame label="Außen" {
Group item=OU
}
Frame label="Direkt"{
Text label="Licht" icon="light" {
Default item=Bedroom_Light label="Schlafzimmer"
Default item=LivingRoom_Light label="Wohnzimmer"
}
}
}
The problem is that the lamps can be controlled at the very first setup (color and color temperature). If I then change the channel:
{channel="hue:0210:...:11:color_temperature"}
And
{channel="hue:0210:...:11:color"}
both lamps are controlled and only the brightness and the color temperature can be changed.
I hope somebody can help me… If you need more information, please ask.
The Paper UI says that the “Bettlampe” and the “Fernsehlampe” refer to the same items, although the “Bettlampe.items” only refers to one of the two lamps.
Do I have to update the whole thing somehow? A restart unfortunately doesn’t help…
Yes, I can choose and set the color in the Philips Hue-App.
Interesting is that I can’t change the color in the paper UI at the Control tab.
But what’s then the problem?
The reason for the observed behaviour is, that the tint bulbs cannot use the HSB color model, they react on XY color model commands only. OpenHAB uses XY, when the light is already in XY mode, otherwise it uses HSB commands. For that reason you cannot switch vom CT (color temperature) mode back to a true color mode.
The hue app seems to use always XY mode. If you changed once the color with the app, you will be able to control the colore further with OpenHAB/Paper UI - until you switch again to CT mode.
Yesterday I created a workaround for my setup: With direct http hue bridge access I set the XY color mode if necessary, so OpenHAB can further control the lights. Unfortunately I had no time so far to setup a development environment for OpenHAB, so I could not change the binding code, yet.
I figured it out how to manage with this situation. Issue is as mentioned that the hue addon is not able to properly change between colortone and XY mode. This can be achieved with a workaround by using the HTTP binding:
rules:
rule "Colormode XY"
when
Item hueLightstripe1ColorModeSwitch changed to OFF
then
var url_light='http://hue-bridge/api/<APIKEY>/lights/<LIGHTID>/state'
var content='{"colormode":"xy","xy":[0.3176,0.3297]}'
sendHttpPutRequest(url_light, "application/x-www-form-urlendcoded", content)
end
rule "Colormode CT"
when
Item hueLightstripe1ColorModeSwitch changed to ON
then
var url_light='http://hue-bridge/api/<APIKEY>/lights/<LIGHTID>/state'
var content='{"colormode":"ct","ct":330}'
sendHttpPutRequest(url_light, "application/x-www-form-urlendcoded", content)
end