IKEA Tradfri Bulbs: simultaneous brightness + color transition workaround

Hey there! If you’ve got Tradfri bulbs with color support (or a bunch of them), you might’ve run into some glitches when trying to animate brightness and color (or color temperature) simultaneously. Well, these bulbs can’t do both at the same time. If you’ve ever tried switching between different scenes with Tradfri, you may know the pain.

This little script is designed to help with that by splitting brightness and color adjustment into separate actions, restoring the ability to use transitions.

How to use this:

  1. Install the blueprint,
  2. Instead of calling light.turn_on, call script.tradfri_wrapper (just replace the script’s name if you want to change it),
  3. Wrap all service call parameters inside a data payload like this:
# That's your usual call:
action: light.turn_on
target:
  entity_id: light.tradfri_e14
data:
  kelvin: 2700
  brightness_pct: 100
      
# Replace with:
action: script.tradfri_wrapper
data:
  target:
    entity_id: light.tradfri_e14
  data:
    kelvin: 2700
    brightness_pct: 100

If your call involves both brightness and color/temperature adjustment, it’ll be split into two calls, doubling the total transition time but preserving the transition itself.

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Direct link: tradfri_wrapper.yaml · GitHub

4 Likes

Your blueprint makes me regret returning the IKEA bulbs :slight_smile:.
I tried to implement something similar but eventually gave up.

Good work!

1 Like

My Tradfri Bulb seems to be not working with this blueprint. Probably i am misunderstanding

script.tradfri_wrapper (just replace the script’s name if you want to change it),

Do i Need to rename something into the Automation or anywhere Else?

Thanks for helping me!

Hey there.
Have you installed the blueprint and then created a script based on it?

Do you see your script in the Scripts tab (Settings → Automation & Scenes → Scripts)?

Thank you, it works quite well now!

I have another question: how do i turnoff the Ikea bulbs without having them staying on with a Minimum britghtness value? Is this also possible with the wrapper Script? Tried it with „brightness: 0“ but also then the bulb shows the unwanted effect.

This is an awesome blueprint that has totally saved Tradfri lights for me. Much appreciated!

One additional hint: at first the script didn’t seem to work all the time for me. Whenever I was changing the colour of mutiple lights at once, some of the calls failed. Turns out that’s because by default scripts use ‘mode: single’, which means you can only change one lightbulb’s colour at a time. So I explicitly set ‘mode: parallel’ in the script and since then it’s been working perfectly.

Nice catch, thank you! I’ve updated the running mode to parallel, but I don’t have enough devices to ensure it’s working properly at the moment.

Could you please confirm everything works correctly with the newer version of the blueprint?

Sorry for the late answer. To turn the lights off you don’t need this wrapper, you can call light.turn_off straight away

My problem is that in a room, not all lights are turned on in every scene. When I then use “Turn Off,” the lights that were already off are always turned back on at minimal brightness, but Home Assistant still shows them as “Off.”

Hope this is more understandable.

I actually have the same problem. There is a night light in the hall way with three GU10 Tadfri lights. most of the times, they turn off completly. But every now and then one, two or all three lights stay on with minimum brightness and sometimes turn from an at least very warm white to a very cold blue. If look into Home Assistant it says, that all lights are turned off. So I have to set them to on and then to off. That always works. But with an automation, it works sometimes.
Have you ever found a solution? I am really hard thinking of getting three Philipps HUE lights. But that would be around a 100 € :see_no_evil:

Hi,

i am Not working with the „.turn_off“ anymore. Instead of that i am activating a new scene in which all lights are turned on with Zero brightness.
Probably this could also be a Solution for you.

I have this in my calling script:

  - action: script.1761553090502
    data:
      kelvin: 6500
      brightness_pct: 100
    target:
      entity_id: light.tradfri_bulb_1

For some reason HA wanted to put the number in there and not the name. When I run it I get this:

Failed to perform the action script/martin_s_lights_zoom. Error rendering data template: UndefinedError: ‘data’ is undefined

My GU10 is a colour temperature one, not a colour one.

As an HA newbie I’m don’t know what this means or how to track the fault down.

I do have the script and the blueprint and I restarted HA after installing it.

Ignore that, I’m being stupid. It should be this:

  - action: script.1761553090502
    data:
      target:
        entity_id: light.tradfri_bulb_1
      data:
        kelvin: 6500
        brightness_pct: 100

and that works, thank you so much for posting the blueprint.

This is great and I can get it to work as a service call for individual lights. Is it possible to use this to call different scenes or would it need to be significantly modified? Thanks!