Tint-Lamps Color cannot be controlled properly

  • Platform information:
    • Hardware: Raspberry Pi Model 3b+
    • OS: OpenHABian
    • 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. :slight_smile:

Have you tried the items without being attached to a group?

What do you mean?

If I don’t attach them to a group they doesn’t show up in the Sitemap

Hmm, I don’t understand.

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…

Try this and see if you can control the two items Bettlampe_Farbtemperatur and Bettlampe_Farbe

Dimmer Bettlampe_Farbtemperatur  "Farbtemperatur" <rgb> {channel="hue:0210:...:12:color_temperature"}

Color  Bettlampe_Farbe "Farbe" <colorwheel>  {channel="hue:0210:...:12:color"}
sitemap wohnung_produktiv label="Wohnung" {
    Frame label="Vincent"{
        Group item=Bedroom
        Group item=LivingRoom
    }    
	
	Frame label="Außen" {
		Group item=OU
	}
        Frame label="Test"{
              Default item=Bettlampe_Farbtemperatur 
              Default item=Bettlampe_Farbe
       }

    Frame label="Direkt"{
        Text label="Licht" icon="light" {
            Default item=Bedroom_Light label="Schlafzimmer"
            Default item=LivingRoom_Light label="Wohnzimmer"
        }
    }
}

Unfortunately I can only adjust the color temperature and the brightness like before.
The color, however, again not…

That rules out an issue with groups.

Have you checked that color is supported for Tint-Lamp?

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.

Ah, very interesting.

By now I use the GU10 RGBW lamps from GLEDOPTO, they work very well with Zigbee and OpenHAB.

Hi Frank, do you have a snippet on how to change the mode? Im facing the same problems here.

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:

items:
Switch                hueLightstripe1ColorModeSwitch       "ColorMode Switch"
Color                 hueLightstripe1Color                 "Leuchtstreifen Farbe"                 <colorwheel>          (Office)                 {channel="hue:0210:1:light-stripe1:color"}
Dimmer                hueLightstripe1Brightness            "Leuchtstreifen [%d %%]"                                (Office)                 {channel="hue:0210:1:light-stripe1:color_temperature"}
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
sitemap:
				Default item=hueLightstripe1Color visibility=[hueLightstripe1ColorModeSwitch==OFF]
				Default item=hueLightstripe1Brightness visibility=[hueLightstripe1ColorModeSwitch==ON]
				Switch item=hueLightstripe1ColorModeSwitch mappings=[OFF="COLOR", ON="WHITE"]

By this one can easily change between both modes and control the TINT lamp as desired.
Hope this helps.