Unable to load ZHA

Dear Group members,

I am newbie with Home Assistant trying to setup ZigBee Home Automation. I did try adding the following entries into configuration.yaml file:

zha:
usb_path: /dev/ttyUSB1
database_path: /home/homeassistant/.homeassistant/zigbee.db

And still see error loading the zha service or component. Could you please help me solve this?

I am using a Nortek HUSBZB-1 ZWave ZigBee USB stick to control the ZigBee device
Raspberry pi 3 Model B+ running Hass IO

Error Logs:

Mon Aug 06 2018 14:10:17 GMT-0700 (Pacific Daylight Time)

Error during setup of component zha
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/setup.py”, line 143, in _async_setup_component
hass, processed_config)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/zha/init.py”, line 104, in async_setup
APPLICATION_CONTROLLER = ControllerApplication(radio, database)
File “/usr/local/lib/python3.6/site-packages/bellows/zigbee/application.py”, line 21, in init
super().init(database_file=database_file)
File “/usr/local/lib/python3.6/site-packages/zigpy/application.py”, line 23, in init
self._dblistener = zigpy.appdb.PersistingListener(database_file, self)
File “/usr/local/lib/python3.6/site-packages/zigpy/appdb.py”, line 30, in init
detect_types=sqlite3.PARSE_DECLTYPES)
sqlite3.OperationalError: unable to open database file

who is the owner of the zigbee.db file and does that file exist in that location?

I think I remember having to create a blank file and then change the owner of the file to the homeassistant user when I first installed zha.

1 Like

Dear Finity,

Thanks for notifying me that the file may not be present. I checked the location and the file actually DIDN’T exist.

I tried to create a blank file using VI editor on the Raspberry pi itself, but it seems the “file system is read-only”. Did you remember if you had any similar issues while creating zigbee.db file? Did you use the HomeAssistant GUI or the Raspberry pi command line to create it? Sorry for too many questions, I have hard time bringing up ZHA component since I am new to all this.

Thanks,
Vinay

I’m sure I used the command line to create it.

Then I had to change the owner to the homeassistant user so that home assistant can write to it.