core icon indicating copy to clipboard operation
core copied to clipboard

ZHA - New 'Firmware update' feature not working (on IKEA device)

Open marcelkous opened this issue 1 year ago • 5 comments

The problem

The ZHA notified me of a firmware update of an IKEA TRADFRI Signal Repeater. Greenshot 2024-02-09 13 05 16

When pressing the install button the upd Greenshot 2024-02-09 12 26 04 ate process starts.

After several minutes the update is finished and it shows as Up-to-date. Greenshot 2024-02-09 12 26 01

But a few minutes later it is detected again as an older version.

Greenshot 2024-02-09 12 25 55

I have tried to update several times, but every time, I have the same result... It finishes, says Up-to-date, and then comes back. I have even changed my wifi configuration so it doesn't use WiFi 2.4 channel 1 because that overlaps with Zigbee Channel 11 (that's where I'm at), and tried again. (I saw a log entry about this, but never had any issues with ZHA)

What version of Home Assistant Core has the issue?

2024.2.1

What was the last working version of Home Assistant Core?

n/a

What type of installation are you running?

Home Assistant OS

Integration causing the issue

ZHA

Link to integration documentation on our website

No response

Diagnostics information

config_entry-zha-094c7a58bd164d31a32dba53f35bc488.json

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: zigpy.application
Source: components/zha/core/gateway.py:214
First occurred: 1:21:01 PM (2 occurrences)
Last logged: 1:21:01 PM

Zigbee channel 11 utilization is 89.94%!
If you are having problems joining new devices, are missing sensor updates, or have issues keeping devices joined, ensure your coordinator is away from interference sources such as USB 3.0 devices, SSDs, WiFi routers, etc.


********* WiFi Config changed after this ***********
Wifi APs do not use channel 1 any more.

Additional information

No response

marcelkous avatar Feb 09 '24 13:02 marcelkous

Hey there @dmulcahey, @adminiuga, @puddly, @thejulianjes, mind taking a look at this issue as it has been labeled with an integration (zha) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of zha can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign zha Removes the current integration label and assignees on the issue, add the integration domain after the command.
  • @home-assistant add-label needs-more-information Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue.
  • @home-assistant remove-label needs-more-information Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

home-assistant[bot] avatar Feb 10 '24 20:02 home-assistant[bot]

I have also problems updating my IKEA stuff. I can provide as much documentation as you need. Your support would be highly appreciated!

sven-debug avatar Feb 13 '24 08:02 sven-debug

Seeing something similar here, if useful I can also gather some more information.

image

pixelspark avatar Feb 18 '24 08:02 pixelspark

Same here.

image

Logs:

Source: components/websocket_api/commands.py:240
Integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 12:29:31 (1 occurrences)
Last logged: 12:29:31

