IKEA Tradfri Color Changing bulb on Hue Bridge no control of colors

Hmm…

It seems like theres actually no one that could comment on this.
It’s strange that no one has got problems with using IKEA Tradfri Color bulbs on hue bridge with openhab2.

So I guess ill raise an issue on github.

Thanks for your help anyways.

I bought the same bulb and I have the same issue. I do have a ikea gateway but would like to control all lamps through the Hue gateway as backup. I can confirm that the lamp is recognised as a type 200 although it works perfectly using the Hue app. Would welcome a solution :wink:

I have the same problem. I use the Tradfri GU10 Lights with the hue bridge. With the hue App everything works fine. The lights show up in openhab as well. But I cannot control these lights with my sitemap or with home kit. Same issue with osram lightify garden lights by the way …

Is there any solution?

Same experience here. Bulb is recognized as type 200 lamp and therefore openhab cannot use the color channel correctly. It is only usable as kind of color temperature channel.
Does someone know how we can give appropriate input for the hue binding developer?

Same here; just paired my Tradfri color bulb with Hue bridge, and it’s recognized as “0200”. So I perfectly can dim, but it’s not possible to set bulb color by (H,S,B); Hue App seems to work as intended. Did you raise a GitHub issue I could subscribe to, @Hendrik_Nielsen?

Cheers,
Marianne

The Problem is, the IKEA RGB Bulb accept no CIE Color Mode… only XY Color Mode … :wink:
And the HUE Binding use CIE Color Mode :wink:

1 Like

I have the same problem, but if it works in Hue App it should be possible to get it to work in Hue binding.

/Mike

No … the Code of Hue App and the Code of Binding is different … the Maintainer or any one other … must create some code for the Binding … or adopt it from the Tradfri Binding… without Code changes it will not work.

That was what i meant.
I understand that we have to change the code in the binding, but it should not be an technical issue that stops the possibility to get it to work.

/Mike

1 Like

Okay :slight_smile:

Please note my comment in the other thread. If nobody does that you’ll never see a result. Thanks.

I add a Issue here… feel free to comment this Issue … and explain your Problems :slight_smile:

Kay answered that the hue bridge should handle the conversion. But why is the binding not just sending everything as XY for max compatibility? Is there any downsite?

Is the problem not caused by the recognition of the bulb. If I remember well my bulb was recognised as type 200 and not 210. I think the recognition is done by the binding and something is working not correctly there…

My Work A Round for the Moment is …

Setting Color by Command Line :wink:

Getting a User:

https://www.developers.meethue.com/documentation/getting-started

Set Color by the Command:

curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [1,1]}' http://<HUE_BRIDGE_IP>/api/<YOUR_USER_HASH>/lights/<HUE-BULB-ID>/state

Here my complete Work A Round

Item

Number colorpicker_wohnzimmer_schrank "Colorpicker Wohnzimmer Schrank"

Sitemap

Selection item=colorpicker_wohnzimmer_schrank label="Farbe:" icon="colorpicker" visibility=[Stehlampe_Wohnzimmer_Schrank_Switch==ON] mappings=[
            0="  Warmes Licht  ",
            1="  Tageslicht  ",
            2="  Nachtlicht  ",
            3="  Sonnenuntergang  ",
            4="  Gelb  ",
            5="  Helles Gelb  ",
            6="  Helles Grün  ",
            7="  Orange  ",
            8="  Helles Orange  ",
            9="  Rot  ",
            10="  Pink  ",
            11="  Helles Lila  ",
            12="  Blau  "
          ]

Rule

//################################//
//RGB Stehlampe Wohnzimmer Schrank//
//################################//

rule "RGB Farbe Wohnzimmer Schrank"
when
  Item colorpicker_wohnzimmer_schrank changed
then
  executeCommandLine("/etc/openhab2/scripts/hue_tradfri_color.sh 3 Stehlampe_Wohnzimmer_Schrank_Brightness " + colorpicker_wohnzimmer_schrank.state)
end

BashScript

#!/bin/bash

# -- $1 = Bulb ID -- $2 = Bulb Brightness Item -- $3 = Color Command

openhab_ip="192.168.1.100"
hue_brigde_ip="192.168.1.101"
#HUE_Bridge_User erstellen -> https://www.developers.meethue.com/documentation/getting-started
hue_bridge_user="<HUE_Bridge_User>"

case $3 in
    0)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5234,0.4023]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    1)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.3812,0.3385]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    2)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5918,0.399]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "1" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    3)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6409,0.3332]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    4)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5465,0.4405]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    5)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.2642,0.6641]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    6)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5049,0.4509]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    7)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6566,0.3396]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    8)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6289,0.34]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    9)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6944,0.2986]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    10)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.434,0.1777]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    11)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.2454,0.0903]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    12)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.1538,0.051]}' http://$hue_brigde_ip/api/$hue_bridge_user/lights/$1/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://$openhab_ip:8080/rest/items/$2"
        ;;
    *)
        echo "Kommando nicht vorhanden!"
        ;;
