Razberry 2 Z-wave problem with HA

Hi guys!

I can’t get razberry 2 work with HA. After many hours playing I managed to find Razberry 2 card with OpenZWave Control Panel. But only partially working. sometimes when I try to initialize it, I can’t get “Home ID” or “Controller mode” for it.

to config.yaml I have added rows like bellow:

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

but only I can get is error message as bellow:

17-02-26 14:34:06 ERROR (MainThread) [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.2-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 152, 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 282, in setup
CONF_CONFIG_PATH, default_zwave_config_path))
File “/srv/homeassistant/homeassistant_venv/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/ttyAMA0 : [‘Traceback (most recent call last):\n’, ’ File “/srv/homeassistant/homeassistant_venv/lib/python3.4/site-packages/openzwave-0.3.2-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”]’
17-02-26 14:34:17 WARNING (MainThread) [homeassistant.components.sensor.yr] Retrying in 15 minutes:
17-02-26 14:34:32 ERROR (Thread-14) [netdisco.ssdp] Error fetching description at http://192.168.1.250:49152/wps_device.xml

It would be beneficial to know which Raspberry Pi model you’re using.

The log output suggests that you’re using a Raspberry Pi 3. The Raspberry Pi Foundation made changes to the serial port assignments when using RPi3 because of Bluetooth support. On RPi2 Raspbian assigns /dev/ttyAMA0 correctly to both RaZberry and RaZberry 2. On RPi3 the serial port is automatically assigned to the built in Bluetooth protocol.

There’s a couple of forum threads where the matter has been discussed.

If you install the official Z-Way software using the script over at Z-Wave.Me, the Bluetooth service will automatically be disabled if detected. This will in turn free the port for use by RaZberry 2 and the Z-Way service can then be disabled.

It’s possible to perform manual deactivation of the Bluetooth service, but the procedure requires several steps. I might have the manual steps written down somewhere, but I’m unsure if they’re still viable. If you’re using a Raspberry Pi 3 I recommend installing Z-Way using the official script, then deactivating the Z-Way Server service manually to avoid serial port lock when trying to connect with HASS.

If I remember correctly you might also have to give the homeassistant user GPIO access with the command:

pi@hassbian:~ $ sudo adduser homeassistant gpio

I’m using RPi2.

Installation is made with “All-In-One Installer”

it already seemed to have needed permissions:

pi@raspberrypi:~ $ sudo adduser homeassistant gpio
The user ´homeassistant´ is already a member of ´gpio´.

If I install Zwave.me, how can I disable it?

Finaly get it work after installing z-wave.me software.

From z-wave.me UI, I deactivated “Z-Wave Network Access” and after that OZWCP started to work perfectly and also I was capable to add z-wave devices in Home Assistant.

@Juuzo, I think I am facing the same issue. I installed the z-wave.me Z-Way gateway and tried to do as you suggested but cannot find the “Z-Wave Network Access” option in the Web UI.
Can you describe with more details how you did it?
Thanks.