home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
71.06k stars 29.72k forks source link

Error setting up entry Sonoff Zigbee 3.0 USB Dongle Plus #89261

Closed sideonshore closed 1 year ago

sideonshore commented 1 year ago

The problem

Im using a Sonoff Zigbee 3.0 USB Dongle Plus in a Synology via Docker, which worked great for the last month. I recently updated hs to 2023.3.1, which also worked without any issues. Today i had to restart the synology as well as all docker containers. Unfortunately zha wont start anymore and i get the following errors:

Logger: homeassistant.config_entries Source: components/zha/core/gateway.py:185 First occurred: 21:58:44 (2 occurrences) Last logged: 22:10:46

Error setting up entry Sonoff Zigbee 3.0 USB Dongle Plus - Sonoff Zigbee 3.0 USB Dongle Plus for zha Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 229, in load_network_info await self._load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 112, in _load_network_info and await self.nvram.osal_read( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/nvram.py", line 171, in osal_read raise KeyError(f"NV item does not exist: {nv_id!r}") KeyError: 'NV item does not exist: <OsalNvIds.BDBNODEISONANETWORK: 85>'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 91, in initialize await self.load_network_info(load_devices=False) File "/usr/local/lib/python3.10/site-packages/zigpy_znp/zigbee/application.py", line 160, in load_network_info await self._znp.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 231, in load_network_info raise NetworkNotFormed() from e zigpy.exceptions.NetworkNotFormed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 383, in async_setup result = await component.async_setup_entry(hass, self) File "/usr/src/homeassistant/homeassistant/components/zha/init.py", line 112, in async_setup_entry await zha_gateway.async_initialize() File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 200, in async_initialize raise exc File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 185, in async_initialize self.application_controller = await app_controller_cls.new( File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 171, in new await app.startup(auto_form=auto_form) File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 146, in startup await self.initialize(auto_form=auto_form) File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 104, in initialize await self.backups.restore_backup(last_backup) File "/usr/local/lib/python3.10/site-packages/zigpy/backups.py", line 156, in restore_backup await self.app.write_network_info( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/zigbee/application.py", line 187, in write_network_info await self._znp.write_network_info( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 348, in write_network_info await self.reset_network_info() File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 330, in reset_network_info await self.nvram.osal_write( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/nvram.py", line 139, in osal_write await self.znp.request( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 1011, in request raise InvalidCommandResponse( zigpy_znp.exceptions.InvalidCommandResponse: Expected SRSP response SYS.OSALNVWriteExt.Rsp(Status=<Status.SUCCESS: 0>), got SYS.OSALNVWriteExt.Rsp(Status=<Status.NV_OPER_FAILED: 10>)

And this:

Logger: homeassistant.components.zha.core.gateway Source: components/zha/core/gateway.py:185 Integration: Zigbee Home Automation (documentation, issues) First occurred: 21:58:32 (6 occurrences) Last logged: 22:10:46

Couldn't start ZNP = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2 coordinator (attempt 1 of 3) Couldn't start ZNP = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2 coordinator (attempt 2 of 3) Couldn't start ZNP = Texas Instruments Z-Stack ZNP protocol: CC253x, CC26x2, CC13x2 coordinator (attempt 3 of 3) Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 229, in load_network_info await self._load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 112, in _load_network_info and await self.nvram.osal_read( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/nvram.py", line 171, in osal_read raise KeyError(f"NV item does not exist: {nv_id!r}") KeyError: 'NV item does not exist: <OsalNvIds.BDBNODEISONANETWORK: 85>'

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 91, in initialize await self.load_network_info(load_devices=False) File "/usr/local/lib/python3.10/site-packages/zigpy_znp/zigbee/application.py", line 160, in load_network_info await self._znp.load_network_info(load_devices=load_devices) File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 231, in load_network_info raise NetworkNotFormed() from e zigpy.exceptions.NetworkNotFormed

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 185, in async_initialize self.application_controller = await app_controller_cls.new( File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 171, in new await app.startup(auto_form=auto_form) File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 146, in startup await self.initialize(auto_form=auto_form) File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 104, in initialize await self.backups.restore_backup(last_backup) File "/usr/local/lib/python3.10/site-packages/zigpy/backups.py", line 156, in restore_backup await self.app.write_network_info( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/zigbee/application.py", line 187, in write_network_info await self._znp.write_network_info( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 348, in write_network_info await self.reset_network_info() File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 330, in reset_network_info await self.nvram.osal_write( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/nvram.py", line 139, in osal_write await self.znp.request( File "/usr/local/lib/python3.10/site-packages/zigpy_znp/api.py", line 1011, in request raise InvalidCommandResponse( zigpy_znp.exceptions.InvalidCommandResponse: Expected SRSP response SYS.OSALNVWriteExt.Rsp(Status=<Status.SUCCESS: 0>), got SYS.OSALNVWriteExt.Rsp(Status=<Status.NV_OPER_FAILED: 10>)

I tried the following without any success:

Any hints?

What version of Home Assistant Core has the issue?

2023.3.1

What was the last working version of Home Assistant Core?

2023.3.1

What type of installation are you running?

Home Assistant Container

Integration causing the issue

zha

Link to integration documentation on our website

https://www.home-assistant.io/integrations/zha/

Diagnostics information

home-assistant_zha_2023-03-06T21-10-31.733Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

im using the sonoff stick with an usb extension cable as suggested, because of usb 3.0 inteferences

home-assistant[bot] commented 1 year ago

Hey there @dmulcahey, @adminiuga, @puddly, 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.

(message by CodeOwnersMention)


zha documentation zha source (message by IssueLinks)

puddly commented 1 year ago

This unfortunately is a well-known NVRAM corruption issue with the Sonoff Zigbee stick. To fix it, you need to re-flash the firmware (which erases NVRAM in the process). This won't affect your network at all, as a backup will be restored when you next start ZHA with the erased stick.

sideonshore commented 1 year ago

Thanks a lot puddly! Re-flashed the firmware and everything works again. For anyone who hast similar problems, and needs to re-flash the firmware of the dongle: