HUSBZB-1 zha Problem

I want to use ZigBee using “HUSBZB-1”.
“Z-Wave” is registered and available normally.
However, ZigBee tried to register as “zha,” but an error occurs.
The settings I have made to register it are as follows.

#############################################
#############################################

Zwave

#############################################
#############################################

zwave :
usb_path: /dev/ttyUSB1

#############################################
#############################################

Zigbee

#############################################
#############################################

zha :
usb_path : /dev/zigbee
database_path : /config/zigbee.db

I have referenced the following link to register this.

http://techdout.blogspot.com/2018/03/z-wave-zigbee-usb-stick-on-home.html

I think that’s the right setting.
However, “HA” generates an error message.

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

Can you help me with this?

YAML is very picky about formatting. Try indenting the code by putting two white spaces before the usb_path and the database_path.
Click on ‘Check Config’ in Configuration > General. If it says valid then reboot.

@PCRx

I’m sorry.
I’m not used to writing, so I don’t know how to express a blank space.
In fact, the YAML file has two spaces in front of it and there was nothing wrong with pressing ‘Check Config’.
When I first registered, I registered a zha command to “Service,” but after I tried to add Xiaomi Motion Sensor I couldn’t use zha since an error occurred.

zha

Does the zigbee.db file already exist in your configuration directory?

If not you need to create an empty file and make sure the permissions are set so that HA user can read/write on it.

What is the output of this command:

ls /dev/ttyUSB*

and also this command:

ls /dev/z*

@PCRx

When using this command, the following results are obtained:

pi@hassbian:~ $ ls /dev/ttyUSB0
/dev/ttyUSB0
pi@hassbian:~ $ ls /dev/ttyUSB1
/dev/ttyUSB1
pi@hassbian:~ $ ls /dev/zwave
/dev/zwave
pi@hassbian:~ $ ls /dev/zigbee
/dev/zigbee

I’m not familiar with Linux so I don’t know the meaning of this command.
Can you tell me the meaning of this command?

I think we’ve found a solution to this error.
I could find the answer in Finity’s answer.
‘Zigbee.db’ seems to have a problem with only reading rights.

@finity

Thank you.
I was able to find the answer in your answer.
I added permission because the file ‘Zigbee.db’ is read only and I have verified that the error is missing.
Sorry, but can you tell me how to add the Zigbee device?

the ls command is basically a list command. if you use it as directed above with the asterisk (*) it should list all of the devices that contain that information.

to add a device you need to call the zha.permit service then do whatever the manufacturer tells you to include that device. You have 60 seconds to add the device once you call the zha.permit service.

@finity

Thank you.
Thanks to you, I’ve had a satisfactory result.

2 Likes