Installation HASSbian and Z-Wave

Hello,

In my previous install I used Z-Wave. But now I’m using HASSbian and I can’t figure out how Z-Wave is installed (or not). The documentation on the website is (I’m sorry) a mess with all the different versions…

Can somebody help me?

Greeting, Ramon

1 Like

Hi Ramon,

did you follow the documentation in this thread yet?

Cheers,
Tobi

Hi Toby,

Thanks for the quick reply. Yes, I followed the thread. But there is not much about z-wave. Only some folks who can’t get it working like me (as far as I’ve seen).

Gr. Ramon

Can you describe where you’re stuck?

I thought Open-zwave was already installed, but I can’t find it. When I try to install it I can’t figure out where or how to place it.

I’m now trying:

sudo su -s /bin/bash homeassistant
source /srv/homeassistant/bin/activate
pip install --upgrade cython

Still getting an error:

sudo PYTHON_EXEC=$(which python3) checkinstall --pkgname python-openzwave --pkgversion 1.0 --provides python-openzwave

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
This software is released under the GNU GPL.

The package documentation directory ./doc-pak does not exist

If you’re using the most recent Hassbian image, 1.1 toybox, you’ll just need to run the zwave script that’s built in.

  1. load latest image to SD card
  2. SSH into pi and run script
  • sudo ./hassbian-scripts/install_openzwave.sh

My config simply has
zwave:
usb_path: /dev/ttyACM0

You can find your zwave USB device on pi with $ ls /dev/ttyACM*

Check these links


3 Likes

@Jeff_VoVillia and all:

RPi3-b; Aeotec Z-Stick gen 5; Aeotec Smart Switch 6.

I am a real newbie at home automation, but a long time programmer. I installed Hassbian from the 1.1 toybox including zwave. The installation went very smoothly but there are several things that are not obvious:

  • Customized components are put in a subdirectory of .hassbian; the same folder in which configuration.yaml lives. (Let’s call this the hassbian config directory. “HCD”) The 1.1 toybox installation puts this in /home/homeassistant/.homeassistant. I followed the video https://home-assistant.io/developers/ with no success until I discovered this.

  • ozwcp MUST be run from its installation directory; on my system: /srv/homeassistant/src/open-zwave-control-panel/ . And as has been documented elsewhere, you must stop homeassistant before starting ozwcp.

  • ozwcp creates a zwcfg_0xXXXXXX.xml configuration file in its installation directory which needs to be shared with homeassistant. In addition, homeassistant z-wave component needs to access various other .xml and .xsd files which (on my system) are located in: /srv/homeassistant/src/python-openzwave/openzwave/config/ .

  • If you specify a config_path in your zwave: part of configuration.yaml, those .xsd files need to be accessible in that path (I use sym links).

  • Homeassistant creates a zwcfg_0xXXXXXX.xml and zwscene.xml in the HCD even if they are in zwave: config_path.

I have successfully paired by Smart Switch with my Z-Stick, and it shows up in homeassistant web page. I can control the switch just fine from homeassistant. The problem is that if I switch the Smart Switch manually, the changed state is not reflected in the homeassistant GUI. I can see in the logs that the switch sent an update state info message, that is logged as “UPDATE_STATE_NODE_INFO_RECEIVED”. I think this should trigger some action to query the Smart Switch to determine the current state; but no such activity is logged.

How do I get HA to update its state to agree with the switch?

Thanks for your help; I hope my comments above help others.
Tom

EDIT 2 days later:

I dug into the open-zwave driver to find out what is happening with the message sent from the Smart Switch 6. As documented in the switch docs, a single press of the button is supposed to send an unsecured update info message. Apparently this is used during adding a device to the zwave controller. The zwave driver uses this to update its info about the capabilities of the device if it has not already got the info from the config xml file or the device previously. The only other use is to show that the device is awake. I guess it is only a “side effect” of pushing the button on the switch that it changes the state of the switch.

Bottom line is, the way to synchronize the front end with the state of the switch is to poll the switch.

1 Like

Thank you Jeff!

I didn’t look on the right place. One simple rule, hours of searching… :cold_sweat:

How and where find zwave config_path: for Aeon Labs Z-stick gen5.
Youtube [video](https://youtu.be/ajklDCaOGwY) from Bruh path is
zwave:
usb_path: /dev/ttyACM0
config_path: /srv/hass/hass_venv/lib/python3.4/site-packages/libopenzwave-0.3.1-py3.4-linux-armv7l.egg/config

but i can’t find config file in folder ( libopenzwave-0.4.0.31.egg-info ) in my Pi-3

pi@hassbian:/srv/homeassistant/lib/python3.4/site-packages $ ls
aiohttp                         Flask_WTF-0.9.5-py3.4.egg               openzwave-0.4.0.31-py3.4.egg
aiohttp-2.0.7.egg-info          gevent-1.1.1-py3.4-linux-armv7l.egg     pip
async_timeout                   gevent_socketio-0.3.6-py3.4.egg         pip-9.0.1.dist-info
async_timeout-1.2.0.dist-info   gevent_websocket-0.10.1-py3.4.egg       pkg_resources.py
Babel-2.4.0-py3.4.egg           greenlet-0.4.12-py3.4-linux-armv7l.egg  __pycache__
cec                             homeassistant                           PyDispatcher-2.0.5-py3.4.egg
chardet                         homeassistant-0.43.2.dist-info          pyozwman-0.4.0.31-py3.4.egg
chardet-3.0.2.dist-info         itsdangerous-0.24-py3.4.egg             pyozwweb-0.4.0.31-py3.4.egg
Cython                          jinja2                                  python_engineio-1.4.0-py3.4.egg
Cython-0.24.1.egg-info          Jinja2-2.9.6.dist-info                  python_openzwave
cython.py                       libopenzwave-0.4.0.31.egg-info          python_openzwave-0.4.0.31-py3.4-linux-armv7
easy-install.pth                libopenzwave.cpython-34m.so             python_socketio-1.7.4-py3.4.egg
easy_install.py                 _markerlib                              pytz
Flask-0.10.1-py3.4.egg          markupsafe                              pytz-2017.2.dist-info
Flask_Babel-0.9-py3.4.egg       MarkupSafe-1.0.egg-info                 pyximport
Flask_SocketIO-2.8.6-py3.4.egg  multidict                               PyYAML-3.12.egg-info
Flask_Themes-0.1.3-py3.4.egg    multidict-2.1.4.egg-info                requests

usb_path: /dev/ttyACM0 = USB Port Z-Stick is connected to.
config_path = /.homeassistant/zwave_device_config.yaml

I am using Samba to access files from pi3 in windows PC where find file " zwave_device_config.yaml "

I use WinSCP, never had any luck using Samba to get to /.homeassistant

home-assistant.log

17-04-30 00:38:58 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/pyozwweb-0.4.0.31-py3.4.egg/openzwave/option.py", line 78, in __init__
    raise ZWaveException(u"Can't find device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
  File "/usr/lib/python3.4/traceback.py", line 181, in format_exception
    return list(_format_exception_iter(etype, value, tb, limit, chain))
  File "/usr/lib/python3.4/traceback.py", line 146, in _format_exception_iter
    for value, tb in values:
  File "/usr/lib/python3.4/traceback.py", line 125, in _iter_chain
    context = exc.__context__
AttributeError: 'NoneType' object has no attribute '__context__'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/setup.py", line 192, in _async_setup_component
    None, component.setup, hass, processed_config)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 253, in setup
    CONF_CONFIG_PATH, default_zwave_config_path))
  File "/srv/homeassistant/lib/python3.4/site-packages/pyozwweb-0.4.0.31-py3.4.egg/openzwave/option.py", line 81, in __init__
    raise ZWaveException(u"Error when retrieving device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: 'Zwave Generic Exception : Error when retrieving device /dev/ttyUSB0 : [\'Traceback (most recent call last):\\n\', \'  File "/srv/homeassistant/lib/python3.4/site-packages/pyozwweb-0.4.0.31-py3.4.egg/openzwave/option.py", line 78, in __init__\\n    raise ZWaveException(u"Can\\\'t find device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 181, in format_exception\\n    return list(_format_exception_iter(etype, value, tb, limit, chain))\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 146, in _format_exception_iter\\n    for value, tb in values:\\n\', \'  File "/usr/lib/python3.4/traceback.py", line 125, in _iter_chain\\n    context = exc.__context__\\n\', "AttributeError: \'NoneType\' object has no attribute \'__context__\'\\n"]'
17-04-30 01:00:52 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/lib/python3.4/asyncio/tasks.py", line 233, in _step
    result = coro.throw(exc)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/discovery.py", line 117, in scan_devices
    None, _discover, netdisco)
  File "/usr/lib/python3.4/asyncio/futures.py", line 388, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.4/asyncio/tasks.py", line 286, in _wakeup
    value = future.result()
  File "/usr/lib/python3.4/asyncio/futures.py", line 277, in result
    raise self._exception
  File "/usr/lib/python3.4/concurrent/futures/thread.py", line 54, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.4/site-packages/homeassistant/components/discovery.py", line 143, in _discover
    netdisco.scan()
  File "/home/homeassistant/.homeassistant/deps/netdisco/discovery.py", line 63, in scan
    self.gdm.scan()
  File "/home/homeassistant/.homeassistant/deps/netdisco/gdm.py", line 21, in scan
    self.update()
  File "/home/homeassistant/.homeassistant/deps/netdisco/gdm.py", line 76, in update
    sock.sendto(gdm_msg, (gdm_ip, gdm_port))
OSError: [Errno 101] Network is unreachable

Did you confirm your USB port?

yes

pi@hassbian:~ $ ls /dev/ttyACM*
/dev/ttyACM0

Installed OpenZWave by script sudo ./hassbian-scripts/install_openzwave.sh

I foolowed this install:

Then:

Then rebooted Pi

thanks :slight_smile: i will try your following installations, do you have Hassbian on your Pi ?

do you run both commands

$ PYTHON_EXEC=$(which python3) make build
$ sudo PYTHON_EXEC=$(which python3) make install

Yes, Hassbian on Pi3