Error during setup of component zwave

I am trying to get Z-Wave working on a Raspberry Pi 2 Model B running an fresh install of Raspbian Jessie; Z-Wave device is the RaZberry modul (ZME_RAZ_EU). I installed HASS via AIO - everything works as expected. After configuring Z-Wave and restarting HASS I get an exception:

ERROR:homeassistant.bootstrap:Error during setup of component zwave
Traceback (most recent call last):
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/option.py", line 75, in __init__
    raise ZWaveException(u"Can't write to 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/homeassistant_venv/lib/python3.4/site-packages/homeassistant/bootstrap.py", line 151, in _async_setup_component
    None, component.setup, hass, 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/homeassistant_venv/lib/python3.4/site-packages/homeassistant/components/zwave/__init__.py", line 279, in setup
    CONF_CONFIG_PATH, default_zwave_config_path))
  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-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/ttyAMA0 : [\'Traceback (most recent call last):\\n\', \'  File "/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.1-py3.4.egg/openzwave/option.py", line 75, in __init__\\n    raise ZWaveException(u"Can\\\'t write to 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"]'

Here is my “configuration.xml”:

zwave:
  usb_path: /dev/ttyAMA0
  config_path: /srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/libopenzwave-0.3.1-py3.4-linux-armv7l.egg/config
  polling_interval: 60000

I guess something with rights is wrong, because I can initialize the Z-Wave module with OZWCP. But I have no idea what exactly. Running…

ls -l /dev/ttyAMA0

… gives:

crw--w---- 1 root tty 204, 64 Jan 22 19:59 /dev/ttyAMA0

The user “homeassistant” was added to group “tty” and group “dialout” - but still no luck.

Do you have an idea, what I am doing wrong?

How are you starting homeassistant? It sure looks like a permissions issue. Also, are you sure it’s the right device file, /dev/ttyAMA0 and not /dev/ttyACM0, or ACM1?

Easiest way to test which device it should be is by

ls /dev/tty*
# remove zwave stick
ls /dev/tty*
# compare the difference

You can also look in dmesg | tail -10 after you insert your zwave stick.

1 Like

With me, both /dev/ttyAMA0 and /dev/ttyACM0 appeared when inserting the ZWave stick. I choose to start with /dev/ttyACM0 and that worked. When I later inserted RFXTRX433 it showed up on /dev/ttyUSB0 by the way. All on Raspberry 3B.

I am getting the same error message.I have verified that I am using the right usb_path:

just figured mine out I missed adding my user to dialout group

Sorry for my late answer. I solved the problem:

By default getty is using /dev/ttyAMA0, so you have to disable it. You also have to ensure, that the user “homeassistant” has the groups “tty” and/or “dialout”.

1 Like