Z-Wave Woes

I located a bug here:

that looks like what is happening to me (I can’t be sure though because I can’t see the reason). It looks like it is fixed, so I updated to the latest version of HA (I was already on it) and I am still having the issue.
Some background:
I am running this on a freenas box and I used the script from here:

I confirmed which device the stick was showing up as in /dev and took the steps to pass it to the jail. It looks like it is a permissions issue from the logs, but I am not sure what account is trying to access it/where “it” even is.
Here are the logs from home assistant:

2019-04-22 09:44:20 ERROR (SyncWorker_14) [homeassistant.util.package] Unable to install package homeassistant-pyozw==0.1.3: The directory '/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Command "/srv/homeassistant/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-oef1duaq/homeassistant-pyozw/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-xand3v3d/install-record.txt --single-version-externally-managed --compile --install-headers /srv/homeassistant/include/site/python3.6/homeassistant-pyozw" failed with error code 1 in /tmp/pip-install-oef1duaq/homeassistant-pyozw/
2019-04-22 09:44:20 ERROR (MainThread) [homeassistant.requirements] Not initializing zwave because could not install requirement homeassistant-pyozw==0.1.3
2019-04-22 09:44:20 ERROR (MainThread) [homeassistant.setup] Setup failed for zwave: Could not install all requirements.

Also found this:

I was unable to find libudev-dev to install, but I did find libudev-devd and figured what the heck?
It didn’t help. :frowning:

Just for kicks I tried installing pyozw 0.1.3 and it gave me 146KB of text through the console (ending in an error). I tried installing 0.1.2 and it installed fine with 11 lines of output.

The error at the end:
Command “/usr/local/bin/python3.6 -u -c “import setuptools, tokenize;file=’/tmp/pip-install-45ey4oh4/homeassistant-pyozw/setup.py’;f=getattr(tokenize, ‘open’, open)(file);code=f.read().replace(’\r\n’, ‘\n’);f.close();exec(compile(code, file, ‘exec’))” install --record /tmp/pip-record-ykxrlli_/install-record.txt --single-version-externally-managed --compile” failed with error code 1 in /tmp/pip-install-45ey4oh4/homeassistant-pyozw/

@jeffmunk

The problem is with homeassistant-pyozw==0.1.3. The issue is fixed in homeassistant-pyozw==0.1.4 but homeassistant devs have not bumped the version yet. For now the only options seem to be stay on HA 90.2 or manually edit zwave/__init__.py to use pyozw==0.1.4.

iocage console homeassistant
service homeassistant stop

su - hass
source /srv/homeassistant/bin/activate
pip3 install --upgrade homeassistant
ee /srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/zwave/__init__.py

On line 40 you will see:

REQUIREMENTS = ['pydispatcher==2.0.5', 'homeassistant-pyozw==0.1.3']

Change this to :

REQUIREMENTS = ['pydispatcher==2.0.5', 'homeassistant-pyozw==0.1.4']

Press Esc twice to save and exit the editor and finally

deactivate && exit
service homeassistant start

This is also mentioned in the here :slightly_smiling_face:

1 Like

Sweet, I missed that! Thak you, I will give it a spin (I have an uncanny ability to start projects like HA when something is broken haha)

That worked a treat!
Thank you for being helpful and not being a dick about it!

1 Like

I was trying to setup zwave and got and error. I would appreciate any help.

System info:
HA version = 0.100.1
python version = 3.7.4

Error output

xxx@xxxxx:/home/homeassistant/.homeassistant # service homeassistant start
Performing check on Home Assistant configuration:
Testing configuration at /usr/home/homeassistant/.homeassistant
INFO:homeassistant.util.package:Attempting install of homeassistant-pyozw==0.1.4
ERROR:homeassistant.util.package:Unable to install package homeassistant-pyozw==0.1.4: ERROR: Command errored out with exit status 1:
   command: /usr/local/share/homeassistant/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-i3mdymrg --python-tag cp37
       cwd: /tmp/pip-install-a_4a42hh/homeassistant-pyozw/
  Complete output (17 lines):
  sysargv ['/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py', 'bdist_wheel', '-d', '/tmp/pip-wheel-i3mdymrg', '--python-tag', 'cp37']
  Found SETUP_DIR : /tmp/pip-install-a_4a42hh/homeassistant-pyozw
  <pyozw_setup.EmbedTemplate object at 0x806775fd0>
  {'name': 'libopenzwave', 'sources': ['openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp'], 'include_dirs': ['src-lib/libopenzwave/', 'openzwave-embed/open-zwave-hass/cpp/src', 'openzwave-embed/open-zwave-hass/cpp/src/value_classes', 'openzwave-embed/open-zwave-hass/cpp/src/platform', 'openzwave-embed/open-zwave-hass/cpp/build/linux'], 'define_macros': [('PY_LIB_VERSION', '0.1.4'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'embed'), ('PY_LIB_BACKEND', 'cpp')], 'libraries': ['usb', 'stdc++'], 'extra_objects': ['openzwave-embed/open-zwave-hass/libopenzwave.a'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'}
  ['six', 'PyDispatcher>=2.0.5']
  running bdist_wheel
  running build
  running build_openzwave
  Found g++ : None
  Found gcc : None
  Found make : /usr/bin/make
  Found gmake : None
  Found cython : None
  Found pkg-config : None
  fetching https://raw.githubusercontent.com/home-assistant/python-openzwave/hass/archives/open-zwave-hass-0.1.4.zip into openzwave-embed/open-zwave.zip for version 0.1.4
  Clean openzwave in openzwave-embed/open-zwave-hass ... be patient ...
  error: [Errno 2] No such file or directory: 'gmake': 'gmake'
  ----------------------------------------
  ERROR: Failed building wheel for homeassistant-pyozw
  ERROR: Command errored out with exit status 1:
   command: /usr/local/share/homeassistant/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' clean --all
       cwd: /tmp/pip-install-a_4a42hh/homeassistant-pyozw
  Complete output (8 lines):
  sysargv ['/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py', 'clean', '--all']
  Found SETUP_DIR : /tmp/pip-install-a_4a42hh/homeassistant-pyozw
  <pyozw_setup.EmbedTemplate object at 0x806778090>
  {'name': 'libopenzwave', 'sources': ['openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp'], 'include_dirs': ['src-lib/libopenzwave/', 'openzwave-embed/open-zwave-hass/cpp/src', 'openzwave-embed/open-zwave-hass/cpp/src/value_classes', 'openzwave-embed/open-zwave-hass/cpp/src/platform', 'openzwave-embed/open-zwave-hass/cpp/build/linux'], 'define_macros': [('PY_LIB_VERSION', '0.1.4'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'embed'), ('PY_LIB_BACKEND', 'cpp')], 'libraries': ['usb', 'stdc++'], 'extra_objects': ['openzwave-embed/open-zwave-hass/libopenzwave.a'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'}
  ['six', 'PyDispatcher>=2.0.5']
  running clean
  Clean openzwave in openzwave-embed/open-zwave-hass ... be patient ...
  error: [Errno 2] No such file or directory: 'gmake': 'gmake'
  ----------------------------------------
  ERROR: Failed cleaning build dir for homeassistant-pyozw
    ERROR: Command errored out with exit status 1:
     command: /usr/local/share/homeassistant/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ox3vb57p/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/share/homeassistant/include/site/python3.7/homeassistant-pyozw
         cwd: /tmp/pip-install-a_4a42hh/homeassistant-pyozw/
    Complete output (16 lines):
    sysargv ['/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py', 'install', '--record', '/tmp/pip-record-ox3vb57p/install-record.txt', '--single-version-externally-managed', '--compile', '--install-headers', '/usr/local/share/homeassistant/include/site/python3.7/homeassistant-pyozw']
    Found SETUP_DIR : /tmp/pip-install-a_4a42hh/homeassistant-pyozw
    <pyozw_setup.EmbedTemplate object at 0x806775fd0>
    {'name': 'libopenzwave', 'sources': ['openzwave-embed/open-zwave-hass/python-openzwave/src-lib/libopenzwave/libopenzwave.cpp'], 'include_dirs': ['src-lib/libopenzwave/', 'openzwave-embed/open-zwave-hass/cpp/src', 'openzwave-embed/open-zwave-hass/cpp/src/value_classes', 'openzwave-embed/open-zwave-hass/cpp/src/platform', 'openzwave-embed/open-zwave-hass/cpp/build/linux'], 'define_macros': [('PY_LIB_VERSION', '0.1.4'), ('PY_SSIZE_T_CLEAN', 1), ('PY_LIB_FLAVOR', 'embed'), ('PY_LIB_BACKEND', 'cpp')], 'libraries': ['usb', 'stdc++'], 'extra_objects': ['openzwave-embed/open-zwave-hass/libopenzwave.a'], 'extra_compile_args': [], 'extra_link_args': [], 'language': 'c++'}
    ['six', 'PyDispatcher>=2.0.5']
    running install
    flavor embed
    running build_openzwave
    Found g++ : None
    Found gcc : None
    Found make : /usr/bin/make
    Found gmake : None
    Found cython : None
    Found pkg-config : None
    Clean openzwave in openzwave-embed/open-zwave-hass ... be patient ...
    error: [Errno 2] No such file or directory: 'gmake': 'gmake'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/local/share/homeassistant/bin/python3.7 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"'; __file__='"'"'/tmp/pip-install-a_4a42hh/homeassistant-pyozw/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-ox3vb57p/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/share/homeassistant/include/site/python3.7/homeassistant-pyozw Check the logs for full command output.
Failed config
  General Errors:
    - Component error: zwave - Requirements for zwave not found: ['homeassistant-pyozw==0.1.4'].

Successful config (partial)
/usr/local/etc/rc.d/homeassistant: WARNING: failed precmd routine for homeassistant

Thanks

Did you do a sudo apt-get install libudev-dev ?

I did not notice a message saying that was the problem. I cannot install that file. I am running under freebsd and that command does not work.

Find what package installs gmake and it might work.

I did install gmake and still get the message

@winter is the only one that I am aware of using FreeBSD and openzwave, maybe he can shed some light on the situation for you.

1 Like

I can take a look when I get home. I vaguely remember a gmake error.

What does which gmake give you?

/usr/local/bin/gmake

I see they released a new build on Saturday, so I will try upgrading to 0.100.2 and see if that fixes it. Found some other steps I may try if that does not work. Still not sure why it couln’t fins gmake.

Looks like I got it running. Not 100% which thing fixed it.

I previously installed gmake (but when starting the service it did not appear to see it)

I ran the below.

su homeassistant
cd /usr/local/share/homeassistant
virtualenv -p python3.7 .
source ./bin/activate.csh
pip3 install --upgrade homeassistant
pip3 install --upgrade cython
pip3 install homeassistant-pyozw
hass --open-ui

after that I exited the virtual env tried starting the service using
service homeassistant start

Zwave is looking correct now. I did try exiting the environment and starting the service before running that “hass --open-ui” and got the exact same error, so I re-enter the virtual env and ran that command, then it came up fine.

Not sure if cython needed installed but one of the guides said to do it, so I did, and I manually ran the install of the zwave, although maybe it would have installed by starting the service in the virtual env, because manual install of the zwave did not work outside the env either.

1 Like
You HAVE TO have gcc-c++ installed on your host. 
Yum install gcc-c++

You HAVE TO have Cython, make and setuptools installed and updated in your venv. 

Pip3 install cython, make, setuptools (something like that)

Then rerun your homeassistant-pyozw command In your venv. 
Pip3 install homeassistant-pyozw 

If that doesn’t work download the homeassistant-pyozwXXXX.zip file from pypi, extract it, then copy it to your HA install directory (may need sudo). Then change the permissions to match your HA user. 
Chown homeassistant:homeassistant homeassistant_pyozw -R

Then install it using (make sure to change directories into the actual folder or use the correct path)
Python3.8 setup.py install

Good luck.