Zigbee devices unavailable after restart

Hi,
After restarting HA, all the zigbee devices (sensors) which are connected to Conbee ii stick, went unavailable.

This is the log:

Logger: homeassistant.components.zha.core.gateway
Source: components/zha/core/gateway.py:170 
Integration: Zigbee Home Automation (documentation, issues) 
First occurred: 9:22:11 PM (4 occurrences) 
Last logged: 9:23:03 PM

Couldn't start deCONZ = dresden elektronik deCONZ protocol: ConBee I/II, RaspBee I/II coordinator
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 456, in wait_for
    return fut.result()
asyncio.exceptions.CancelledError

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

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/zha/core/gateway.py", line 170, in async_initialize
    self.application_controller = await app_controller_cls.new(
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 119, in new
    await app.startup(auto_form=auto_form)
  File "/usr/local/lib/python3.10/site-packages/zigpy/application.py", line 66, in startup
    await self.connect()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/zigbee/application.py", line 91, in connect
    self.version = await api.version()
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/api.py", line 481, in version
    (self._proto_ver,) = await self[NetworkParameter.protocol_version]
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/api.py", line 446, in read_parameter
    r = await self._command(Command.read_parameter, 1 + len(data), param, data)
  File "/usr/local/lib/python3.10/site-packages/zigpy_deconz/api.py", line 331, in _command
    return await asyncio.wait_for(fut, timeout=COMMAND_TIMEOUT)
  File "/usr/local/lib/python3.10/asyncio/tasks.py", line 458, in wait_for
    raise exceptions.TimeoutError() from exc
asyncio.exceptions.TimeoutError

And thatā€™s not the first time that itā€™s happening.

Iā€™m running HA on a VM on Windows 10.

Sometimes the sticks donā€™t close serial ports on reboots, so they donā€™t allow new serial connections .Just unplug the stick and plug it back in.

Iā€™d say write an automation to eject the device from windows, but you still have to unplug and replug to ā€˜un-ejectā€™ for windows to pick up the device again.

If itā€™s a real issue use a powered USB hub, with a smart outlet. And automate resetting the power to the outlet when zigbee fails to initialize.

1 Like

So what is the best solution? Hass generic without vm?

Happens on my HomeAssistant blue sometimes. Happened on my pi too. Even tried different sticks. Just happens occasionally.

If we are talking about restarting HA core, as opposed to rebooting the entire HAOS VM, then this is somewhat expected, since ZHA is part of the HA core.

I would run zigbee2mqtt instead, in an add-on. That way restarting the HA core would not touch the zigbee2mqtt addonā€¦ so your conbee2 stays with the OS and stays with the zigbee2mqtt.

1 Like

I know itā€™s kind of an old topic, but I had the same problem. Running Home Assistant under Windows 11, on a VirtualBox VM. Everytime I need a host reboot, the ZigBee stick became unavailable in Home Assistant, causing ZHA to fail on initialize. After an unplug/replug, everything would be OK. So I created a Task Scheduler task, run on startup, which would run a batch file containing a simple ā€œpnputil /restart /deviceid ā€œhardware id of zigbeee stickā€ā€ elevated command. This would be the software equivalent of an unplug/replug operation. So far I have never encountered the problem.

1 Like