Zigbee with husbzb-1

I’m new to HA and i’m trying to get Zigbee working. I have the HUSZB-1 zwave/zigbee stick. I’m trying to configure zigbee with zha but the system isn’t creating the zigbee.db file. I Created an empty file and pointed the config to it but i get an error regarding opening the dB file. Thoughts?

You probably need to give HA permission to write to it.

Thanks, I"m not sure how to do that. Can you point me to some documentation?

can you post your yaml configuration? might be helpful to troubleshoot

edit: and the associated error from the logs

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

And the error

2018-02-11 16:11:29 ERROR (MainThread) [homeassistant.setup] Error during setup of component zha
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
    result = yield from component.async_setup(hass, processed_config)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/zha/__init__.py", line 101, in async_setup
    APPLICATION_CONTROLLER = ControllerApplication(radio, database)
  File "/usr/lib/python3.6/site-packages/bellows/zigbee/application.py", line 21, in __init__
  File "/usr/lib/python3.6/site-packages/zigpy/application.py", line 26, in __init__
    self._dblistener = zigpy.appdb.PersistingListener(database_file, self)
  File "/usr/lib/python3.6/site-packages/zigpy/appdb.py", line 29, in __init__
sqlite3.OperationalError: unable to open database file

I got it working. I have HA running in a docker container, i had to create the homeassistant home folder along with the .homeassistant folder. Not sure if i just didnt install it correctly, but it’s working now. Thanks

@kceleslie Were you able to connect zigbee sensor with it? I am using the same stick and Xiaomi Temperature and Water leak sensor but it does not seem to work. Any tips / comments is highly appreciated.

Yep, it works. I have to basically recreate the zigbee.db folder everytime i upgrade, but i’ve documented steps on how to do that. I’d suggest looking at your log folder to see what the error is

@kceleslie I don’t not get any errors in log. zigbee.db is present there with some sensor information in database but none of the sensors showed up.

Below is what I have in my configuration file:

usb_path: /dev/ttyUSB0

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

Do I need to anything else besides adding above lines in config files? I mean explicitly setting up individual sensor?
I am using Xiaomi Zigbee Sensors. Are you using same?

That’s it, that’s what i have in my config file.

My zigbee device is a lightbulb, not a Xiaomi.

Once you have zha configured, you need to then call the zha.pemrit service to have it pair with your sensor. I’m not sure what you need to do on the sensor side to pair it.

Good luck

1 Like

Looks like Xiaomi is using some custom protocol and because of that those sensor won’t work with HA. Anyways thank you for getting back to me promptly.