zigpy / zha-device-handlers

ZHA device handlers bridge the functionality gap created when manufacturers deviate from the ZCL specification, handling deviations and exceptions by parsing custom messages to and from Zigbee devices.
Apache License 2.0
750 stars 685 forks source link

[BUG] IKEA TRADFRI bulb: Color temperature on start not working #3193

Open MarkHaakman opened 4 months ago

MarkHaakman commented 4 months ago

Bug description

I have a 'TRADFRI bulb E27 WS globe 1055lm' (LED2201G8) by IKEA connected via ZHA to my Home Assistant 2024.6.1 installation. I can turn the light on and change the current brightness and color temperature in the UI with no problem. On the configuration page of the device, I can also successfully change the on/off transition time and the brightness on startup (on_level), but not the color temperature on startup. When I change the value (allowed between 250 and 454 mireds), it has no effect on the actual color temperature of the bulb when I turn it on. The color temperature is still on the last temperature it was when the bulb was turned off.

The bulb is turned on by a bound STYRBAR remote control or directly in the UI, so not via an automation. The bulb is always connected to power (the physical switch is never turned off).

Steps to reproduce

  1. Turn the bulb off (do not cut the power of course)
  2. Change the 'Color temperature on start' value to 250.
  3. Turn the bulb on. Notice that the color temperature is not 250 mireds.
  4. Turn the bulb off.
  5. Change the 'Color temperature on start' value to 450.
  6. Turn the bulb on. Notice that the color temperature is not 450 mireds.

Expected behavior

When I change the value of the 'Color temperature on start' entity on the bulb configuration page, the bulb has that color temperature when it is turned on, just like the 'on_level' configures the brightness when it is turned on.

Screenshots/Video

Screenshot of configuration (Dutch) ![image](https://github.com/zigpy/zha-device-handlers/assets/15815364/ddee279c-ce10-4fd1-a953-94d7cca04350)

Device signature

Device signature ```json { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4476, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x010c", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0008", "0x0300", "0x1000", "0xfc57", "0xfc7c" ], "output_clusters": [ "0x0019" ] }, "242": { "profile_id": "0xa1e0", "device_type": "0x0061", "input_clusters": [], "output_clusters": [ "0x0021" ] } }, "manufacturer": "IKEA of Sweden", "model": "TRADFRI bulb E27 WS globe 1055lm", "class": "zigpy.device.Device" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Unsupported Third Party Container", "version": "2024.6.1", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.12.2", "docker": true, "arch": "aarch64", "timezone": "Europe/Amsterdam", "os_name": "Linux", "os_version": "4.9.269", "run_as_root": false }, "custom_components": {}, "integration_manifest": { "domain": "zha", "name": "Zigbee Home Automation", "after_dependencies": [ "onboarding", "usb" ], "codeowners": [ "dmulcahey", "adminiuga", "puddly", "TheJulianJES" ], "config_flow": true, "dependencies": [ "file_upload" ], "documentation": "https://www.home-assistant.io/integrations/zha", "iot_class": "local_polling", "loggers": [ "aiosqlite", "bellows", "crccheck", "pure_pcapy3", "zhaquirks", "zigpy", "zigpy_deconz", "zigpy_xbee", "zigpy_zigate", "zigpy_znp", "universal_silabs_flasher" ], "requirements": [ "bellows==0.39.0", "pyserial==3.5", "zha-quirks==0.0.116", "zigpy-deconz==0.23.1", "zigpy==0.64.0", "zigpy-xbee==0.20.1", "zigpy-zigate==0.12.0", "zigpy-znp==0.12.1", "universal-silabs-flasher==0.0.20", "pyserial-asyncio-fast==0.11" ], "usb": [ { "vid": "10C4", "pid": "EA60", "description": "*2652*", "known_devices": [ "slae.sh cc2652rb stick" ] }, { "vid": "10C4", "pid": "EA60", "description": "*slzb-07*", "known_devices": [ "smlight slzb-07" ] }, { "vid": "1A86", "pid": "55D4", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus v2" ] }, { "vid": "10C4", "pid": "EA60", "description": "*sonoff*plus*", "known_devices": [ "sonoff zigbee dongle plus" ] }, { "vid": "10C4", "pid": "EA60", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*tubeszb*", "known_devices": [ "TubesZB Coordinator" ] }, { "vid": "1A86", "pid": "7523", "description": "*zigstar*", "known_devices": [ "ZigStar Coordinators" ] }, { "vid": "1CF1", "pid": "0030", "description": "*conbee*", "known_devices": [ "Conbee II" ] }, { "vid": "0403", "pid": "6015", "description": "*conbee*", "known_devices": [ "Conbee III" ] }, { "vid": "10C4", "pid": "8A2A", "description": "*zigbee*", "known_devices": [ "Nortek HUSBZB-1" ] }, { "vid": "0403", "pid": "6015", "description": "*zigate*", "known_devices": [ "ZiGate+" ] }, { "vid": "10C4", "pid": "EA60", "description": "*zigate*", "known_devices": [ "ZiGate" ] }, { "vid": "10C4", "pid": "8B34", "description": "*bv 2010/10*", "known_devices": [ "Bitron Video AV2010/10" ] } ], "zeroconf": [ { "type": "_esphomelib._tcp.local.", "name": "tube*" }, { "type": "_zigate-zigbee-gateway._tcp.local.", "name": "*zigate*" }, { "type": "_zigstar_gw._tcp.local.", "name": "*zigstar*" }, { "type": "_uzg-01._tcp.local.", "name": "uzg-01*" }, { "type": "_slzb-06._tcp.local.", "name": "slzb-06*" } ], "is_built_in": true }, "setup_times": { "null": { "setup": 0.00022413700025936123 }, "b22ca2b4580b0df74c918d02aba38888": { "wait_import_platforms": -0.001575374000822194, "wait_base_component": -0.00254529999983788, "config_entry_setup": 17.26059413999974 } }, "data": { "ieee": "**REDACTED**", "nwk": 53618, "manufacturer": "IKEA of Sweden", "model": "TRADFRI bulb E27 WS globe 1055lm", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "quirk_id": null, "manufacturer_code": 4476, "power_source": "Mains", "lqi": 124, "rssi": -69, "last_seen": "2024-06-08T17:00:16", "available": true, "device_type": "Router", "signature": { "node_descriptor": "NodeDescriptor(logical_type=, complex_descriptor_available=0, user_descriptor_available=0, reserved=0, aps_flags=0, frequency_band=, mac_capability_flags=, manufacturer_code=4476, maximum_buffer_size=82, maximum_incoming_transfer_size=82, server_mask=11264, maximum_outgoing_transfer_size=82, descriptor_capability_field=, *allocate_address=True, *is_alternate_pan_coordinator=False, *is_coordinator=False, *is_end_device=False, *is_full_function_device=True, *is_mains_powered=True, *is_receiver_on_when_idle=True, *is_router=True, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x010c", "input_clusters": [ "0x0000", "0x0003", "0x0004", "0x0005", "0x0006", "0x0008", "0x0300", "0x1000", "0xfc57", "0xfc7c" ], "output_clusters": [ "0x0019" ] }, "242": { "profile_id": "0xa1e0", "device_type": "0x0061", "input_clusters": [], "output_clusters": [ "0x0021" ] } }, "manufacturer": "IKEA of Sweden", "model": "TRADFRI bulb E27 WS globe 1055lm" }, "active_coordinator": false, "entities": [ { "entity_id": "button.lamp_badkamer_identificeren", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "light.lamp_badkamer_licht", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "number.lamp_badkamer_aan_uit_transitietijd", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "number.lamp_badkamer_inschakelniveau", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "number.lamp_badkamer_huidig_niveau_bij_opstarten", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "number.lamp_badkamer_kleurtemperatuur_bij_opstarten", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "select.lamp_badkamer_opstartgedrag", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" }, { "entity_id": "update.lamp_badkamer_firmware", "name": "IKEA of Sweden TRADFRI bulb E27 WS globe 1055lm" } ], "neighbors": [ { "device_type": "Coordinator", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x0000", "permit_joining": "Unknown", "depth": "0", "lqi": "126" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Parent", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0x8BD5", "permit_joining": "Unknown", "depth": "15", "lqi": "192" }, { "device_type": "Router", "rx_on_when_idle": "On", "relationship": "Sibling", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0xB012", "permit_joining": "Unknown", "depth": "15", "lqi": "96" }, { "device_type": "EndDevice", "rx_on_when_idle": "Off", "relationship": "Child", "extended_pan_id": "**REDACTED**", "ieee": "**REDACTED**", "nwk": "0xB78C", "permit_joining": "NotAccepting", "depth": "3", "lqi": "190" } ], "routes": [ { "dest_nwk": "0x0000", "route_status": "Active", "memory_constrained": true, "many_to_one": true, "route_record_required": false, "next_hop": "0x0000" } ], "endpoint_names": [ { "name": "COLOR_TEMPERATURE_LIGHT" }, { "name": "PROXY_BASIC" } ], "user_given_name": "Lamp Badkamer", "device_reg_id": "94f433d4242da489360cc86751efce3a", "area_id": "badkamer", "cluster_details": { "1": { "device_type": { "name": "COLOR_TEMPERATURE_LIGHT", "id": 268 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0004": { "attribute_name": "manufacturer", "value": "IKEA of Sweden" }, "0x0005": { "attribute_name": "model", "value": "TRADFRI bulb E27 WS globe 1055lm" } }, "unsupported_attributes": {} }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0005": { "endpoint_attribute": "scenes", "attributes": {}, "unsupported_attributes": {} }, "0x0006": { "endpoint_attribute": "on_off", "attributes": { "0x0000": { "attribute_name": "on_off", "value": 0 }, "0x4003": { "attribute_name": "start_up_on_off", "value": 255 } }, "unsupported_attributes": {} }, "0x0008": { "endpoint_attribute": "level", "attributes": { "0x0000": { "attribute_name": "current_level", "value": 234 }, "0x0011": { "attribute_name": "on_level", "value": 234 }, "0x0010": { "attribute_name": "on_off_transition_time", "value": 3 }, "0x4000": { "attribute_name": "start_up_current_level", "value": 255 } }, "unsupported_attributes": { "0x0013": { "attribute_name": "off_transition_time" }, "0x0012": { "attribute_name": "on_transition_time" }, "0x0014": { "attribute_name": "default_move_rate" } } }, "0x0300": { "endpoint_attribute": "light_color", "attributes": { "0x400a": { "attribute_name": "color_capabilities", "value": 16 }, "0x0008": { "attribute_name": "color_mode", "value": 1 }, "0x400c": { "attribute_name": "color_temp_physical_max", "value": 454 }, "0x400b": { "attribute_name": "color_temp_physical_min", "value": 250 }, "0x0007": { "attribute_name": "color_temperature", "value": 250 }, "0x0003": { "attribute_name": "current_x", "value": 30015 }, "0x0004": { "attribute_name": "current_y", "value": 26870 }, "0x000f": { "attribute_name": "options", "value": 0 }, "0x4010": { "attribute_name": "start_up_color_temperature", "value": 443 } }, "unsupported_attributes": { "0x0000": { "attribute_name": "current_hue" }, "0x0001": { "attribute_name": "current_saturation" }, "0x4002": { "attribute_name": "color_loop_active" }, "0x4000": { "attribute_name": "enhanced_current_hue" } } }, "0x1000": { "endpoint_attribute": "lightlink", "attributes": {}, "unsupported_attributes": {} }, "0xfc57": { "endpoint_attribute": "manufacturer_specific", "attributes": {}, "unsupported_attributes": {} }, "0xfc7c": { "endpoint_attribute": "manufacturer_specific", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "0x0019": { "endpoint_attribute": "ota", "attributes": { "0x0002": { "attribute_name": "current_file_version", "value": 33816581 } }, "unsupported_attributes": {} } } }, "242": { "device_type": { "name": "PROXY_BASIC", "id": 97 }, "profile_id": 41440, "in_clusters": {}, "out_clusters": { "0x0021": { "endpoint_attribute": "green_power", "attributes": {}, "unsupported_attributes": {} } } } } } } ```

Logs

No response

Additional information

No response

FRivasFlores commented 2 months ago

This is happening to me as well with the JETSTROM led panel.

But I've noticed a behaviour: If you change the color temperature, and cut electricity to the device, then next time you turn on power it will get the new color temperature. So it is not working stopping/starting via zigbee command, but physically cutting and resuming power to the device