Tradfri LED RGB bulb

Hi All,
I wasn't super satisfied with any of the drivers that I could find for the Tradfri RGBW bulbs so i did a bit of modding on pedro garcia's ST driver.

hopefully you might find it helps a bit, you can find the code here: GitHub - eliotstocker/hubitat-ikea-rgbw: A fully functional Hubitat RGBW driver for Ikea Bulbs

you can also get it on Hubitat Package Manager

To be completely clear almost all of the credit should go to the original Author: GitHub - puzzle-star/SmartThings-IKEA-Tradfri-RGB: SmartThings Device Handler for IKEA Tradfri RGB Bulbs

1 Like

Having some of these bulbs, I am wondering if you have a comparison of what this driver does that the others you were unsatisfied with did not.

The idea was to just make it work as closely to the stock Zigbee RGBW driver as possible, this means that the Ikea and Hue bulbs i have connected directly work more or less the same.

Changes from Puzzle Star Version:

  • Add capabilities: ColorMode and Color Temperature
  • Add Color Temperature methods (emulated by setting various shades of orange, should more or less match Ikea white spectrum bulbs)
  • fix getting values back from bulbs (so that state in hubitat is set directly from bulb)
  • different color name matching

Thanks, yours was the only one that worked for me.

your version is working like a charm! thanks @eliotstocker

I built a bit further on @eliotstocker version of the bulb because I saw some issues with scenes. E.g. the bulb did not turn on when setting a scene, and in CT mode the dimmer level was missed due to the way scenes operate the bulb in CT mode.

Fixes from @eliotstocker version:

  • Use asynchronous zigbee messaging so that dimmer level is not missed when operating in CT mode in a scene setting
  • Added the possibility to turn on and off debug and trace info
  • Also added support for the rate field in setLevel, i.e. it can be controlled how fast the bulb dim to the new setting.

Raw link: https://raw.githubusercontent.com/ivarho/hubitat-ikea-rgbw/main/ikea-tradfri-rgbw-device.groovy

1 Like

Nice one @holand.ivar

these sound like great tweaks!

entirely up to you if you'd like to or not, but if you stick in a PR to my repo ill merge these changes in so they end up in HPM :slight_smile:

Cheers
Eliot

1 Like

seeing this error
java.lang.NullPointerException: Cannot execute null+[he cmd 0x70B3 0x01 0x0008 0x04 {D1 FFFF}, delay 2000, he cmd 0x70B3 0x01 0x0300 0x07 {EE5092930a00}, delay 2000] on line 319 (setColor)

That was strange, have you done any modifications to the code? Line 319 is an append to a list and no execution of any commands:

319: state.cmds += cmds

Can you post exactly the code you are using? Or the code you see on line 319?

Yep 319
state.cmds += cmds

Not changed anything mabey the state is missing?

Edit, just skimmed the code, should state.cmds =[] be added to initialize.
When I get back ill try hitting refresh to create the state

1 Like

Yes, that could be the issue. Thanks for pointing that out. Before doing that try hitting refresh() as it defines the state.cmds = , let me know if that fixes this issue, if it does I will update the driver

 def refresh() {
    state.colorChanged = false
    state.colorXReported = false
    state.colorYReported = false
    state.cmds = []
    zigbee.onOffRefresh() + zigbee.levelRefresh() + colorControlRefresh() + zigbee.onOffConfig(0, 300) + zigbee.levelConfig() + colorControlConfig(0, 300, 1)
}
2 Likes

I did some testing and found that @mark.cockcroft suggestion works. Implemented in the latest version on github. Thanks mark for discovering this.

1 Like

Thanks @eliotstocker @holand.ivar, what a perfect timing. The thread is alive for 2 years, but you came out with the ported drivers just few days after I got the Tradfri bulbs.

Can you make the new versions available through the hubitat package manager as @eliotstocker recommended?

Absolutely, I haven't done that before, but I will investigate what's needed. If not @eliotstocker do it before I have time to educate myself.

Thanks a lot @eliotstocker and @holand.ivar, this driver helped to get my Tradfri bulbs working properly where the generic drivers wouldn't. Is it possible to add the "startLevelChange" and "stopLevelChange" command? Otherwise it looks like these won't be dimmable with a switch without those commands. I think that's all that's missing compared to the generic RGBW drivers.

Thanks again!

Has anyone had any issues exposing these to google home? Just updated the driver with the awesome new one (thanks everyone)! When I add it to the Google Home HE app it shows connected, until you open the Google Home app and then it somehow becomes disassociated with the Google Home app in HE.

People have had problems with bulbs general on Google Home if all the device attributes are not populated. If you just added them to Hubitat, that could be the issue. Try doing either a refresh or sending a Set Color and Set Color Temperature to make sure the hue, saturation, level, color, and color temperature all get some value. (Just a guess at the problem and how to fix it, but seems worth mentioning since it's a common issue.)

2 Likes

Genius! I compared it to one of my osram zigbee bulbs and noticed one of the values wasn’t showing. Set a value for that attribute and was able to add to Google Home right after. Thanks!

3 Likes

Hi All,

I'm sorry i missed @holand.ivar's PR, I have now merged and updated the Package manifest, you should now see a 1.1.0 version update available :slight_smile:

1 Like

Hi DocBot,

The startLevelChange and stopLevelChange is now supported in my latest version: hubitat-ikea-rgbw/ikea-tradfri-rgbw-device.groovy at main · ivarho/hubitat-ikea-rgbw · GitHub

Best Regards,
Ivar

1 Like