Ikea Tradfri RGB Lights

Hi there… I’m quite new to OpenHab (installed it on a Raspi a couple of weeks ago). So far I’m quite happy.
But I can’t get the RGB Light to work… As it sais here… http://docs.openhab.org/addons/bindings/tradfri/readme.html …thisseems to be that this should work. There is an “extended color light”.

But if I try to add the Item via GUI it just finds this spectrum lights with different white tones…

thanks a lot…
Dave

im running openhab on a synology dsm and have experienced same issues as you until ive upgraded openhab and tradfri binding.

whats your setup (opehab version, tradfri version, firmware version of your colour bulb, gateway version)?

its working on my 15 days old openhab-2.2.0-snapshot, tradfri version tagged as 0.9.0.201710180819 │ TRÅDFRI Binding, bulb hw version 1.3.002:

Thanks… The Addon-Version is 2.1.0… I think I read something about an 2.2.0 Version…

But how I update the version of the addons? apt-get update/upgrade doesn’t see mto work (of course I tried that).

thx & regards,
Dave

Addon-Version 2.1.0… do you mean your openHab version?
the openHab im running is a 15 days old snapshot of the 2.2.0 version.

concerning tradfri-binding:

typing

bundle-list | grep TR

in the karaf console shows me

grafik

im not familiar with running openhab on a raspberry so im not sure, im afraid you cant apt-get update/upgrade to a new openHab version.
the easiest way would be probably to setup a new 2.2.0 system. but there may be some others ways like upgrading the tradfri binding jar - check the search function.

Wie funktioniert das mit diesem Karaf? Was ist das? Hab das mal versucht zu starten, aber da kommt nur die Meldung “There is a Root instance already running with name main and pid 997

its the admin-console of your running openHab instance, the openhab-documentation: http://docs.openhab.org/administration/console.html

heres a german howto on a raspberry: http://blog.wenzlaff.de/?p=8050

there are also a lot of community-topics you can find using the search.

I have a slight problem… I don’t have a display for my PI, but I can’t get it to work via SSH (even with sudo).

I tried using a VNC connection, there it works, but there I can’t use any special characters in console…

regards, Dave

I installed openhab on a rasbperry Pi3 and added the tradfri binding.
Works very nice. Got my Tradfri gateway and two bulbs the into the inbox without problems

Both bulbs are now on the PaperUI.

Thanks to the developer for the nice work.

There is a small issue:

The color temperature slide rof RGB_Lampe_01 does not set the bulb to something like blue or read.
I only get a white bullb with 0% and a little bit yellow with 100%.

2017-11-02 21:03:44.209 [ItemCommandEvent ] - Item ‘tradfri_0220_xxxxxx_65537_color_temperature’ received command 100

Brighness and off/on works.

any suggestions?

i guess your bulb is detected as a “Colour Temperature Light” with 0x0220 as zigbee id (see tradrfi readme linked by Dave in the first post) and your color_temperature channel works as designed.

you have to use the color channel to change the color which is supported by an Extended Colour Light bulb (0x0210 as id).
if your bulbs are the real color tradfri bulbs (check the model published in the technical details on ikea tradfri site) you should check the firmware version first. if they still dont work with the newest firmware, then i would suggest to try another tradfri-binding version.

Yes, the bulb is detected as “Color Temperature Light”.
I made a snapshot of the screen but did not know how to put it on the page until I found it now.
I got channel Brightness and Color Temperature , but no info about the current firmware version.

the bulb is marked as LED1624G9 E27 Tradfri CWS 1724 21635.
With the controller magenta and blue color can be set, but using slider in openHAB set it back to white.

How can I change to the Extended Color Light Bulb?
what do you mean with “try another tradfri-binding version”?

I did all work as a newbie in openHAB with the paperUI, so I have no experience with the file based configuration.
Maybe you have hint for me.
How can I get the info as described in binding doc for Tradfri?
I found a structure in /etc/openhab with items, things and sitemaps. How can I use this for a test?
I found some additional version info in the tradfri app.
Gateway i: 1.2.42
RGB bulb 1.3.002
warm-white 1.2.214
Controller: 1.2.214
Gateway
regards v.k.

your gateway & rgb-bulb versions are up to date.
im running openhab 2.2.0 snapshot 1060 with tradfri-binding 0.9.0.201710180819 on a synology.

what is your openhab and tradfri version?

  • ssh your raspberry
  • ssh to your karaf console on the raspberry to get the details, must be something like this:
    grafik
  • bundle:list | grep TR gives you your tradfri-binding

i think the easiest way to go is an re-install of your system using a current openhab 2.2.0 snpashot.

thanks for the detailed hint:
running on a raspberry3
java version "1.8.0_151"
Java™ SE Runtime Environment (build 1.8.0_151-b12)

openHAB is 2.1…0 release build
karaf says: 185 | Active | 80 | 0.9.0.b5 | Tradfri Binding

I build the system on top of a 2017-09-07-raspbian-stretch-lite.img and did some work to get all running.
followed https://openhabdoc.readthedocs.io/de/latest/Raspberry/
any hints how to install the snapshot and the tradfri binding?

i do not have any experience with openhab on raspberry.
but i noticed there is an openhab-image called openhabian, which also supports switching to unstable branches.
maybe its worth a try: http://docs.openhab.org/installation/openhabian.html
you could use another sdcard for a test and your work so far would be still available on the other.

I installed the actual openhabian on the pi, but the version is 2.1.01
then I used: http://docs.openhab.org/installation/linux.html#changing-versions to switch to snapshot.
this version came with: binding-tradfri - 2.2.0.SNAPSHOT
found the gateway and the two bulbs, rgb-Bulb als 210 !!
there is now a RGB_Lampe_01 with “Farbe” in the PaperUI, I don’t know why the rasperry uses some german words.
rgb-Control-2017-11-05_164359
using the karaf console
smarthome:send RGB_Lampe_01_Farbe 0,100,100 sets the bulb to red.

now want to test some self defined gui in the basic UI.
following http://docs.openhab.org/tutorials/beginner
I made

sitemap default label="Lampen sitemap"
{
  Switch item=network_pingdevice_xxx_xxx_xxx_127_online label="Moto2"
  Slider item=Warmweisse_Lampe_01_Helligkeit label="Warmweisse Lampe"
}

rule "Warmweisse_Lampe_01 ON"
when 
   Item  network_pingdevice_xxx_xxx_xxx_127_online changed from OFF to ON
then
   Warmweisse_Lampe_01_Helligkeit.sendCommand(100)
end

rule "Warmweisse_Lampe_01 OFF"
when 
   Item  network_pingdevice_xxx_xxx_xxx_127_online changed from ON to OFF
then
   Warmweisse_Lampe_01_Helligkeit.sendCommand(0)
end

Controlling the white lamp runs with something like smarthome:send Warmweisse_Lampe_01_Helligkeit 0

smarthome:send RGB_Lampe_01_Farbe 0,100,100

Do you have any sugesstions how to add controls for the rgb-lamp?
found it, parameters must be quoted!!
following code sets the bulb to red

rule "RGB_Lampe_01 ON"
when 
   Item  network_pingdevice_xxx_xxx_xxx_127_online changed from OFF to ON
then
    RGB_Lampe_01_Farbe.sendCommand("0,100,100")
end

.

:slight_smile:

just did this but didnt test it with tradfri, only with hue. it would be nice let us know if this one is working with the ikea bulb too.

nice code, learned a lot.

I tried the sample but the timer fires to fast for the raspberry.

I got a lot of identical commands

