[OBSOLETE] IKEA Trådfri Bulb Device Type

Here is a device type that I’ve written/copy pasted from other device types, I’m not sure if everything is the way it’s supposed to be but it works as I want it to.

I’ve written it so that it changes the color temperature when dimming the light, it makes it behave a bit more like a traditional bulb.

There is a preference section were users can edit the following

  • Enable/disable level and color temperature linking
  • Set a delay between level and color temperature change
  • Choose whether to show a generic color name such as “Relax” or a kelvin temperature such as “2300 K”
  • Color temperature at the lowest brightness level
  • Color temperature at the highest brightness level

Works:
TRADFRI bulb E27 WS opal 980lm
TRADFRI bulb E14 WS opal 400lm
TRADFRI bulb GU10 WS 400lm

Untested but should work:
TRADFRI bulb E27 WS clear 950lm
TRADFRI bulb E26 WS opal 980lm
TRADFRI bulb E26 WS clear 950lm
TRADFRI bulb E12 WS opal 400lm

Not supported:
TRADFRI bulb E27 opal 1000lm - It’s not a color temperature bulb, just dimmable


https://github.com/edvaldeysteinsson/IKEA-Tradfri/blob/master/devicetypes/edvaldeysteinsson/ikea-tradfri.src/ikea-tradfri.groovy


For those that assign this device handler to an already added device and who experience problems with the UI not updating values, try pressing the reload button once. That should then fix the issue and the values should update as expected.


Here are some more screenshots of the device type UI.

7 Likes

Thanks for this! I’ve tried it out and a couple of things:

  1. The mobile UI doesn’t seem to remember the bulbs state (on/off and dim level) when you go back to it. (same as the stock zigbee DH)
  2. The dimming slider doesn’t seem to consistently work, ie. if I dim up to 100% it doesn’t always fully brighten.
  3. I’d prefer if it didn’t change temperature while dimming, or perhaps you could make that an option.

(I just edited the setlevel function in my local copy to remove colour temp change, and the dimming now works ok. I think it won’t change level and temp at the same time consistently).

Regarding the UI not updating, i have seen this with some other devices and the ikea ones and also with other device handlers, i think it has something to do with the configuration that is sent when adding it so smartthings, in the device handler there is a config thats send some data to the device. I dont know when this is called but i have noticed that these kinds of issues gets solved by pressing the “reload” button in the UI

1 Like

Ah yes, that fixed that, thanks.

Also, regarding the dimming, it seems as though the ikea bulb wants to “animate” the dimming meaning it gradually goes to the requested level and if you for some reason where to set the color temperature it will actually stop dimming at what ever % it was on right then

Yes, I’ve found a similar problem with my Innr Colour bulbs. In my core Piston, I add a 5 second delay between setting level and setting colour, and that seems to fix it.

Im not at home right now so i cant test this but if you have the light close by then you could modify the setLevel method so that it add a delay between the level and temperature calls like this

def setLevel(value) {
// this will set the color temperature based on the level, 2200(0%) to 2700(100%)
// it’s a bit more like how a traditional filament bulb behaves
zigbee.setLevel(value) + “delay 500” + zigbee.setColorTemperature(2200 + (5*value))
}

I just updated the device handler so that users can set a delay between level and colour temperature change, give it a try if your devices don’t dim properly.

Thanks, I’ll give it a try.

Great work. I like this device type better than the Zigbee colour temperature bulb.

@Edvald any chance to update to the new ST color theme?

New Color Theme in ST App?

updated the colour

2 Likes

Thanks so much for this!

@Edvald

Nice work on this. Works really well for me too. Did you get any further on making the remotes work?

thanks for your effort.

Unfortunately not, my knowledge about zigbee and ST isn’t enough to write that device handler

I noticed this weekend that the Ikea bulbs don’t offer the colour temperature controls inside ActionTiles. I’m not sure if it’s the DTH that would implement this, or something on the ActionTiles side?

@Edvald would you be able to add a tile in the app to show the colour temperature like the stock zigbee dth?

Do you mean https://www.actiontiles.com/?

1 Like

Do you mean the one called “ZigBee White Color Temperature Bulb” or " ZLL White Color Temperature Bulb"?
The trådfri dth behaves like “ZigBee White Color Temperature Bulb” in that it shows a “name” instead of a kelvin temp. I don’t think that kelvin temp is all that interesting to know since, at least for me, it means nothing compared to a descriptive name of the color temp. “Soft white” is more understandable than “3239 K”

Yes, thats the one. Previously called SmartTiles.