ZHA/zigbee fails to load (all of a sudden?)

After restarting home assistant for an unrelated issue, all zigbee devices failed to appear. Upon further investigation, I discovered this error in the logs. I updated the zigbee stick firmware, no luck. I updated home assistant from 115.1 to 115.2 noticing that in this one there was an update to zigpy, no luck.

I even tried to delete the zigbee configuration as I see now it’s loaded from the integrations page as opposed to from configuration.yaml, but I can’t even delete it! A similar error appears in the logs.

I deleted the entire directory and reinstalled home assistant core from scratch, no luck. Any help on troubleshooting is appreciated. Thanks!

EDIT: Downgrading to 0.114.3 appears to work fine. The strange part is, however, I was on 0.115.1 for few days and had no issues, hence the “all of a sudden” feeling.

Home Assistant Core: 0.115.1 & 0.115.2
Python: 3.8.6
Pip: 20.1.1
Debian: bullseye/sid
Stick: Norteck HUSBZB-1 USB Hub (with updated zigbee firmware 6.6.3)

Relevant configuration.yaml:

zha:
  usb_path: /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C0F009A2-if01-port0
  database_path: /home/hass/homeassistant/zigbee.db

Error from logs:

2020-09-29 13:31:12 ERROR (MainThread) [homeassistant.setup] Setup failed for zha: unknown error
Traceback (most recent call last):
  File "/home/hass/hass/lib/python3.8/site-packages/homeassistant/setup.py", line 166, in _async_setup_component
    component = integration.get_component()
  File "/home/hass/hass/lib/python3.8/site-packages/homeassistant/loader.py", line 393, in get_component
    cache[self.domain] = importlib.import_module(self.pkg_path)
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/hass/hass/lib/python3.8/site-packages/homeassistant/components/zha/__init__.py", line 7, in <module>
    from zigpy.config import CONF_DEVICE, CONF_DEVICE_PATH
  File "/home/hass/hass/lib/python3.8/site-packages/zigpy/config/__init__.py", line 5, in <module>
    from zigpy.config.defaults import (
  File "/home/hass/hass/lib/python3.8/site-packages/zigpy/config/defaults.py", line 1, in <module>
    import zigpy.types as t
  File "/home/hass/hass/lib/python3.8/site-packages/zigpy/types/__init__.py", line 2, in <module>
    from .named import *  # noqa: F401,F403
  File "/home/hass/hass/lib/python3.8/site-packages/zigpy/types/named.py", line 53, in <module>
    class Channels(basic.bitmap32):
  File "/usr/lib/python3.8/enum.py", line 215, in __new__
    enum_member = __new__(enum_class)
TypeError: object.__new__(Channels) is not safe, use int.__new__()

I’m not having the same symptoms, but do have issues post 114.3… trying to nail down what has changed.

I solved mine by deleting the zigbee.db file and reinstalling the ZHA integration. :expressionless:

I just tried deleting that plus reinstalling ZHA integration - no change unfortunately. Glad your issue is fixed though :smiley: - but I think it was definitely unrelated to these problems

1 Like

I opened an issue on github, figuring it may be a bug. It looks like they closed the issue with a possible fix. So hopefully it passes tests and will be in 0.115.7 or 0.116 - hopefully :slight_smile:

I think I’m in the same boat. The zwave is working on my HUSBZB-1 but the zigbee stopped. Deleting the ZHA integration and reinstalling didn’t work. Deleting zigbee.db didn’t work. It is not communicating with the radio and pulls up the radio selection dialog. Ultimately it reports “Failed to connect”. Log section posted below for advice if this is the same issue.

2020-11-08 16:38:46 WARNING (MainThread) [zigpy_znp.zigbee.application] Failed to probe ZNP radio with config {'path': '/dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C1300596-if00-port0', 'flow_control': None, 'baudrate': 115200}
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zigpy_znp/zigbee/application.py", line 142, in probe
    await znp.connect()
  File "/usr/local/lib/python3.8/site-packages/zigpy_znp/api.py", line 236, in connect
    version = await self.request(c.SYS.Version.Req())
  File "/usr/local/lib/python3.8/site-packages/zigpy_znp/api.py", line 520, in request
    response = await response_future
asyncio.exceptions.CancelledError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/zigpy_znp/zigbee/application.py", line 142, in probe
    await znp.connect()
  File "/usr/local/lib/python3.8/site-packages/async_timeout/__init__.py", line 55, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.8/site-packages/async_timeout/__init__.py", line 92, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError
2020-11-08 16:38:51 WARNING (MainThread) [zigpy_deconz.api] No response to 'Command.device_state' command with seq id '0x02'
2020-11-08 16:38:55 WARNING (MainThread) [zigpy_xbee.api] at: No response to AP command
2020-11-08 16:38:58 WARNING (MainThread) [zigpy_cc.api] No response for: SRSP SYS version {}