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
72.13k stars 30.18k forks source link

ZHA not starting on HA Yellow (EZSP) #99774

Closed ghost closed 1 year ago

ghost commented 1 year ago

The problem

After updating to 2023.9 ZHA doesn't start anymore on HA Yellow (EZSP firmware). Restarting and powercycling the host did not solve the issue.

What version of Home Assistant Core has the issue?

core-2023.9

What was the last working version of Home Assistant Core?

core-2023.8.x

What type of installation are you running?

Home Assistant OS

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-09-06T20-57-54.154Z.log

Example YAML snippet

No response

Anything in the logs that might be useful for us?

Logger: homeassistant.config_entries
Source: components/zha/repairs.py:81
First occurred: 22:57:35 (1 occurrences)
Last logged: 22:57:35

Error setting up entry Yellow for zha
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/__init__.py", line 146, in async_setup_entry
    await repairs.warn_on_wrong_silabs_firmware(
  File "/usr/src/homeassistant/homeassistant/components/zha/repairs.py", line 94, in warn_on_wrong_silabs_firmware
    app_type = await probe_silabs_firmware_type(device)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/repairs.py", line 81, in probe_silabs_firmware_type
    await flasher.probe_app_type()
  File "/usr/local/lib/python3.11/site-packages/universal_silabs_flasher/flasher.py", line 229, in probe_app_type
    result = await probe_funcs[probe_method](baudrate=baudrate)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/universal_silabs_flasher/flasher.py", line 177, in probe_spinel
    version = await spinel.probe()
              ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/universal_silabs_flasher/spinel.py", line 243, in probe
    rsp = await self.send_command(
          ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/universal_silabs_flasher/spinel.py", line 240, in send_command
    return await self.send_frame(frame, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/universal_silabs_flasher/spinel.py", line 208, in send_frame
    return await asyncio.shield(future)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
asyncio.exceptions.CancelledError: aiohttp connection lost

Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:226
Integration: Zigbee Home Automation (documentation, issues)
First occurred: 22:57:10 (2 occurrences)
Last logged: 22:57:15

Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 2 of 3)
Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 3 of 3)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 68, in command
    return await future
           ^^^^^^^^^^^^
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 197, in startup
    await self.connect()
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 141, in connect
    await ezsp.startup_reset()
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 161, in startup_reset
    await self.version()
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 189, in version
    ver, stack_type, stack_version = await self._command(
                                     ^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/protocol.py", line 67, in command
    async with asyncio_timeout(EZSP_CMD_TIMEOUT):
  File "/usr/local/lib/python3.11/asyncio/timeouts.py", line 111, in __aexit__
    raise TimeoutError from exc_val
TimeoutError

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 226, in async_initialize
    await self.application_controller.startup(auto_form=True)
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 201, in startup
    await self.shutdown()
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 406, in shutdown
    await self._dblistener.shutdown()
  File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 187, in shutdown
    await self._set_isolation_level(None)
  File "/usr/local/lib/python3.11/site-packages/zigpy/appdb.py", line 205, in _set_isolation_level
    await self._db._execute(lambda: setattr(self._db, "isolation_level", level))
  File "/usr/local/lib/python3.11/site-packages/aiosqlite/core.py", line 126, in _execute
    raise ValueError("Connection closed")
ValueError: Connection closed

Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:226
Integration: Zigbee Home Automation (documentation, issues)
First occurred: 22:57:00 (1 occurrences)
Last logged: 22:57:00

Couldn't start EZSP = Silicon Labs EmberZNet protocol: Elelabs, HUSBZB-1, Telegesis coordinator (attempt 1 of 3)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 226, in async_initialize
    await self.application_controller.startup(auto_form=True)
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 197, in startup
    await self.connect()
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 141, in connect
    await ezsp.startup_reset()
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 159, in startup_reset
    await self.reset()
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 185, in reset
    await self._gw.reset()
TimeoutError

Additional information

No response

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)

lafriks commented 1 year ago

Having same error on Home Assistant Blue + SkyConnect.

Before that there is error:

Couldn't start application

Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/zigpy/application.py", line 197, in startup
    await self.connect()
  File "/usr/local/lib/python3.11/site-packages/bellows/zigbee/application.py", line 141, in connect
    await ezsp.startup_reset()
  File "/usr/local/lib/python3.11/site-packages/bellows/ezsp/__init__.py", line 151, in startup_reset
    await self._gw.wait_for_startup_reset()
  File "/usr/local/lib/python3.11/site-packages/bellows/uart.py", line 175, in wait_for_startup_reset
    await self._startup_reset_future
ConnectionResetError: Remote server closed connection
lafriks commented 1 year ago

Looks like hard reboot did fix things

ghost commented 1 year ago

Updating the Zigbee radio firmware with the Silicon Labs Flasher add-on seems to solve the problem.

gitaroomaan commented 1 year ago

I'm having a similar issue with my Sky Connect device and my docker setup. Restarting both the container and the host didn't resolve the issue, nor was there a firmware update available when I checked. Rolling back to 2023.8.4 solve the issue for the time being.