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
770 stars 702 forks source link

IKEA STYRBAR with FW 2.4.11 needs a new quirk #3135

Open marianhlavac opened 6 months ago

marianhlavac commented 6 months ago

IKEA has pushed a new OTA FW v2.4.11 (0x02040011) on 3rd May 2024 ^1 for their STYRBAR remote controls, which removes a lot of functionality, which was previously working in Home Assistant.

tl;dr: L+R buttons stopped working, Zigbee groups stopped working, the device signature changed -> quirks are not being applied, but even when the current V2 quirk is applied, the buttons doesn't have the same behaviour as previously.


What stopped working (at least what I've noticed):

The device signature has changed and the current quirk (zhaquirks.ikea.IkeaTradfriRemoteV2) is not applied. It seems that there is now 0x0004 cluster included, and 0xFC57 is missing from the signature.

I tried to update the signature in the quirk and it got applied fine, but even with the V2 quirk active, the remote doesn't have the same behaviour as previously.

Steps to reproduce

  1. Keep OTA enabled and let your STYRBAR remotes to be updated to 0x02040011
  2. Watch how basically everything stops working overnight for no reason

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=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0820", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x0004", "0x0020", "0x1000", "0xfc7c" ], "output_clusters": [ "0x0003", "0x0004", "0x0005", "0x0006", "0x0008", "0x0019", "0x1000" ] } }, "manufacturer": "IKEA of Sweden", "model": "Remote Control N2", "class": "zigpy.device.Device" } ```

Diagnostic information

Diagnostic information ```json { "home_assistant": { "installation_type": "Home Assistant Container", "version": "2024.5.1", "dev": false, "hassio": false, "virtualenv": false, "python_version": "3.12.2", "docker": true, "arch": "x86_64", "timezone": "Europe/Prague", "os_name": "Linux", "os_version": "5.15.0-88-generic", "run_as_root": true }, "custom_components": { "hacs": { "documentation": "https://hacs.xyz/docs/configuration/start", "version": "1.33.0", "requirements": [ "aiogithubapi>=22.10.1" ] } }, "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.38.4", "pyserial==3.5", "pyserial-asyncio==0.6", "zha-quirks==0.0.115", "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.18", "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 }, "data": { "ieee": "**REDACTED**", "nwk": 12758, "manufacturer": "IKEA of Sweden", "model": "Remote Control N2", "name": "IKEA of Sweden Remote Control N2", "quirk_applied": false, "quirk_class": "zigpy.device.Device", "quirk_id": null, "manufacturer_code": 4476, "power_source": "Battery or Unknown", "lqi": 240, "rssi": -40, "last_seen": "2024-05-05T10:16:53", "available": true, "device_type": "EndDevice", "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=True, *is_full_function_device=False, *is_mains_powered=False, *is_receiver_on_when_idle=False, *is_router=False, *is_security_capable=False)", "endpoints": { "1": { "profile_id": "0x0104", "device_type": "0x0820", "input_clusters": [ "0x0000", "0x0001", "0x0003", "0x0004", "0x0020", "0x1000", "0xfc7c" ], "output_clusters": [ "0x0003", "0x0004", "0x0005", "0x0006", "0x0008", "0x0019", "0x1000" ] } }, "manufacturer": "IKEA of Sweden", "model": "Remote Control N2" }, "active_coordinator": false, "entities": [ { "entity_id": "button.kitchen_light_switch_identify", "name": "IKEA of Sweden Remote Control N2" }, { "entity_id": "sensor.kitchen_light_switch_battery", "name": "IKEA of Sweden Remote Control N2" }, { "entity_id": "update.kitchen_light_switch_firmware", "name": "IKEA of Sweden Remote Control N2" } ], "neighbors": [], "routes": [], "endpoint_names": [ { "name": "NON_COLOR_CONTROLLER" } ], "user_given_name": "Kitchen Light Switch", "device_reg_id": "4e14b7a4e3012f0594257add55aef937", "area_id": "kitchen", "cluster_details": { "1": { "device_type": { "name": "NON_COLOR_CONTROLLER", "id": 2080 }, "profile_id": 260, "in_clusters": { "0x0000": { "endpoint_attribute": "basic", "attributes": { "0x0004": { "attribute_name": "manufacturer", "value": "IKEA of Sweden" }, "0x0005": { "attribute_name": "model", "value": "Remote Control N2" } }, "unsupported_attributes": {} }, "0x0001": { "endpoint_attribute": "power", "attributes": { "0x0021": { "attribute_name": "battery_percentage_remaining", "value": 168 }, "0x0020": { "attribute_name": "battery_voltage", "value": 26 } }, "unsupported_attributes": { "0x0031": { "attribute_name": "battery_size" }, "0x0033": { "attribute_name": "battery_quantity" } } }, "0x0003": { "endpoint_attribute": "identify", "attributes": {}, "unsupported_attributes": {} }, "0x0004": { "endpoint_attribute": "groups", "attributes": {}, "unsupported_attributes": {} }, "0x0020": { "endpoint_attribute": "poll_control", "attributes": { "0x0000": { "attribute_name": "checkin_interval", "value": 13200 } }, "unsupported_attributes": {} }, "0x1000": { "endpoint_attribute": "lightlink", "attributes": {}, "unsupported_attributes": {} }, "0xfc7c": { "endpoint_attribute": "manufacturer_specific", "attributes": {}, "unsupported_attributes": {} } }, "out_clusters": { "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": {}, "unsupported_attributes": {} }, "0x0008": { "endpoint_attribute": "level", "attributes": {}, "unsupported_attributes": {} }, "0x0019": { "endpoint_attribute": "ota", "attributes": { "0x0002": { "attribute_name": "current_file_version", "value": 33816593 } }, "unsupported_attributes": {} }, "0x1000": { "endpoint_attribute": "lightlink", "attributes": {}, "unsupported_attributes": {} } } } } } } ```
MattWestb commented 6 months ago

