core: ZHA unable to start on HA restart or host reboot

Home Assistant release with the issue:

0.92.2

Last working Home Assistant release (if known): not known

Operating environment (Hass.io/Docker/Windows/etc.):

hassio - Supervisor 162 - on Ubuntu 18.04.2 LTS Component/platform:

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

Description of problem:

Upon restarting Home Assistant, zha start up will throw the following error:

Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/config_entries.py", line 309, in async_setup
    hass, self)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/zha/__init__.py", line 99, in async_setup_entry
    await zha_gateway.async_initialize(config_entry)
  File "/usr/local/lib/python3.7/site-packages/homeassistant/components/zha/core/gateway.py", line 90, in async_initialize
    await self.application_controller.startup(auto_form=True)
  File "/usr/local/lib/python3.7/site-packages/bellows/zigbee/application.py", line 102, in startup
    await self.initialize()
  File "/usr/local/lib/python3.7/site-packages/bellows/zigbee/application.py", line 53, in initialize
    await e.reset()
  File "/usr/local/lib/python3.7/site-packages/bellows/ezsp.py", line 54, in reset
    await self._gw.reset()
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 423, in wait_for
    raise futures.TimeoutError()
concurrent.futures._base.TimeoutError

If I remove the zha integration from the integrations config, restart HA, and then re-add the zha integration, it works as expected.

This is with a HUSBZB1 which is reliably at /dev/ttyUSB1 with no udev rules.

I think this is the same issue kerner is having and has been discussed on discord. also has popped up on the forums as well, so not isolated: https://community.home-assistant.io/t/zha-usb-stick-wont-configure-on-boot-sometimes/115211

https://community.home-assistant.io/t/zha-91-1-errors-in-logs/109962

https://community.home-assistant.io/t/pretty-please-help-with-zha-and-nortek-husbzb-1-z-wave-zigbee-usb-adapter/112534

Problem-relevant configuration.yaml entries and (fill out even if it seems unimportant):


ZHA Integration

Traceback (if applicable):


Additional information:

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 103 (67 by maintainers)

Most upvoted comments

Hmm think I found the problem causing the problem for me. I disabled the ModemManager service in debian.

systemctl stop ModemManager.service systemctl disable ModemManager.service

I removed modem manager on my Ubuntu host with

sudo apt-get purge modemmanager

Restarted and zha was working as expected now! Thank you! I’m remote but will test a bit more - but hopefully this solves this issue.

Yup, works for me between restarts of home assistant and when I reboot the host.

Noticed that the ttyACM device was hogged by “ModemMana” between restarts using the lsof command:

root@hass:~# lsof | grep ttyACM1 ModemMana 357 root 11u CHR 166,1 0t0 9937 /dev/ttyACM1 gmain 357 366 root 11u CHR 166,1 0t0 9937 /dev/ttyACM1 gdbus 357 373 root 11u CHR 166,1 0t0 9937 /dev/ttyACM1

Perhaps this solve the problem for others as well?

yea I got it.

I ran this per the docker install page:

docker run --init -d --name="home-assistant" -v /usr/share/hassio/homeassistant:/config    -v /etc/localtime:/etc/localtime:ro --device /dev/ttyUSB0:/dev/ttyUSB0 --device /dev/ttyUSB1:/dev/ttyUSB1   --net=host homeassistant/homeassistant

so now i’m going to run this:

docker run --init -d --name="home-assistant-test" -v /usr/share/hassio/homeassistant:/config    -v /etc/localtime:/etc/localtime:ro --device /dev/ttyUSB0:/dev/ttyUSB0 --device /dev/ttyUSB1:/dev/ttyUSB1   --net=host homeassistant/qemux86-64-homeassistant