Help Setting up Aeotec Z-Stick Gen5, Z-Wave Plus usb stick

I added the following to configuration.

# Z-Wave
zwave:
  usb_path: /dev/ttyACM0

I get an error card saying zwave platform and config could not be set up.

The log shows this:

2018-01-13 23:54:05 ERROR (MainThread) [homeassistant.setup] Error during setup of component zwave
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/openzwave/option.py", line 75, in __init__
    raise ZWaveException(u"Can't write to device %s : %s" % (device, traceback.format_exception(*sys.exc_info())))
openzwave.object.ZWaveException: "Zwave Generic Exception : Can't write to device /dev/ttyACM0 : ['NoneType: None\\n']"

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/setup.py", line 193, in _async_setup_component
    component.setup, hass, processed_config)
  File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
    yield self  # This tells Task to wait for completion.
  File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
    future.result()
  File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
    raise self._exception
  File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zwave/__init__.py", line 280, in setup
    config_path=config[DOMAIN].get(CONF_CONFIG_PATH))
  File "/srv/homeassistant/lib/python3.5/site-packages/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.5/site-packages/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\', \'openzwave.object.ZWaveException: "Zwave Generic Exception : Can\\\'t write to device /dev/ttyACM0 : [\\\'NoneType: None\\\\\\\\n\\\']"\\n\']'
2018-01-13 23:54:16 WARNING (Thread-18) [netdisco.ssdp] Found malformed XML at http://192.168.1.33:9080: status=ok

I did the self install for hass.

You will need to find the zwave config file for your setup and put in the path to it.

The error includes can’t write to device /dev/ACM0.

Are you sure that is the correct device?

Is the home assistant user in the dialout group?

Where do I find that? I’ve looked in /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/zwave and don’t see anything likely.

I’ve also looked in /srv/homeassistant/lib/python3.5/site-packages
I see the following options, but none seem to work:
libopenzwave.cpython-35m-arm-linux-gnueabihf.so
openzwave
python_openzwave
python_openzwave-0.4.0.35.dist-info

The best candidate I have is: /srv/homeassistant/lib/python3.5/site-packages/python_openzwave/ozw_config but it doesn’t seem to work either.

That last one looks like it should be it. In that directory you should have a list of other directories with manufacturer names. And it should contain an options.XML file.

How did you enter the path in your config yaml?

I’m not by my setup right now so I can’t post an example.

When I can I will tho.

Both /dev/AMA0 and /dev/ACM0 exist, I have tried both, I did add homeassistant to the dialout group as well.

I validate and restart home assistant with each change.

That’s why I thought the ozw_config was right:

It does contain the options.xml and many manufacturers devices.

Let me try changing the usb path to the other one and see if that works.

Current config:

# Z-Wave
zwave:
  usb_path: /dev/ttyACM0
  config_path: /srv/homeassistant/lib/python3.5/site-packages/python_openzwave/ozw_config
1 Like

This process did work for me; maybe it could too. You might want to check out this article:

Looks like a problem with write permission.
Did you run a command like this diring setup?

sudo usermod -a -G dialout homeassistant

Regards

here is my config:

zwave:
  config_path: /srv/homeassistant/lib/python3.6/site-packages/python_openzwave/ozw_config
  usb_path: /dev/ttyUSB-ZStick-5G
  network_key: "0xDE, 0xBF, 0x58, 0x7E, 0x89, 0x4A, 0x8F, 0x97, 0x93, 0x4E, 0xBA, 0xE9, 0xB8, 0x67, 0xD9, 0x61,"

iv’e modded my key above for security purposes…

and i use udev rules to keep my z stick usb path persistent.

i use hassbian on a RPi3. V0.60.1

Yes I did:

groups
homeassistant dialout
homeassistant@raspberryha:~/.homeassi

Looks similar to what I have except I haven’t pinned the usb path yet. I have a hunch that is what is wrong. I need to double check what it is connected to.

I’ve confirmed: /dev/ttyACM0 is the path by running:
ll /dev/tty*
with it plugged in and removed. I will pin it with udev once I get it working the first time.

I also tried changing the ozw_config directory and contents perms to 755 from 544 and that also didn’t work.

1 Like

i’m sorry i’m all out at this point.

I figured it out reading some other topics. I had to enable serial in raspi-config. After doing that and rebooting. Home assistant recognized it.

Thanks for your help everyone. I will catalog the steps in one comment later for anyone following after.

Just as a follow up for those coming after.

This is how I got it working:

  1. Enable serial interface in raspbi-config

  2. Find the configuration folder (contains options.xml) in my case it was: /srv/homeassistant/lib/python3.5/site-packages/python_openzwave/ozw_config It will change depending on python version

  3. Plug the stick in

  4. Find out what the device is run ls -al /dev/tty* run this and take note of any that show ttyUSB#, ttyACM# or ttyAMA#.

  5. Unplug the stick and run the command again taking note of the one that disappeard

  6. Fill out the config using the above information:

    Z-Wave

    zwave:
    usb_path: /dev/ACM0
    config_path: /srv/homeassistant/lib/python3.5/site-packages/python_openzwave/ozw_config

  7. Add homeassistant to the dialout group sudo usermod -a -G dialout homeassistant

  8. Restart homeassistant

  9. Confirm the zstick shows up

  10. Create alias for the zstick following this guide https://unix.stackexchange.com/questions/66901/how-to-bind-usb-device-under-a-static-name

  11. Update config usb_path with the value you set above

  12. Restart homeassistant

3 Likes

Hi,

here is my way of enabling Aeotec Z-Stick Gen5 for centos 7 with installed Anaconda3. I use “ana” user.
Probably could be done in more elegant way but this worked for me.

Martin

add user ana and make him sudoer

sudo useradd ana
sudo passwd ana
sudo usermod -aG wheel ana

add user to dialout group

sudo usermod -G dialout -a ana

install Anaconda3 under /home/ana/anaconda3/

During the installation, allow Anaconda to path, so pip or python will call Anaconda stuff

install open zwave library

cd /home/ana
git clone https://github.com/OpenZWave/open-zwave.git
cd open-zwave
make
sudo make install

copy result to anaconda (no other libs here)

sudo cp /usr/local/lib64/* /home/ana/anaconda3/lib/

install python wrapper for openzwave

pip uninstall -y python_openzwave
pip install python_openzwave --no-cache-dir --no-deps --install-option="–flavor=git"

install home assistant

cd /home/ana
git clone https://github.com/home-assistant/home-assistant.git
cd home-assistant
python setup.py install

open user interface

hass --open-ui

I have read this entire topic, but cannot get the Z-Wave gen5 stick working.
I am using the Hass.io raspberry pi docker image. I am not able to get a full shell, so I cannot do most of the instructions here.

Is there some other way to get it working on hass.io? Or do I need to drop the RPI3 and do a manual install on some linux machine?

For docker you also need a device flag and to run it as privileged. Further you can’t do the udev rules and symlinks, you need to find out the actual dev location.