I have Home Assistant 0.96.2 running in a docker image, and am trying to get my HUSBZB-1 stick set up. I have z-wave working fine from /dev/ttyUSB0, and am seeking to set up Zigbee control.
In my configuration.yaml I have:
zwave:
usb_path: /dev/ttyUSB0
network_key: <removed>
zha:
usb_path: /dev/ttyUSB1
database_path: /srv/homeautomation/hass-config/zigbee.db
Z-wave works fine, but the ZHA does not. If I go to Configuration (on the main Lovelace screen), I can click ZHA to add devices. If I click Add Devices it scans but never finds any of my devices (which I admit I do not know whether or not are working). If I try to call the service “zha.permit” the service does not exist and no zha* services appear in the dropdown. When I check “Developer Tools” there is an error entry that is generated during startup of HA:
Error setting up entry /dev/ttyUSB1 for zha
7:50 PM components/zha/core/gateway.py (ERROR)
When I click this error, the log details are the following:
Error setting up entry /dev/ttyUSB1 for zha
Traceback (most recent call last):
File "/usr/src/app/homeassistant/config_entries.py", line 153, in async_setup
hass, self)
File "/usr/src/app/homeassistant/components/zha/__init__.py", line 94, in async_setup_entry
await zha_gateway.async_initialize()
File "/usr/src/app/homeassistant/components/zha/core/gateway.py", line 89, in async_initialize
radio, database)
File "/usr/local/lib/python3.7/site-packages/bellows/zigbee/application.py", line 34, in __init__
super().__init__(database_file=database_file)
File "/usr/local/lib/python3.7/site-packages/zigpy/application.py", line 26, in __init__
self._dblistener = zigpy.appdb.PersistingListener(database_file, self)
File "/usr/local/lib/python3.7/site-packages/zigpy/appdb.py", line 34, in __init__
detect_types=sqlite3.PARSE_DECLTYPES)
sqlite3.OperationalError: unable to open database file
At first I thought there may be a problem because I only had a /usr/local/lib/python3.6/ folder, but I installed python 3.7 and now have a /python3.7 folder, but this changed nothing.
This makes me think it is unable to access zigbee.db, which is not automatically created. So I ran “> zigbee.db” to create a file and used “chmod a-rwx” to make sure everyone can access that file just to be safe. Restarting HA yields the same error. I’ve also tried creating zigbee.db using the text editor and saving a file with that name, and then right-clicking that file and giving everyone read+write access. No luck. Maybe I need to install sqlite and manually create a blank .db file?
Running “ls -l /dev/serial/by-id/" confirms that the device "/dev/serial/by-id/usb-Silicon-Labs_HubZ_Smart_Home_Controller-612011F2-if0-port0” corresponds to …/…/ttyUSB*, for USB0 and USB1. As ttyUSB0 works for Z-wave, I am assuming I should be sticking to ttyUSB1 for ZHA.
I’m lost. I’m not sure where to go from here.