[HELP] Zigbee invalid config with Linear HUSBZB-1

Hello, I got a Linear husbzb-1 for my fresh installed Home assistant on a Raspberry Pi 3 with Stretch.
I managed somehow to have the Zwave started (or at least I think, as I see this https://imgur.com/BC0yDQz)
for some reason I am getting an error with the Zigbee component, here is the log error:
Log Details (ERROR)
Fri Jul 20 2018 13:24:14 GMT-0400 (Eastern Daylight Time)

Error during setup of component zha
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 143, in _async_setup_component
    hass, processed_config)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zha/__init__.py", line 104, 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 30, in __init__
    detect_types=sqlite3.PARSE_DECLTYPES)
sqlite3.OperationalError: unable to open database file  

what is going on? Here is what I have in my configuration.yaml :

Z-Wave
zwave:
  usb_path: /dev/ttyUSB0
zha:
  usb_path: /dev/ttyUSB1
  database_path: /config/zigbee.db

can anyone help me?

Please consider that if I am using (as an existing database path)

/home/homeassistant/.homeassistant/zigbee.db

then the web interface does not load at all.

Because the error log has unable to open database, you might try removing /config/ from the configuration. Alternatively, specify the full path and make sure that HA has permission to write there.

I tried that, same result.

would you mind sharing how to make sure I have permissions to write to /home/homeassistant/.homeassistant/
?

Thank you so much for helping.

here is the permissions for the folder:

raspberrypi:/home/homeassistant/.homeassistant $ ls -l
total 20336
-rw-r--r-- 1 homeassistant homeassistant        2 Jul 20 14:29 automations.yaml
-rw-r--r-- 1 homeassistant homeassistant     1986 Jul 27 12:05 configuration.yaml
-rw-r--r-- 1 homeassistant homeassistant        0 Jul 20 14:29 customize.yaml
drwxr-xr-x 2 homeassistant homeassistant     4096 Jul 20 14:29 deps
-rw-r--r-- 1 homeassistant homeassistant      108 Jul 20 15:46 entity_registry.yaml
-rw-r--r-- 1 homeassistant homeassistant        0 Jul 20 14:29 groups.yaml
-rw-r--r-- 1 homeassistant homeassistant      873 Jul 20 15:31 home-assistant.log
-rw-r--r-- 1 homeassistant homeassistant 20688896 Jul 27 12:07 home-assistant_v2.db
-rw-r--r-- 1 homeassistant homeassistant     1122 Jul 20 15:45 options.xml
-rw-r--r-- 1 homeassistant homeassistant       71 Jul 27 12:07 OZW_Log.txt
-rw-r--r-- 1 homeassistant homeassistant    32768 Jul 20 15:45 pyozw.sqlite
-rw-r--r-- 1 homeassistant homeassistant        0 Jul 20 14:29 scripts.yaml
-rw-r--r-- 1 homeassistant homeassistant      157 Jul 20 14:29 secrets.yaml
drwxr-xr-x 2 homeassistant homeassistant     4096 Jul 20 14:32 tts
-rw-r--r-- 1 homeassistant homeassistant    45056 Jul 26 18:13 zigbee.db
-rw-r--r-- 1 homeassistant homeassistant      972 Jul 27 12:05 zwcfg_0xfc235fdc.xml
-rw-r--r-- 1 homeassistant homeassistant      108 Jul 27 12:05 zwscene.xml

Try the following for the database path.

database_path: /home/homeassistant/.homeassistant/zigbee.db

lviperz’s solution should work.

To check the permissions from the command line:
getfacl /home/homeassistant/.homeassistant/

The owner and group should be homeassistant and the user should have rwx permissions and the group should have rx.

Unfortunately, as I mentioned in my first post, using

database_path: /home/homeassistant/.homeassistant/zigbee.db

doesn’t load the Web UI anymore

please check my previous post, does it seems as you describe it? what command should I use to change the permissions as needed? thanks

anyone? I can’t move forward without this… Please.

I can see one problem. I do believe that python 3.6 is required. I see python 3.5

I don’t think the database_path is a requirement.

What is python 3.6 required for? I’ve updated it, but nothing has changed.

the database_path is required by the zigbee component

@cinghialino I apologize I steered you wrong. The minimum Python version is 3.5.3, not 3.6. There were lots of discussions a while back about updating Python when 3.4 was deprecated and how to update to Python 3.6. I was just hoping my comments would get someone else to chime in.

are you running homeassistant in a docker container or in a python venv?
try deleting zigbee.db or renaming it and restart hass. It should create a new, empty database.
Also, unless you copied zigbee.db from an older installation, it looks like the database was created successfully by hass, so that shouldn’t be a permission issue, unless you are trying to start hass under as a different user.

it was a fresh installation of Raspbian Stretch, installed Home Assistant based on the instruction I followed here.

I deleted the zigbee.db, and after the restart, the file is back there with a size of 45056.

I’m about to give up. This is clearly not ready for prime time, and apparently there aren’t many users able to solve this problem. I’ll try to use hass.io but documentation on this is severely lacking.

There aren’t as many Zigbee users as there are for other platforms. I don’t think your problems are even typical for Zigbee users.

That seem to indicate an installation in a python virtual environment. If that’s the case, the path definitely shouldn’t start with /config.

And do you still get “cannot open database”? if it created database, than you do have correct permissions. Use just database_path: zigbee.db so it looks for the file in the same directory as hass configuration. As it is very likely that regular user won’t have write permissions for /config/zigbee.db file. /config/zigbee.db is used for docker installations.

using
database_path: zigbee.db or
database_path: /home/homeassistant/.homeassistant/zigbee.db
makes the web interface not loading anymore. (ERR_CONNECTION_REFUSED)

Can’t say anything without seeing the logs, but

  1. database_path: zigbee.db or database_path: /home/homeassistant/.homeassistant/zigbee.db is the correct configuration
  2. it loads the zigbee.db successfully and as tries to finish initializing the stick and hangs in there, thus delaying http component initialization, so you get connection refused.

bump logging to debug, leave database_path: zigbee.db, make sure your user (user which start hass) is member of the "dialout’ group, start hass, wait for a few minutes and post logs here.

there is a progress: if I use just database_path: zigbee.db after removing the file zigbee.db from /home/homeassistant/.homeassistant/. The file zigbee.db only gets recreated when I use /home/homeassistant/.homeassistant/ as a database_path

which logs you want me to post? my /home/homeassistant/.homeassistant/home-assistant.log is empty

user homeassistant is part of the dialout group (I checked it with getent group dialout command)

this is strange. can you post output of id command and how exactly are you launching home assistant?

Also, check Setup of zha is taking over 10 seconds. -- homeassistant · Issue #120 · zigpy/bellows · GitHub and hass.io won't start when zha component enabled · Issue #8922 · home-assistant/core · GitHub Seems like there was a batch of bad sticks out in the wild.