Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IKEA Trafri LED Dimmers don't expose brightness in HomeAssistant #26446

Open
victorhooi opened this issue Feb 20, 2025 · 8 comments
Open

IKEA Trafri LED Dimmers don't expose brightness in HomeAssistant #26446

victorhooi opened this issue Feb 20, 2025 · 8 comments
Labels
problem Something isn't working

Comments

@victorhooi
Copy link

What happened?

I have several IKEA Trafri LED dimmers that are connected to Zigbee2MQTT:

https://www.zigbee2mqtt.io/devices/ICPSHC24-10EU-IL-1_ICPSHC24-10EU-IL-2.html

Zigbee2mqtt version: 2.1.1-dev commit: 382c89c49eae395da3a452c8851281829967fec7
HomeAssistant version (Core): 2025.3.0.dev202502200229

Previously (e.g. 1-2 weeks ago), the dimmers were working fine in HomeAssistant, and I was able to successfully adjust the brightness.

However, as of a recent zigbee2mqtt update, these are now simply appearing as binary on/off lights in HomeAssistant:

Image

In the zigbee2mqtt webUI - I can confirm that brightness is still exposed, and seems to work when you directly control it there:

Image

What did you expect to happen?

The dimmable LED drivers should exposed brighness controls in HomeAssistant integration.

How to reproduce it (minimal and precise)

Setup HomeAssistant and latest zigbee2mqtt (dev).

Pair a IKEA Tradfri LED dimmer (device)

Zigbee2MQTT version

2.1.1-dev commit: 382c89c

Adapter firmware version

20240710

Adapter

UZG-01

Setup

Docker

Debug log

log.log

@victorhooi victorhooi added the problem Something isn't working label Feb 20, 2025
@AlexanderLeporiday
Copy link

If you go to state do you see the brightness value reported there?
If you check the Zigbee2MQTT logs, after making a change to the brightness level, do you see the message reported as a state change that is sent to Home Assistant?
Have you restarted Zigbee2MQTT since updating the dev version?
Have you tried reconfiguring the device since the issue started?
Have you tried pairing the device again since the issue started?

It's possible there's been an underlying change to the converter that requires the configuration to be reloaded for the device.

@AlexanderLeporiday
Copy link

I can see you attached a debug log and from what I can see the following:

[2025-01-20 11:00:14] info: z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/Downstairs Bunk Bed Light', payload '{"brightness":254,"effect":null,"identify":null,"linkquality":7,"power_on_behavior":null,"state":"OFF","update":{"installed_version":587753009,"latest_version":587753009,"state":"idle"}}'

So the MQTT payload has a brightness value, I'm not sure why it wouldn't be appear in home assistant unless something under the hood is causing the topic to no longer include brightness.

Have you tried reloading the MQTT integration or restarting the MQTT service?

@victorhooi
Copy link
Author

I just tried a reconfigure via the zigbee2mqtt webIU - here's the zigbee2mqtt log lines from that action:

2025-02-21 22:41:55z2m: Configuring 'Downstairs Bunk Bed Light'
info 2025-02-21 22:41:55z2m: Successfully configured 'Downstairs Bunk Bed Light'
info 2025-02-21 22:41:55z2m:mqtt: MQTT publish: topic 'zigbee2mqtt/bridge/response/device/configure', payload '{"data":{"id":"Downstairs Bunk Bed Light"},"status":"ok","transaction":"1ac5k-1"}'

However, it didn't seem to resolve the issue.

My HomeAssistant, zigbee2mqtt and mosquitto (MQTT broker) are all running in containers - I did try restarting all of them (docker compose restart) - however, the issue is still there.

I also tried restarting the MQTT integration from within the HomeAssistant UI as well - that didn't seem to change anything. I also checked "Download Diagnostics" from the MQTT integration - attached, in case that has anything useful.

config_entry-mqtt-01JEB298YS7ZVY21XQ9CG22C2R.json

Would removing the device from zigbee2mqtt and then trying to re-add it do anything?

Or anything else I should check?

@ahattink
Copy link

somewhat the same as #26441

@swesharkie
Copy link

swesharkie commented Feb 28, 2025

I've found this as well for Ikea Silverglans (ICPSHC24-30-IL44-1) and Trådfri (ICPSHC24-30EU-IL-1/ICPSHC24-10EU-IL-2).

Noticed an error in Home Assistant logs referencing the config of these lights:
light.alex_bookcase_lights (<class 'homeassistant.components.mqtt.light.schema_json.MqttLightJson'>) does not set supported color modes, this will stop working in Home Assistant Core 2025.3

So I experimented a bit, according to Home Assistant specifications:
supported_color_modes list (Optional) A list of color modes supported by the list. Possible color modes are onoff, brightness, color_temp, hs, xy, rgb, rgbw, rgbww, white. Note that if onoff or brightness are used, that must be the only value in the list.

I then added this bit in the config topic and injected it,
Original:
{ "availability": [ { "topic": "sesvmalevz2m/bridge/state", "value_template": "{{ value_json.state }}" }, { "topic": "sesvmalevz2m/Alex Bookcase Lights/availability", "value_template": "{{ value_json.state }}" } ], "availability_mode": "all", "brightness": true, "brightness_scale": 254, "command_topic": "sesvmalevz2m/Alex Bookcase Lights/set", "device": { "configuration_url": "http://sesvmalevz2m.home.sharkie.se/#/device/0x5c0272fffe9817d0/info", "hw_version": 1, "identifiers": [ "zigbee2mqtt_0x5c0272fffe9817d0" ], "manufacturer": "IKEA", "model": "TRADFRI LED driver, 30 w", "model_id": "ICPSHC24-30EU-IL-1/ICPSHC24-10EU-IL-2", "name": "Alex Bookcase Lights", "sw_version": "2.3.086", "via_device": "zigbee2mqtt_bridge_0x00124b002a1ae61f" }, "effect": true, "effect_list": [ "blink", "breathe", "okay", "channel_change", "finish_effect", "stop_effect" ], "name": null, "object_id": "alex_bookcase_lights", "origin": { "name": "Zigbee2MQTT", "sw": "2.1.1-dev", "url": "https://www.zigbee2mqtt.io" }, "schema": "json", "state_topic": "sesvmalevz2m/Alex Bookcase Lights", "unique_id": "0x5c0272fffe9817d0_light_sesvmalevz2m" }