Did you deleting the device and waiting one minute (or restart HA) before adding it so the system is adding its as new and not using the old cluster settings in the DB ? I have looking little then its 6 updates in TF feed but most is already in the Dirigera but not all so must updating the firmware matrix.

marianhlavac commented 6 months ago

Yes, numerous tries to reconfigure or remove/re-add, it didn't help. I have even tried it on a clean instance of Home Assistant, just to be sure.

I have looking little then its 6 updates in TF feed but most is already in the Dirigera but not all so must updating the firmware matrix.

I don't have any experience with how the firmware works, is there anyone in the community who contributed the current quirks and would be able to help with the new firmware?


On the side note, is it possible to downgrade the current remotes or I'm stuck with this unsupported version?

Thanks!

MattWestb commented 6 months ago

All IKEA controllers i have trying and also in the Zigbee certificate its saying they is protected for roll back the firmware only light is not and can being done (for getting the magic IKEA scene). I have trying updating my Styrbar and Vallhorn but its looks like Dirigera feed (that ZHA is using) is not having it also tretakt is missing. Have moving one Styrbar to TF and updating it and can taking on look on it then its done and back in one of my test system.

MattWestb commented 6 months ago

Add the Groups.cluster_id, in the signature and in the replacement also need adding it in import as Groups with the other normal cluster inport. Deleting the WWAH_CLUSTER_ID, and it shall working and loading the quirk and the device automatons.

chrizzlibaer commented 6 months ago

I'm on the other side over there @ zigbee2mqtt and the remote also stopped working for left and right. Just to say it's not only related to Zha... 🙄

MattWestb commented 6 months ago

We is knowing if they have doing some more changes tomorrow then i have getting one updated and can fixing the quirk for it.

marianhlavac commented 6 months ago

Add the Groups.cluster_id, in the signature and in the replacement also need adding it in import as Groups with the other normal cluster inport. Deleting the WWAH_CLUSTER_ID, and it shall working and loading the quirk and the device automatons.

Yes, I tried this, unfortunately, as I mentioned in the issue, even having the quirk working doesn't help with LightLink not working and L+R buttons not reporting events.

We is knowing if they have doing some more changes tomorrow then i have getting one updated and can fixing the quirk for it.

Thank you! Let us know if we can help in any way (test, review, whatever).

MattWestb commented 6 months ago

I can being needed sniffing how TF and DG is setting up the device if they have changing the function of the scene cluster that i easy can do then have getting it updated and then see what is needed for getting working OK.

MattWestb commented 6 months ago

Local quirk that loading OK and have the same functionality as V2 (long release up and down is the same). Tale the .TXT away and punting in the local quirk folder Styr3.py.txt

JohnBull-1975 commented 6 months ago

I had the 2.4.11 update a few days ago. Only got it for one of two STYRBAR...so the one still on 1.0.024 still works. I thought the updated worked after update, but I only tried on/off (up/down). This evening my son reported left-right didn't work. I started troubleshooting and excluded it from Z2MQTT (in HA) and after that no button on that device works! I tried exclude and include several times. Last seen status updates on every include. But no response in MQTT-console when hitting the buttons.

I tried to delete it with the Force Exclude option, Full rebooted of HA and then Permit all join and hit the link button x4 and after that it shows as Offline. Can still get it to leave the network by hitting the link button once or by resetting it by link button x4 and then get it to re-join. Still Offline and no response from buttons.

If I remove and re-insert batteries, last seen status updates, but it is still reported as Offline and no response from buttons.

Tried the trick to direct link it to a bulb with no success. It fails to link. Also discussed and pasted some logs here: https://github.com/Koenkk/zigbee2mqtt/issues/18515

Think I'll try to take it back to IKEA tomorrow and see if they give me another and see what firmware that is on and if it works...

JohnBull-1975 commented 6 months ago

Tried the re-configre button and got this in the log: Info 2024-05-05 22:14:14Configuring '0x287681fffeecf0d8' Error 2024-05-05 22:14:22Frame changeSourceRouteHandler parsing error: RangeError: Attempt to access memory outside buffer bounds at new NodeError (node:internal/errors:405:5) at boundsError (node:internal/buffer:86:11) at Buffer.readUInt16LE (node:internal/buffer:245:5) at Buffer.readUIntLE (node:internal/buffer:182:17) at Function.deserialize (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/types/basic.ts:19:67) at new EZSPFrameData (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:180:54) at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:154:23 at Array.every () at Function.createFrame (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:148:15) at Ezsp.onFrameReceived (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/ezsp.ts:439:35) Error 2024-05-05 22:14:22Unparsed frame 0xc4. Skipped Error 2024-05-05 22:14:24Failed to configure '0x287681fffeecf0d8', attempt 4 (Error: {"address":48854,"clusterId":32801,"sequence":224} after 10000ms at Object.start (/app/node_modules/zigbee-herdsman/src/utils/waitress.ts:63:23) at Driver.zdoRequest (/app/node_modules/zigbee-herdsman/src/adapter/ezsp/driver/driver.ts:727:43) at /app/node_modules/zigbee-herdsman/src/adapter/ezsp/adapter/ezspAdapter.ts:567:13 at Queue.execute (/app/node_modules/zigbee-herdsman/src/utils/queue.ts:35:20) at Endpoint.bind (/app/node_modules/zigbee-herdsman/src/controller/model/endpoint.ts:464:13) at configure (/app/node_modules/zigbee-herdsman-converters/src/lib/ikea.ts:147:13) at Object.configure (/app/node_modules/zigbee-herdsman-converters/src/index.ts:160:21) at Configure.configure (/app/lib/extension/configure.ts:121:13) at Configure.onMQTTMessage (/app/lib/extension/configure.ts:55:21) at EventEmitter.wrappedCallback (/app/lib/eventBus.ts:174:17))

Unfortunately it says me nothing...this is far beyond my knowledge...

MattWestb commented 6 months ago

If re config is not working take out the battery and putting it back and start the re configure is normally getting it reviving the commands and start working (if some early commands is timing out then its one must for getting it reporting OK).

JohnBull-1975 commented 6 months ago

If re config is not working take out the battery and putting it back and start the re configure is normally getting it reviving the commands and start working (if some early commands is timing out then its one must for getting it reporting OK).

I have tried unplugging batteries and re-inserted them several times. Tried agan: Info 2024-05-05 22:24:40Configuring '0x287681fffeecf0d8' Info 2024-05-05 22:24:47Successfully configured '0x287681fffeecf0d8' Still Offline and no response from buttons

MattWestb commented 6 months ago

If re config is not working take out the battery and putting it back and start the re configure is normally getting it reviving the commands and start working (if some early commands is timing out then its one must for getting it reporting OK).

You was not reading and is still using Z2M so not one ZHA problem.

JohnBull-1975 commented 6 months ago