16:36:35.292 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Hue_Fade_Next' received command 2017-11-06T16:35:41.143+0100
16:36:35.698 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 5,100,100
16:36:36.142 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 4,100,100
16:36:36.573 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 4,100,100
16:36:36.981 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 5,100,100
16:36:37.408 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 4,100,100
and warnings
16:38:58.840 [WARN ] [core.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@1bdc1af' takes more than 5000ms.
16:39:09.588 [WARN ] [core.internal.events.OSGiEventManager] - Dispatching event to subscriber 'org.eclipse.smarthome.io.monitor.internal.EventLogger@1bdc1af' takes more than 5000ms.

so I modified 1 to 10 .

// items:
Switch Tradfri_Fading "Tradfri fade"
DateTime Tradfri_Fade_Next

 // defined in PaperUI: RGB_Lampe_01_Farbe

// sitemap:
Switch item=Tradfri_Fading

// rules: 
// Start/stop tradfri fading
rule "Start Tradfri Colors fading"
 when 
   Item Tradfri_Fading changed
 then
 logInfo("fade","begin rule Start Tradfri Colors fading")
  if (Tradfri_Fading.state == ON) {
    // set a timer to sligtly change the color again and again
    timer = createTimer(now, [|
      Tradfri_Fade_Next.sendCommand(now.toString)
      if (timer != null) {
        timer.reschedule(now.plusSeconds(10))
      }
    ])			
  }
  else {
    timer = null
  }
end

// Fade tradfri 10 bits. 
rule "Tradfri Fade Next"
  when 
    Item Tradfri_Fade_Next changed
  then
    logInfo("fade","begin rule Tradfri Fade Next")
    if (Tradfri_Fading.state == ON) {
      // get your current color
      var hsb = RGB_Lampe_01_Farbe.state as HSBType
      // change it a little bit
      var DecimalType hue = new DecimalType(hsb.hue.intValue % 360 + 10) // 0-360; 0=red, 120=green, 240=blue, 360=red(again)
      var PercentType sat = new PercentType(hsb.saturation.intValue) // 0-100
      var PercentType bright = new PercentType(hsb.brightness.intValue) // 0-100
      var HSBType newHsb = new HSBType(hue,sat,bright)
      logInfo("fade", "new HSB: " + newHsb.toString)
      // set the new color		
      RGB_Lampe_01_Farbe.send(newHsb)
    }			
end


now its running nice !!

but :

17:24:06.432 [INFO ] [smarthome.event.ItemStateChangedEvent] - Hue_Fade_Next changed from 2017-11-06T17:23:55.879+0100 to 2017-11-06T17:24:05.893+0100
17:24:06.460 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 107,100,100
17:24:07.478 [INFO ] [smarthome.event.ItemStateChangedEvent] - RGB_Lampe_01_Farbe changed from 97,100,100 to 107,100,100
17:24:15.917 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'Hue_Fade_Next' received command 2017-11-06T17:24:15.909+0100
17:24:16.474 [INFO ] [smarthome.event.ItemStateChangedEvent] - Hue_Fade_Next changed from 2017-11-06T17:24:05.893+0100 to 2017-11-06T17:24:15.909+0100
17:24:16.487 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 117,100,100
17:24:17.491 [INFO ] [smarthome.event.ItemStateChangedEvent] - RGB_Lampe_01_Farbe changed from 107,100,100 to 117,100,100
17:24:17.541 [INFO ] [smarthome.event.ItemStateChangedEvent] - RGB_Lampe_01_Farbe changed from 117,100,100 to 116,100,100

19:02:10.193 [INFO ] [smarthome.event.ItemCommandEvent     ] - Item 'RGB_Lampe_01_Farbe' received command 268,100,100
19:02:10.222 [INFO ] [smarthome.event.ItemStateChangedEvent] - RGB_Lampe_01_Farbe changed from 258,100,100 to 267,100,100
19:02:10.222 [INFO ] [smarthome.event.ItemStateChangedEvent] - RGB_Lampe_01_Farbe changed from 267,100,100 to 268,100,100
19:02:10.774 [INFO ] [smarthome.event.ItemStateChangedEvent] - RGB_Lampe_01_Farbe changed from 268,100,100 to 267,100,100

why I get the change msg twice or three times sometimes?

1 Like