I then added:
"supported_color_modes": [ "brightness" ],

The entire config will be:
{ "availability": [ { "topic": "sesvmalevz2m/bridge/state", "value_template": "{{ value_json.state }}" }, { "topic": "sesvmalevz2m/Alex Bookcase Lights/availability", "value_template": "{{ value_json.state }}" } ], "availability_mode": "all", "brightness": true, "brightness_scale": 254, "command_topic": "sesvmalevz2m/Alex Bookcase Lights/set", "device": { "configuration_url": "http://sesvmalevz2m.home.sharkie.se/#/device/0x5c0272fffe9817d0/info", "hw_version": 1, "identifiers": [ "zigbee2mqtt_0x5c0272fffe9817d0" ], "manufacturer": "IKEA", "model": "TRADFRI LED driver, 30 w", "model_id": "ICPSHC24-30EU-IL-1/ICPSHC24-10EU-IL-2", "name": "Alex Bookcase Lights", "sw_version": "2.3.086", "via_device": "zigbee2mqtt_bridge_0x00124b002a1ae61f" }, "effect": true, "effect_list": [ "blink", "breathe", "okay", "channel_change", "finish_effect", "stop_effect" ], "name": null, "object_id": "alex_bookcase_lights", "origin": { "name": "Zigbee2MQTT", "sw": "2.1.1-dev", "url": "https://www.zigbee2mqtt.io" }, "schema": "json", "state_topic": "sesvmalevz2m/Alex Bookcase Lights", "supported_color_modes": [ "brightness" ], "unique_id": "0x5c0272fffe9817d0_light_sesvmalevz2m" }

This is published in 'homeassistant/light/0x5c0272fffe9817d0/light/config'

Now brightness works just as before.

It seems as if supported_color_modes is no longer optional..
Id like to argue that the config-lines already included:
"brightness": true,
"brightness_scale": 254,
Would give Home Assistant a hint that brightness is supported, but it seems not anymore.

If this is done on your setup as a temporary workaround, don't forget to enable retain flag :).

Before:
Image

After:
Image

Edit:
Had a peek at the code, saw the variable hasBrightness used in the code and seems to return a boolean so using this here:

const colorModes = [

Could do the trick, so instead of:
const colorModes = [ hasColorXY && !preferHS ? 'xy' : null, (!hasColorXY || preferHS) && hasColorHS ? 'hs' : null, hasColorTemp ? 'color_temp' : null, ].filter((c) => c);

-- It could be:
-- const colorModes = [ -- hasColorXY && !preferHS ? 'xy' : null, -- (!hasColorXY || preferHS) && hasColorHS ? 'hs' : null, -- hasColorTemp ? 'color_temp' : null, -- hasBrightness ? 'brightness' : null, -- ].filter((c) => c);
(edit2, never mind, since brightness must be the only supported_color_mode if included, this would cause all kinds of mayhem)

I'm not certain though, I've only done a quick glance and have no idea how this might mess other things up. I'm a network engineer, not a coder after all.. :)

@itkama
Copy link

itkama commented Feb 28, 2025

Having the same issue on 3 hue bulbs. Interestingly I have no trouble with Ikea bulbs (yet).

I also seem to have this in my HA logs:
supported_color_modes list (Optional) A list of color modes supported by the list. Possible color modes are onoff, brightness, color_temp, hs, xy, rgb, rgbw, rgbww, white. Note that if onoff or brightness are used, that must be the only value in the list.

Edit:
My Ikea bulbs are probably still working, because they can switch between cold and warm white which probably exposes the color_mode property somehow. My hue bulbs only support warm white.

@swesharkie
Copy link

swesharkie commented Mar 1, 2025

Having the same issue on 3 hue bulbs. Interestingly I have no trouble with Ikea bulbs (yet).

I also seem to have this in my HA logs: supported_color_modes list (Optional) A list of color modes supported by the list. Possible color modes are onoff, brightness, color_temp, hs, xy, rgb, rgbw, rgbww, white. Note that if onoff or brightness are used, that must be the only value in the list.

Edit: My Ikea bulbs are probably still working, because they can switch between cold and warm white which probably exposes the color_mode property somehow. My hue bulbs only support warm white.

I've come to the same conclusion, if the light has basically any "feature" besides brightness it won't be affected. One of the supported_color_modes is color_temp. It happened to my Ikea lights since they are the only ones that only has brightness.

I still don't like the phrasing though, supported_color_modes should not include brightness or onoff since those are not colors.. Rename it to light_features or something in that case..
It's also inconsistent, in the case of a light that supports color, brightness is also exposed but doesn't have to be included in supported_color_modes array. But, this is the wrong place to rant about that part :)

Edit:
I've suggested an edit to the current documentation home-assistant/home-assistant.io#37763

@swesharkie
Copy link

Well, that got sorted..
home-assistant/core#139585

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
problem Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants