I just tried a manual install of HA on RPi and once I got to the Z-Wave part I ran into trouble. I have python-openzwave installed and the config directory is /usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.1-py3.4-linux-armv7l.egg/config but HA gives me the following error upon startup:
16-10-21 22:04:23 INFO (Thread-1) [homeassistant.util.package] Attempting install of pydispatcher==2.0.5
16-10-21 22:04:28 ERROR (Thread-1) [homeassistant.components.zwave] You are missing required dependency Python Open Z-Wave. Please follow instructions at: https://home-assistant.io/components/zwave/
16-10-21 22:04:28 ERROR (Thread-1) [homeassistant.bootstrap] component zwave failed to initialize
I also made sure to add user homeassistant to group dialout. My Z-Wave USB stick is definetly working as Iāve used it with multiple other home automation apps on this system.
I have the following packages installed and working:
ii libopenzwave-doc 1.5+ds-1 all documentation for the openzwave library
ii libopenzwave1.5 1.5+ds-1 armhf API to use a Z-Wave controller
ii libopenzwave1.5-dev 1.5+ds-1 armhf header files for the openzwave library
ii openzwave 1.5+ds-1 armhf Sample Program for libopenzwave
ii python-openzwave 0.3.0-1 armhf python-openzwave is a python wrapper for the openzwave c++ library.
Thanks for responding. I followed the instructions on the HA ZW page which are as followed:
$ git clone https://github.com/OpenZWave/python-openzwave.git
$ cd python-openzwave
$ git checkout python3
$ PYTHON_EXEC=$(which python3) make build
$ sudo PYTHON_EXEC=$(which python3) make install
Instead of make install, you can alternatively build your own python-openzwave package which can be easily uninstalled: $ sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave
With this installation, your config_path needed below will resemble:
/usr/local/lib/python3.4/dist-packages/libopenzwave-0.3.0b8-py3.4-linux-x86_64.egg/config
Not sure how it chose the version numbering but the files and the package are definitely linked:
While this may not be directly helpful, I would like to share a blog post I wrote up not long ago for installing hass & open-zwave. Maybe it can be of assistance:
I actually found this page earlier when trying to figure out how to compile the openzwave control panel
Unfortunately it doesnāt seem to be related to my problem, which is Home Assistant stubbornly not seeing python-openzwave even though itās installed clear as day.
EDIT: Actually the problem seems to be that Debian python3 is not looking in /usr/local/lib/python3.4/dist-packages/ (at least for libopenzwave). I donāt understand enough about how all this works to fix it at this stageā¦ I see Linux is still as much trouble as when I first got into it when Debian 3.0 was still unstable
I long for the distant future thousands of years ahead when computers just work without all this troubleā¦ But Iām afraid it will take AI to solve and we will be made redundant.
EDIT2: And WTF is this a step when Iām using OpenZwave 1.5?!
make[2]: Entering directory '/home/pi/python-openzwave/openzwave/cpp/build'
Building OpenZWave Version 1.4-2206-gbe834e3-dirty
What do you see if you run pip3 list | grep openzwave? Here is what I have.
root@hass:~# pip3 list | grep openzwave
libopenzwave (0.3.1)
openzwave (0.3.1)
```
I've run into a couple issues where hass tries to install packages via pip but it doesn't actually happen, so after upgrades to newer versions of hass I keep an eye on the log to make sure packages install.
So if you don't have those two packages listed above installed, install them (i.e., `pip3 install openzwave==0.3.1`, etc). Check for pydispatcher (`pip3 list | grep pydispatcher`), if not installed go ahead and install it. Restart hass, and assess.
PyOZW pulls down its own copy of OZW and builds against it. You may need to cd python-openzwave; git submodule update then rebuild. But that probably wonāt help with finding it after.
pi@homepi:~ $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openzwave
pi@homepi:~ $ sudo su -s /bin/bash homeassistant
homeassistant@homepi:/home/pi $ cd /srv/homeassistant
homeassistant@homepi:/srv/homeassistant $ python3 -m venv homeassistant_venv
homeassistant@homepi:/srv/homeassistant $ source /srv/homeassistant/homeassistant_venv/bin/activate
(homeassistant_venv) homeassistant@homepi:/srv/homeassistant $ python3
Python 3.4.2 (default, Oct 19 2014, 13:31:11)
[GCC 4.9.1] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import openzwave
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'openzwave'
The problem is the virtual environment in which HA runsā¦ I donāt know what I would have to do to solve this.
EDIT: I havenāt checked whether this is the problem yet, but Iāll take an educated guess that it probably is. If so then the instructions on the HA site for manual installation are very deceiving.
homeassistant@homepi:~ $ cat /srv/homeassistant/homeassistant_venv/pyvenv.cfg
home = /usr/bin
include-system-site-packages = false
version = 3.4.2
So it should be made clear in the manual installation instructions that if you need any python packages they need to be created WITHIN the virtual environment or this setting needs to be changed.
Unfortunately the instructions on the HA website donāt take that into consideration.
That one small change in the confit file should be noted, or it should be explicitly stated and shown in the correct order that you compile and install the python packages inside the virtual environment.
Either way would prevent a lot of frustration for new adopters.
I am now encountering a slight different problem, even after fixing the first issue of a missing python module.
Has anyone seen this in their error log recently?
16-10-26 10:38:14 homeassistant.bootstrap: Error during setup of component zwave
Traceback (most recent call last):
File ā/usr/local/lib/python3.5/site-packages/openzwave-0.3.1-py3.5.egg/openzwave/network.pyā, line 322, in init
self.dbcon = lite.connect(os.path.join(self._options.user_path, āpyozw.sqliteā), check_same_thread=False)
NameError: name āliteā is not defined
I am having extreme difficulty solving this one. It started showing up when I upgraded Cython and recompiled OpenZWave the other day.
Sorry, but what exactly did you do to get this working? I still cannot get z-wave to work under this version of HA after using and installing hassbian.
Any help getting z-wave to work under hassbian will be highly apreciated.
Did you figure it out? If you did please let me knowā¦ I installed HASS using HASSBIAN and I cannot get z-wave to work at all. I can see the differences that you pointed out, but I do not know what to do to make it work.
Thanks!
I canāt remember if Hassbian sets things up in a venv like the all-in-one installer does. But if thatās the case, you kinda need to treat that virtual environment like itās own pi and install inside the venv. Otherwise packages wonāt be available.
Search the forum for the commands to sudo to the correct (hass?) user and enter the venv.