Koenkk / zigbee2mqtt

Zigbee 🐝 to MQTT bridge 🌉, get rid of your proprietary Zigbee bridges 🔨
https://www.zigbee2mqtt.io
GNU General Public License v3.0
11.87k stars 1.65k forks source link

Ikea Trådfri and other models ignoring color_temp and color_temp_startup #18699

Closed h8hr1pzdo3rmiqv5 closed 11 months ago

h8hr1pzdo3rmiqv5 commented 1 year ago

What happened?

setup: Home Assistant last stable version and zigbee2mqtt last-dev version (both from official Docker images)

My lights CCT is controlled by an automation that change the temperature depending on time/sun. In order to avoid having briefly cool light during the night when I turn on lights that were cool last time they were on, I sent a payload with the color_temp to lights that are off. This work great with Lonsonho ZB-RGBCW with eWeLight ZB-CL01 controller: when turned on, the light has the temperature set when it was off.

This doesn't work with Lonsonho ZB-RGBCW (the same) with eWeLink Z102LG03-1 controller. Neither with Ikea LED1949C5 and LED2003G10. Haven't tested yet but LED2005R5 may have the same issue.

Observed behavior for the abovesaid models: publishing the below message when the light is off seem to effectively change the value at the light (it can be retrieved by the command get);

topic: zigbee2mqtt/bulb_e27_1/set payload: '{"color_temp":250}' qos: 1

but once turned on, the light emit a light of the previous temperature. Worse, if still on and requested to set the wanted temperature again (exactly the same), it will not change its temperature. It will only change it if receiving a request for a different temperature.

The same happen when setting color_temp_startup, which, according to its name, should by the way help defining a startup temperature.

What did you expect to happen?

The light should emit a white temperature equal to the value set while it was turned off and saved in its data.

How to reproduce it (minimal and precise)

Use a bulb of the involved model, with CCT capability. Turn the light on. Set a warm temperature, for example. Turn the light off. Set a cool temperature, for example. It can be done with zigbee2MQTT webinterface, by clicking on the temperature bar. Turn the light on. Observe the light doesn't emit the set temperature.

Zigbee2MQTT version

1.32.2-dev

Adapter firmware version

6.10.3.0 build 297

Adapter

Sonoff ZBDongle-E EZSP v8

Debug log

debug 2023-08-23 02:03:23: Received MQTT message on 'zigbee2mqtt/bulb_e27_1/set' with data '{"color_temp":250}' debug 2023-08-23 02:03:23: Publishing 'set' 'color_temp' to 'bulb_e27_1' info 2023-08-23 02:03:23: MQTT publish: topic 'zigbee2mqtt/bulb_e27_1', payload '{"brightness":177,"color":{"x":0.3217,"y":0.3314},"color_mode":"color_temp","color_temp":250,"level_config":{"on_level":"previous"},"linkquality":160,"state":"OFF"}' debug 2023-08-23 02:03:28: Received MQTT message on 'zigbee2mqtt/bulb_e27_1/set' with data '{"state":"on"}' debug 2023-08-23 02:03:28: Publishing 'set' 'state' to 'bulb_e27_1' info 2023-08-23 02:03:28: MQTT publish: topic 'zigbee2mqtt/bulb_e27_1', payload '{"brightness":177,"color":{"x":0.3217,"y":0.3314},"color_mode":"color_temp","color_temp":250"level_config":{"on_level":"previous"},"linkquality":160,"state":"ON"}'

sjorge commented 1 year ago

You need to set color_options.execute_if_off to true, it's off by default for IKEA bulbs so they ignore color and color_temp changes unless they are on.

mosquitto_pub -t zigbee2mqtt/FRIENDLY_NAME/set/color_options -m '{"execute_if_off": true}'

You can do the same thing for brightness changes, but depending on the payload the bulb might turn on anyway when setting brightness.

mosquitto_pub -t zigbee2mqtt/FRIENDLY_NAME/set/level_options -m '{"execute_if_off": true}'
h8hr1pzdo3rmiqv5 commented 1 year ago

Just tried.

With the Ikea Trådfri: it work, even if zigbee2mqtt complain "there is no converter" for those parameters. However, those settings don't survive a loss of power. It work again once the power has been reestablished and the settings pushed again. Is that instability the reason those parameters aren't documented nor supported?

With the Lonsonho eWeLink: doesn't work. I suppose they do not exist on the firmware part.

Thank you @sjorge.

sjorge commented 1 year ago

Mostly because they are optional and most bulbs implement them weird. Tradfri tends to forget them on powerloss. For some (i though innr) you can write but not read them, …~ sjorgeOn 24 Aug 2023, at 01:42, h8hr1pzdo3rmiqv5 @.***> wrote: Just tried. With the Ikea Trådfri: it work, even if zigbee2mqtt complain "there is no converter" for those parameters. However, those settings don't survive a loss of power. It work again once the power has been reestablished and the settings pushed again. Is that instability the reason those parameters aren't documented nor supported? With the Lonsonho eWeLink: doesn't work. I suppose they do not exist on the firmware part. Thank you @sjorge.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

protyposis commented 1 year ago

mosquitto_pub -t zigbee2mqtt/FRIENDLY_NAME/set/level_options -m '{"execute_if_off": true}'

Didn't validate myself, but the sources indicate this is called level_config.

h8hr1pzdo3rmiqv5 commented 1 year ago

However, the Ikea Trådfris i tested don't need additional configuration for brightness change while off; they handle it by default.

github-actions[bot] commented 11 months ago

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 7 days