but now it updated "last seen" when I clicked up...tried again and it updated...waited 20 sec and pressed left and it updated "last seen" for left click as well...

But still Offline and couldn't see it as device in MQTT integration i HA Tried to exclude (link button x4) and inlcude (permit join all + link button x4) and then it came back as device. Renamed it and came back as device in HA and now Online...but still no response from buttons...

Was this thread ZHA specific....damn - missed that...was just googling and found it but didn't looked where the thread was sorted...sorry

MattWestb commented 6 months ago

Have updating one more test network (with RCP coordinator) and with quirk V3 group binding is working well also if bind the scene cluster its looks like IKEAs magic scenes is working default so no need adding the magic group and adding scene is its OK with the default ones. Have not tested device binding but i think it shall working the Dirigera i using only unicast and routing them to groups in the hub = very bad done !!).

Can some more testing the quirk and i can posting on PR for getting it in next HA release ?

marianhlavac commented 6 months ago

Can some more testing the quirk and i can posting on PR for getting it in next HA release ?

@MattWestb If you could open the PR, I will test the V3 quirk right away. Thanks!

MattWestb commented 6 months ago

PR posted

dlbogdan commented 6 months ago

Just so I can have some rest, is this firmware (2.4.11) better or worse in terms of zigbee groups binding compared to 2.4.5? I have one styrbar on 2.4.5 with no group binding capability and was hoping 2.4.11 is going to fix this. I tried my best to upgrade it but can't. I even upload the firmware file myself in home assistant and setup my config file as below:

`zha:

zigpy_config:

ota:

  allow_file_providers: "I understand I can *destroy* my devices by enabling OTA updates from files. Some OTA updates can be mistakenly applied to the wrong device, breaking it. I am consciously using this at my own risk."

  otau_directory: /config/zig-ota

  ikea_provider: true # Auto update Trådfri devices

  Ikea_provider: http://fw.ota.homesmart.ikea.net/feed/version_info.json`

the firmware file /config/zig-ota/styrbar_dimmer_zingo-0x11cb-2.4.11-prod.ota.ota.signed was downloaded from the official ikea ota web service.

I tried triggering the styrbar with calling its ota cluster with image_notify command. In the logs it just says that no firmware is found compatible with the device or something like that.

Help!

fsievers commented 5 months ago

The above mentioned PR has been superseded by #3175

Nezz commented 3 months ago

FYI: Ikea released a new firmware that should fix many if the issues introduced in 2.4.11: https://www.reddit.com/r/tradfri/comments/1e4lq3f/styrbar_firmware_version_2416/

Sadly the update was not published in the usual place.

MattWestb commented 3 months ago

If configures ZHA OK you shall getting izt then its one of the IKEA feed ZHA is using. All my Styrbars is updated for some week ago without problems and the "old" V2 quirk is working OK with them.

uvok commented 1 month ago

I have an Ikea Styrbar with firmware 0x02040016.

No quirks are applied. Left/right buttons are not reported in the logbook.

Home Assistant OS is @ 2024.10.01.

image

I also had to try pairing the device several times (got stuck in Interview Done. Pairing), also reconfiguring several times, while pressing buttons.

BasJansen commented 1 month ago

@uvok how did you get this firmware, did ha offered it? I have a younger version but also with that one the left and right buttons do not work. Did you get it working already?

uvok commented 1 month ago

@uvok how did you get this firmware, did ha offered it? I have a younger version but also with that one the left and right buttons do not work. Did you get it working already?

I had to manually send an "image_notify" command to the ota cluster, as described in e.g. https://www.thing-king.de/zigbee-geraete-ueber-home-assistant-bzw-zha-updaten-ota-update/ section "OTA-Update manuell triggern".

Basically, open the device page in HA, click the three dots, "manage...", select cluster "ota", go to "tab" commands, select command "image_notify", "QueryJitter", set slider to 100, and click the "send command" button. After that, HA should offer the update.

Mind you, the update took 3 hours for me. Be sure to push a button, e.g. left/right, every few minutes, otherwise the remote might go to sleep and the firmware update might fail. At least that's what others also experienced.

johnkjellberg commented 2 weeks ago

I had the same problem after I upgraded to 0x02040016. I fixed it by deleting my button and then re-pair it. Now all buttons works as expected.