Hassbian open-zwave error

I just flashed Hassbian on my RPi3, and added zwave: to the configuration.yaml.

But when I open Hass frontend I get the “Invalid Config” error for zwave component.
Here’s what I have in the log file:

17-03-29 15:14:07 ERROR (Thread-8) [homeassistant.components.zwave] You are missing required dependency Python Open Z-Wave. Please follow instructions at: https://home-assistant.io/components/zwave/
17-03-29 15:14:07 ERROR (MainThread) [homeassistant.setup] Setup failed for zwave: Component failed to initialize.

What am I doing wrong? Do I have to install OpenZWave libraries on Hassbian? I thought it comes with zwave support built-in.

Thanks.

You need to install it. The All in One comes with it pre-installed not hassbian. It’s an easy install. Takes a long time.

Yes, some time after posting this I found out about hassbian scripts. However, for some reason, I don’t have these scripts where they are supposed to be. I used Hassbian 1.2 version, maybe the path changed? I did not find the proper path.

I found them on git though.

And it fails on “make” for ozwcp,

root@hassbian:/srv/homeassistant/src/open-zwave-control-panel# make
g++ -c -Wall -Wno-unknown-pragmas -Wno-inline -Wno-format -g -DDEBUG -ggdb -O0 -I /srv/homeassistant/src/python-openzwave/openzwave/cpp/src -I /srv/homeassistant/src/python-openzwave/openzwave/cpp/src/command_classes/ -I /srv/homeassistant/src/python-openzwave/openzwave/cpp/src/value_classes/ -I /srv/homeassistant/src/python-openzwave/openzwave/cpp/src/platform/ -I /srv/homeassistant/src/python-openzwave/openzwave/cpp/src/platform/unix -I /srv/homeassistant/src/python-openzwave/openzwave/cpp/tinyxml/ -I /srv/homeassistant/src/libmicrohttpd/src/include -o ozwcp.o ozwcp.cpp
ozwcp.cpp:54:24: fatal error: microhttpd.h: No such file or directory
 #include "microhttpd.h"
                        ^
compilation terminated.
Makefile:48: recipe for target 'ozwcp.o' failed
make: *** [ozwcp.o] Error 1

They’re located at /home/pi/hassbian-scripts

Looks like your logged on as root, you should be doing everything as the user pi

I don’t recall having to do make

I just installed the script using the command in the link above. Added zwave: to my config.

ok, i guess going through the script line by line was a mistake, so I just created a new script, ran it, and seems like it worked, at least no errors.

Rebooted Pi, and now i get another error in log:

17-03-29 20:23:24 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.3.2-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 249, in setup
    CONF_CONFIG_PATH, default_zwave_config_path))
  File "/srv/homeassistant/lib/python3.4/site-packages/pyozwweb-0.3.2-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 /zwaveusbstick : [\'Traceback (most recent call last):\\n\', \'  File "/srv/homeassistant/lib/python3.4/site-packages/pyozwweb-0.3.2-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"]'

So I guess… My zwave stick is not supported =\ Aww, okay will have to buy aeotec one… Or not…
I’m using UZB1

Is /zwaveusbstick the name of your usb_path?

It should look something like usb_path: /dev/ttyUSB0 or usb_path: /dev/ttyACM0

Damn it, yes, sorry, it’s night here, and I’m paranoid :smiley: I forgot to add usb_path. Now it works!
Thanks a lot for your patience and help, I feel bad for posting all this :smiley:

No need to apologize. Glad to help. :slight_smile:

Just as a comment, that might help someone else finding this thread, as I did in my despair.

I was having trouble with a similar error log on a raspberry pi 3. It had worked, and after I had fiddled with completely unrelated things (shell_commands, and scripts, none of which involved anything z wave), it stopped. For me it wasn’t the usb path (that was usb_path: /dev/ttyACM0, and hadn’t changed from when it worked), and to be honest, I don’t know what it was. At some point I might have done an apt-get update.

For me, the solution was to do an apt-get dist-upgrade.

The output of my home-assistant.log was:

17-04-03 21:21:42 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.2-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 336, in setup
    CONF_CONFIG_PATH, default_zwave_config_path))
  File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.2-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/ttyACM0 : [\'Traceback (most recent call last):\\n\', \'  File "/srv/homeassistant/lib/python3.4/site-packages/openzwave-0.3.2-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-03 21:21:50 WARNING (MainThread) [homeassistant.setup] Setup of switch is taking over 10 seconds.

I just hate googling to find that thread that almost, but not quite, solves your problem. So I hope this will help someone searching…

1 Like

I had exactly the same error in my log. An dist-upgrade did nothing for me (everything was updated).

A reboot however fixed it. I think it might be related to the fact that I had ozwcp started. Maybe that starts something that then interferers with HA?

A simple reboot got HA to find all my zwave devices as expected.