[546629601728] Update was not successful - result: <Status.FAILURE: 1>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 240, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2279, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2316, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 892, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 962, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 161, in async_install
    await entity.async_install_with_progress(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 465, in async_install_with_progress
    await self.async_install(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/zha/update.py", line 177, in async_install
    raise HomeAssistantError(f"Update was not successful - result: {results}")
homeassistant.exceptions.HomeAssistantError: Update was not successful - result: <Status.FAILURE: 1>

r0bb10 avatar Feb 18 '24 11:02 r0bb10

Seeing something similar here, if useful I can also gather some more information.

image

For me, this can usually be fixed by clicking a button directly after hitting the "Install" (for walking up battery powered devices). It fails later at random percentages though.

johnkjellberg avatar Feb 25 '24 18:02 johnkjellberg

I have the same issue with some switches from NodOn). Reminder keeps popping up but each time got an error from update service.

Kriss1670 avatar Mar 18 '24 17:03 Kriss1670

I got it working now by keeping the IKEA button at a couple of meters away from my IKEA lamp and do the upgrade. If I keep it very close to the lamp it doesn't work, and keeping it close to the Zigbee dongle doesn't work either.

johnkjellberg avatar Mar 18 '24 20:03 johnkjellberg

image

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:239
integration: Home Assistant WebSocket API ([documentation](https://www.home-assistant.io/integrations/websocket_api), [issues](https://github.com/home-assistant/core/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+websocket_api%22))
First occurred: 09:31:29 (2 occurrences)
Last logged: 09:35:28

[547955906496] Update was not successful: <Status.FAILURE: 1>
[547862043456] Update was not successful: <Status.FAILURE: 1>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2319, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2356, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 905, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 975, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 161, in async_install
    await entity.async_install_with_progress(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 465, in async_install_with_progress
    await self.async_install(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/zha/update.py", line 198, in async_install
    raise HomeAssistantError(f"Update was not successful: {result}")
homeassistant.exceptions.HomeAssistantError: Update was not successful: <Status.FAILURE: 1>

No way it works :(

home-assistant_zha_2024-03-20T08-35-41.521Z.log

r0bb10 avatar Mar 20 '24 08:03 r0bb10

Suffering the same here. A notification of a Styrbar (Ikea N2) is shown at the main control panel, but after progressing at a speed around one percent every 5 minutes, it fails at above 15 or 16 percent.

I must add, I successfully upgraded another Stybar switches in past issuing an image_notify Zigbee command from the Zigbee configuration panel of the device, in Home Assistant. But now even such hardcore method seems to fail.

jjaammhh avatar Mar 24 '24 16:03 jjaammhh

If your update fails part way through, please enable ZHA debug logging before starting the update, let it run, then disable debug logging after it fails. Upload the debug log here. You may need to zip it first if it's too big.

puddly avatar Mar 24 '24 16:03 puddly

Thanks for your interest. Attached is my log 2024-03-24 175124.378 DEBUG (MainTh.log.zip And now an extended one home-assistant_zha_2024-03-24T16-56-00.794Z.zip

jjaammhh avatar Mar 24 '24 16:03 jjaammhh

For me, this can usually be fixed by clicking a button directly after hitting the "Install" (for walking up battery powered devices). It fails later at random percentages though.

Thank you for this! Can confirm that I was able to update my TRADFRI open/close remote by clicking the button on the remote during install. Previously it resulted in "<Status: FAILURE: 1>". The update took some time but the notification has finally disappeared

marcinwasilewski avatar Mar 30 '24 10:03 marcinwasilewski

Hitting the button also worked for me! Update still running ;) Without, my logs looked liked the ones from @jjaammhh

tuct avatar Mar 30 '24 22:03 tuct

Just updated an Tradfri Motion sensor with continuous motion while updating....worked for me... Report for an Shorcut button will come today evening.

HannesVo avatar Apr 02 '24 09:04 HannesVo

My device isn't battery-powered. So I don't have to wake it up... image

It starts, it finishes 'successful' but the, few seconds later just report not updated and I can start from scratch... I'm doing an upgrade right now with debugging enabled...will upload the debug file when 'finished'

home-assistant_zha_2024-04-02T10-06-20.322Z.log.zip

marcelkous avatar Apr 02 '24 10:04 marcelkous

My device isn't battery-powered. So I don't have to wake it up... It starts, it finishes 'successful' but the, few seconds later just report not updated and I can start from scratch... I'm doing an upgrade right now with debugging enabled...will upload the debug file when 'finished'

I would try power cycle it, and wait a couple of hours and/or re-add it to zha.

marcinwasilewski avatar Apr 02 '24 10:04 marcinwasilewski

My device isn't battery-powered. So I don't have to wake it up... It starts, it finishes 'successful' but the, few seconds later just report not updated and I can start from scratch... I'm doing an upgrade right now with debugging enabled...will upload the debug file when 'finished'

I would try power cycle it, and wait a couple of hours and/or re-add it to zha.

Did the power-cycle several times...

Edit: Haven't Tried to re-add yet, can do tonight, no difference.

marcelkous avatar Apr 02 '24 10:04 marcelkous

I have exactly the same problem, with 22 ikea lights. Home assistant 2024.4

pzucchel avatar Apr 05 '24 06:04 pzucchel

zigbee2mqtt also doesn't work for such devices, but I found a workaround:

  1. remove all batteries from zigbee device
  2. insert the battery
  3. with no delay press update
  4. goto 1 on failure

this works for me for zha and zigbee2mqtt

532910 avatar Apr 07 '24 16:04 532910

zigbee2mqtt also doesn't work for such devices, but I found a workaround:

  1. remove all batteries from zigbee device
  2. insert the battery
  3. with no delay press update
  4. goto 1 on failure

this works for me for zha and zigbee2mqtt

Well this would be absolutely stupid, especially if it were to actually work reliably. I cannot really understand why power-cycling the device would even be necessary, but alas, I tried it with an Ikea shortcut button. The result was that the update started, went all the way to 100%, then failed.

By the way, I also tried to check something specific to Ikea devices: I set an alarm on my watch every two minutes to remind me to push the button, thus keeping the device alive. I did notice before, when I started trying to update shortcut buttons, that after I would not give them attention during the update process, it would fail after a few minutes. So I decided to do everything in my power to keep them alive, thinking that Ikea devices are just dumb like that, and can't figure out on their own that they need to keep themselves alive in order to receive an update. The result, however, was the same: it went all the way to 100%, and then reported failure.

The same also applies if I keep them awake from Home Assistant every two minutes.

adimosh avatar Apr 12 '24 09:04 adimosh

@marcelkous I've annotated a portion of your log:

# Device has successfully finished its upgrade to 0x23086631
2024-04-02 12:04:52.587 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Decoded ZCL frame: Ota:upgrade_end(status=<Status.SUCCESS: 0>, manufacturer_code=4476, image_type=4354, file_version=587753009)

# We tell the device to reboot
2024-04-02 12:04:52.591 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Sending reply: upgrade_end_response(manufacturer_code=4476, image_type=4354, file_version=587753009, current_time=0, upgrade_time=0)

# The device does and is back on the network about 5s later
2024-04-02 12:04:57.415 INFO (MainThread) [zigpy.application] Device 0xdd77 (68:0a:e2:ff:fe:ec:4f:b3) joined the network

# We read its current firmware version
2024-04-02 12:05:02.745 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Sending request: Read_Attributes(attribute_ids=[2])

# And the device responds with 0x23070631, the old version!
2024-04-02 12:05:02.942 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Decoded ZCL frame: Ota:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0002, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint32_t, value=587662897))])

What is the device currently showing as its firmware version?

puddly avatar Apr 12 '24 17:04 puddly

@marcelkous I've annotated a portion of your log:

# Device has successfully finished its upgrade to 0x23086631
2024-04-02 12:04:52.587 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Decoded ZCL frame: Ota:upgrade_end(status=<Status.SUCCESS: 0>, manufacturer_code=4476, image_type=4354, file_version=587753009)

# We tell the device to reboot
2024-04-02 12:04:52.591 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Sending reply: upgrade_end_response(manufacturer_code=4476, image_type=4354, file_version=587753009, current_time=0, upgrade_time=0)

# The device does and is back on the network about 5s later
2024-04-02 12:04:57.415 INFO (MainThread) [zigpy.application] Device 0xdd77 (68:0a:e2:ff:fe:ec:4f:b3) joined the network

# We read its current firmware version
2024-04-02 12:05:02.745 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Sending request: Read_Attributes(attribute_ids=[2])

# And the device responds with 0x23070631, the old version!
2024-04-02 12:05:02.942 DEBUG (MainThread) [zigpy.zcl] [0xDD77:1:0x0019] Decoded ZCL frame: Ota:Read_Attributes_rsp(status_records=[ReadAttributeRecord(attrid=0x0002, status=<Status.SUCCESS: 0>, value=TypeValue(type=uint32_t, value=587662897))])

What is the device currently showing as its firmware version?

This is indeed what I also see happening in the GUI. Start upgrade --> Upgrade finished --> restart --> again ready for upgrade (this will loop endlessly) 🤷‍♂️

The current firmware shows:
image

image

I've unplugged the devices, relocated the device (closer to the Zigbee radio module), re-joined the device... nothing did help. I use the SONOFF ZBBridge – Smart Zigbee Bridge (I know it is not recommended but I have had no issue with this WiFi to Zigbee Bridge so far)

marcelkous avatar Apr 17 '24 07:04 marcelkous

Any updates to this? I'm having exactly the same problem with a Tradfri Signal repeater, also going from version 0x23070631 to 0x23086631. I'm running ZHA in Home Assistant Core 2024.4.2.

brgerig avatar Apr 19 '24 17:04 brgerig

Same for my Motion Sensor E1745 var2. Bildschirmfoto 2024-04-19 um 21 02 52 Any solution process or what logs do you need?!

Logger: homeassistant.components.websocket_api.http.connection
Quelle: components/websocket_api/commands.py:239
Integration: Home Assistant WebSocket API (Dokumentation, Probleme)
Erstmals aufgetreten: 14:46:58 (6 Vorkommnisse)
Zuletzt protokolliert: 18:55:53

[140490895667264] Update was not successful: <Status.FAILURE: 1>
[140490786089664] Update was not successful: <Status.FAILURE: 1>
[140490709868736] Update was not successful: <Status.FAILURE: 1>
[140490736952000] Update was not successful: <Status.FAILURE: 1>
[140490738371264] Update was not successful: <Status.FAILURE: 1>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 239, in handle_call_service
    response = await hass.services.async_call(
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2543, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2580, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 971, in entity_service_call
    single_response = await _handle_entity_call(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 1043, in _handle_entity_call
    result = await task
             ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 162, in async_install
    await entity.async_install_with_progress(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/update/__init__.py", line 466, in async_install_with_progress
    await self.async_install(version, backup)
  File "/usr/src/homeassistant/homeassistant/components/zha/update.py", line 196, in async_install
    raise HomeAssistantError(f"Update was not successful: {result}")
homeassistant.exceptions.HomeAssistantError: Update was not successful: <Status.FAILURE: 1>

Jumperm avatar Apr 19 '24 19:04 Jumperm

My Update work after keeping it awake by pressing the button.

Jumperm avatar Apr 20 '24 05:04 Jumperm

My devices do not need to be awake as they are always connected and active (Nodon switches). I switched one of them from ZHA to Z2M and update worked properly. This tends to confirm that the problem is from ZHA, not from the device.

Kriss1670 avatar Apr 20 '24 08:04 Kriss1670

Updates are initiated by the device and the device asks for individual pieces of firmware. It's not driven by ZHA. If an update halts, it is because the device stopped asking for firmware pieces.

Z2M forces you to channel 11 by default, while ZHA generally avoids it. There are many factors beyond the software itself (channel being the main one, though network topology is also important).

puddly avatar Apr 20 '24 09:04 puddly

Thanks for the « under the hood » explanation. From the user point of view, it works under Z2M and doesn’t under ZHA. I will try again.

Kriss1670 avatar Apr 20 '24 10:04 Kriss1670

I have the same problem. Error message: Update was not successful: <Status.FAILURE: 1>

JanNJNS avatar May 29 '24 08:05 JanNJNS

Still the same issue here

coldburn89 avatar Jun 09 '24 19:06 coldburn89