ZHA fails after power off [gave up - uninstalled HA]

Newbie wondering if HA is too complicated for me.
Running a docker compose instance of HA. When the server lost power, I get a ZHA failed to initialize… using a Sonoff zigbee dongle - fairly new. I went to Settings/System and hit Backup figuring I would just rebuild the zigbee integration from scratch (after changing permissions on /dev/ttyACM1 to no effect) so when I hit the create backup button, I got this for Home Assistant Core:

Logger: homeassistant.components.websocket_api.http.connection
Source: components/zha/core/helpers.py:449
integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 2:13:28 PM (1 occurrences)
Last logged: 2:13:28 PM
[548099233856] Error handling message: Unknown error (unknown_error) jim from 192.168.0.3 (Mozilla/5.0 (X11; Linux x86_64; rv:124.0) Gecko/20100101 Firefox/124.0)

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 27, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/backup/websocket.py", line 76, in handle_create
    backup = await manager.generate_backup()
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 199, in generate_backup
    await self.pre_backup_actions()
  File "/usr/src/homeassistant/homeassistant/components/backup/manager.py", line 101, in pre_backup_actions
    raise result
  File "/usr/src/homeassistant/homeassistant/components/zha/backup.py", line 16, in async_pre_backup
    zha_gateway = get_zha_gateway(hass)
                  ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/zha/core/helpers.py", line 449, in get_zha_gateway
    raise ValueError("No gateway object exists")
ValueError: No gateway object exists

(I’ve probably got more problems than just restarting ZHA…)

I’ve also been googling how to delete this and start over, but so far haven’t been able to find a solution. I’ve deleted zigbee.db from /config but it just recreates it when doing a restart. I don’t have any reference to zha in configuration.yaml or other yaml that I’ve been able to find. Don’t have a /storage directory. sheesh.

Where to start to fix this? thanks!

Started over re-installing HA by deleting the homeassistant directory after shutting it off in portainer. I had a mosquitto container that I installed earlier but wasn’t using because of ZHA… maybe that was creating a problem though I had it shut off. Deleted that directory and any reference in the yamls. Things are working again… perhaps a good exercise to pound some of this stuff into my old head.

I am not using Home Assistant on Docker but I do not think that it recommended to map “/dev/ttyACM1” as that can change on reboot or when add other devices, it is instead generall recommnend to map your dongle by serial/by-id (e.g. /dev/serial/by-id/usb-ITead_Sonoff_Zigbee_3.0_USB_Dongle_Plus_[REDACTED]-if00-port0) if possible. See ZHA docs:

https://www.home-assistant.io/integrations/zha#configuration—gui

" Most devices need at the very least the serial device path, like /dev/ttyUSB0 , but it is recommended to use device path from /dev/serial/by-id folder, e.g., /dev/serial/by-id/usb-Silicon_Labs_HubZ_Smart_Home_Controller_C0F003D3-if01-port0 A list of available device paths can be found in Settings > System > Hardware > dot menu > All Hardware"

Also see related troubleshooting tip regarding using Docker Compose:

https://www.home-assistant.io/integrations/zha#cant-connect-to-usb-device-and-using-docker

Better to run “Home Assistant Operating System” (Home Assistant OS) in either a virtual machine or on bare-metal instead for the best experience as it I think that it is Docker installations that makes it unnecessarily complicated. Home Assistant OS makes it as easy to maintain an any smart hub appliance

1 Like