IKEA lights stop mid-transition when ZHA sends a redundant color command after the level command

Open
#1,097 3 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
30/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python
Domain
embedded-iot

Research direction

Start in zha/application/platforms/light/init.py, where new_color_provided_while_off is computed and async_handle_color_commands sends the color command after the level command. Reproducing needs IKEA bulbs and a Zigbee coordinator, so trace the command ordering in the logs instead. Done means the redundant color command is skipped when the color matches the current one in the same mode, with the level transition reaching target on all bulbs.

Written by the indexing model from the issue text.

Description

Setup

  • Home Assistant 2026.11.2, ZHA (zigpy-znp), coordinator CC2674P10 (SLZB-MR4U)
  • 3× IKEA TRÅDFRI bulb GU10 CWS 345lm, switched individually (unicast)
  • ZHA options: default light transition = 1 s, "Enhanced light transition from an off-state" = on

What happens

Turning the lights on from off with brightness: 204 and color_temp_kelvin: 3000, while all three bulbs are already at 333 mireds (color temperature mode), ZHA sends:

19:18:46.872  move_to_level_with_on_off(level=204, transition_time=10)
19:18:47.044  move_to_color_temp(color_temp_mireds=333, transition_time=10)   ← 0.15–0.5 s later

All commands are acknowledged with SUCCESS. But the bulbs abort the level transition when the color command arrives, and stay at an intermediate level. Reported current_level after the transition (target 204):

switch-on bulb A bulb B bulb C
19:18:46 41 41 82
19:19:00 102 41 41
19:19:13 143 61 122

With transition 0, all bulbs reach 204 every time.

What works

  • Color actually changes (e.g. it was set to an XY color before): the enhanced off-state path kicks in. ZHA turns on at minimum level, sets the color, then moves to the level. All bulbs reach 204.
  • Only the level is sent (we stopped sending the unchanged color from our side): move_to_level_with_on_off(204, 10) alone. All bulbs fade cleanly to 204.

Why

In zha/application/platforms/light/__init__.py, new_color_provided_while_off is only true if the color differs from the current one. So with an unchanged color, the enhanced path is skipped. async_handle_color_commands then still sends the color command right after the level command, with the same transition, while the level transition is still running.

IKEA WS/CWS bulbs are known to freeze for the duration of a transition after a color command and to drop or abort other commands during that time. Zigbee2MQTT works around this for all IKEA WS/CWS lights: zigbee-herdsman-converters src/lib/ikea.ts, trackFreezing / unfreeze_support (on by default), which sends genLevelCtrl stop before the next command while a light is marked as frozen (Koenkk/zigbee2mqtt#18574). Related reports: home-assistant/core#117604, and several community threads ("Light transition not working. IKEA Tradfri", "simultaneous brightness + color transition workaround").

Suggestions

  1. Don't send the color command when the requested color equals the current one in the same color mode. That alone fixed the common switch-on case for us.
  2. Optionally, port the Z2M IKEA unfreeze handling (track frozenUntil per light or group, send stop before the next command).

Debug logs (redacted) are available on request.

Dominant language
Python
Stars
96
Forks
84
Avg merge
2d 4h
Merged PRs (30d)
30

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from zigpy/zha

All issues in zigpy/zha

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.