esac
1 Like

Thank you very much … Works great.

1 Like

Hello, i have one question :frowning:
Where do I have to put the BashScript?
Or what do I have to do with it?

Here you see the place of the Script :slight_smile:

Hello, I made the whole afternoon and did not manage it.

Inside my item:

Switch Schl_Bambus_bu             "Schlafzimmer Bambus"             <light>                   (gSchl,gLicht,gLicht0,gLicht2) ["Lighting"] {channel="hue:0200:00178821c409:6:color"}
Color  Schl_Bambus_bu_Color       "Schlafzimmer Bambus Farbe" 	                              (gSchl,gLicht,gColor_schl)                ["Lighting"] {channel="hue:0200:00178821c409:6:color"}
Dimmer Schl_Bambus_bu_brightness "Schlafzimmer Bambus Helligkeit" <qualityofservice>         (gSchl,gLicht,gBrightnes_schl,gBrightnes_all)                ["Lighting"] {channel="hue:0200:00178821c409:6:color"}
Switch Schl_Bambus_bu_Effect      "Schlafzimmer Bambus Color Loop"                            (gSchl,gLicht)                ["Lighting"] {channel="hue:0200:00178821c409:6:effect"}
String Schl_Bambus_bu_Alert       "Schlafzimmer Bambus Alert"                                 (gSchl,gLicht)                             {channel="hue:0200:00178821c409:6:alert"}

Then i created a file called hue_tradfri_color.sh

/etc/openhab2/scripts/hue_tradfri_color.sh
hue Brige user i have a little bit alienated, but the rest is original

openhab_ip="192.168.100.35"
hue_brigde_ip="192.168.100.20"
#HUE_Bridge_User erstellen -> https://www.developers.meethue.com/documentation/getting-started
hue_bridge_user="mO9LfyqD0SFDzznPWnKaQYod......"

case $3 in
    0)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5234,0.4023]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiO......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    1)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.3812,0.3385]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOG......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    2)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5918,0.399]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0...../lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "1" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    3)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6409,0.3332]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0......../lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    4)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5465,0.4405]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    5)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.2642,0.6641]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiO....../lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    6)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.5049,0.4509]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOG......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    7)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6566,0.3396]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiO...../lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    8)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6289,0.34]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOG....../lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    9)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.6944,0.2986]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOGP......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    10)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.434,0.1777]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOGP....../lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    11)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.2454,0.0903]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOGP......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    12)
        curl -s -H "Accept: application/json" -X PUT --data '{"on": true,"xy": [0.1538,0.051]}' http://192.168.100.20/api/mO9LfyqD0SFDzznPWnKaQYodK0JiOGP......./lights/6/state
        sleep 1
        curl -X POST --header "Content-Type: text/plain" --header "Accept: application/json" -d "50" "http://192.168.100.35:8080/rest/items/Schl_Bambus_bu_brightness"
        ;;
    *)
        echo "Kommando nicht vorhanden!"
        ;;
esac

here is the content of my
/etc/openhab2/scripts/rules/ikea.rules

//################################//
//RGB Stehlampe Wohnzimmer Schrank//
//################################//

rule "Schlafzimmer Kugel"
when
  Item Schl_Bambus_bu_Color  changed
then
  executeCommandLine("/etc/openhab2/scripts/hue_tradfri_color.sh 3 Schl_Bambus_bu_brightness"+ Schl_Bambus_bu_Color.state)

end

and this i added to my sitemap

  }
Frame label="Bambus" {
Selection item=Schl_Bambus_bu_Color  label="Farbe:" icon="colorpicker" visibility=[Schl_Bambus_bu==ON] mappings=[
            0="  Warmes Licht  ",
            1="  Tageslicht  ",
            2="  Nachtlicht  ",
            3="  Sonnenuntergang  ",
            4="  Gelb  ",
            5="  Helles Gelb  ",
            6="  Helles Gr¸n  ",
            7="  Orange  ",
            8="  Helles Orange  ",
            9="  Rot  ",
            10="  Pink  ",
            11="  Helles Lila  ",
            12="  Blau  "
          
          ]
          }

Unfortunately it does not work yet. If I enter the content from the bash individually, he already changes the colors.
What do you mean with this? --> 3 Stehlampe_Wohnzimmer_Schrank_Brightness " + colorpicker_wohnzimmer_schrank.state)

Sorry for my bad englisch ;-( And thank you for your support