Aeotec Z-Stick Installation

Hi All , I have followed the manual for installing HA over venv on a RPI3 . I have an Aeotec Z-stick Gen 5 , I have edited the configuration file with the USB drive and the config location per below , but I still cant see it up and running , the tail of the OZW.log is per below : ( somehting about driver) ? Any ideas :

tail: /home/homeassistant/.homeassistant/OZW_Log.txt: file truncated
2017-12-17 13:24:22.035 Always, OpenZwave Version 1.4.2586 Starting Up
2017-12-17 13:24:24.117 Info, Setting Up Provided Network Key for Secure Communications
2017-12-17 13:24:24.118 Warning, Failed - Network Key Not Set
2017-12-17 13:24:24.118 Info, mgr, Added driver for controller /dev/ttyAMA0
2017-12-17 13:24:24.118 Info, Opening controller /dev/ttyAMA0
2017-12-17 13:24:24.118 Info, Trying to open serial port /dev/ttyAMA0 (attempt 1)
2017-12-17 13:24:24.118 Info, Serial port /dev/ttyAMA0 opened (attempt 1)
2017-12-17 13:24:24.119 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2017-12-17 13:24:24.119 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2017-12-17 13:24:24.119 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2017-12-17 13:24:24.119 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2017-12-17 13:24:24.119 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2017-12-17 13:24:24.119 Detail,
2017-12-17 13:24:24.119 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x15) - FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2017-12-17 13:24:24.119 Detail, contrlr, Notification: DriverFailed

Please post the pertinent section your configuration.yaml file. I makes it easier to see a possible problem.

And make sure to use the code block format. It’s the </> button in the editor window.

Here’s mine for reference:

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

Note that I have my path fixed in udev rules

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

this was my addition to the config file

how did you determine the usb path?

Do I have a network key ? Also mine is on ACM0 after checking. I am new to HA . appreciate your support. What is the udev rules , to replace the /dev/ttyAMC0 by a name ?

the udev rule keeps the usb path persistent in case of reboots, removal, etc.

you create your own network key andpoint it to the path. you only need it for adding secure z wave devices. Which you probably will at some point.

try taking the ‘/’ off the end of your config path to see if that works. mine doesn’t have that .

I will take a look at that later on. Mine is not changing til now on reboots so should be fine with the usb path. For the config path i tried that and its still the same. I see this in hass log output as warning :

2017-12-17 13:55:25 WARNING (Dummy-22) [openzwave] Z-Wave Notification DriverFailed : {‘notificationType’: ‘DriverFailed’, ‘nodeId’: 255, ‘homeId’: 0}

I dont know if that helps.

pi@raspberrypi:/ $ ls -ltr /dev/tty*|tail -n 1
crw-rw---- 1 root dialout 166, 0 Dec 17 14:01 /dev/ttyACM0
pi@raspberrypi:/ $

Maybe you can look at the config path and ensure that the path actually contains configuration folders. I’m pretty sure I was getting similar errors when I first installed zwave and I remember it being that my config path was screwed up.

Also that should be where your network key file will be. Its the options.XML file in that location. You will have to edit that file to uncommnent out the existing network key line and edit it to put yours in.

Yes You are right. The path contains configuration folders and also the options.xml file is there. There is no a network key set. I will set it up for sure , but I want to make sure first that the device is picked up by HA and I could see it the leasst in the interface while I am not. I am not sure whats wrong. I will dig more into that and see. The options.XML contains the following though and not been touched.

<?xml version="1.0" encoding="utf-8"?>

If you look in the “states” area of home assistant (the <>), do you see anything at all related to zwave?

What do you see in the home-assistant.log?

Maybe the Z stick is bad? can you plug it into your windows PC and open it up with the AEOTEC backup utility?

I will check the status and update you . I think the stick is fine, I unboxed it two days ago. A quick question though . do I have to have the ozwcp ( openzwave control panel ) installed ??

I’m pretty sure no.

That was removed several updates ago. That functionality was merged into the “configuration” section of the HA frontend.

On a raspberry pi the Aeotec stick should be /dev/ttyACM0
Rather than using udev rules it is far easier to use by-id The device serial number will not change even if you move your configuration to a new computer.

ls /dev/serial/by-id

things look fine now , I guess i have the openzwave library missing and installed it . Yes you are right its dev/ttyACM0 . Does this mean i can add configuration.yaml /dev/usb-0658_0200-if00

since the result of ls /dev/serial/by-id is
usb-0658_0200_if00

?

I can see the zstick appearing now but things with initilaizing probing ( could be zwave sensors need to be configured : )
I will dig a bit more of adding a new zwave device and see if it appears.

Thanks

Yes you should use /dev/serial/by-id/usb-0658_0200-if00

editied to fix the path. Sadly I copied the line from the post to get the correct serial number but didn’t read that the path was wrong.

this modification has not worked. I had to put it back to /dev/ttyACM0 … I think I have to look into rule stuff to do this ?

Make sure you have the line entered correctly. If you do an
ls -l /dev/serial/by-id
you will see that they are linked files

The full path would be /dev/serial/by-id/usb-0658_0200-if00, not /dev/usb-0658_0200-if00. Here is how it looks on my Pi:

dietpi@hasspi:~$ ls -l /dev/serial/by-id/usb-0658_0200-if00
lrwxrwxrwx 1 root root 13 Dec 18 23:28 /dev/serial/by-id/usb-0658_0200-if00 -> ../../ttyACM0

/dev/ttyACM0 is the real device file. But it can change, for example if you unplug the stick and plug it back in, it might become /dev/ttyACM1. However, the by-id link (shortcut) will always be updated to point to the correct one.

I wouldn’t worry about setting up a custom udev rule if you can use the serial by-id path. A custom rule would let you name the device something like the /dev/ttyUSB-ZStick-5G instead. It’s the same as using serial by-id.

As mentioned, you need to set a network key if you want to use secure devices like locks or garage door openers. You have to create your own key, you don’t get one by default. I would recommend doing it now so you don’t have to change the configuration later. The z-wave controller docs have instructions on how to generate one: https://home-assistant.io/docs/z-wave/installation/#network-key. You could of course just copy the example I have below (which I just generated), but it’s better to make your own private one.

You shouldn’t need to set config_path unless you’re running a custom version of python-openzwave. If you do configure it and you change your virtual environment later (i.e. go from python 3.5 to 3.6) the path will no longer exist and you’ll have to fix the configuration again. I would just remove it for now until you find a reason to need it.

Example:

zwave:
  usb_path: /dev/serial/by-id/usb-0658_0200-if00
  network_key: "0x4F, 0x1F, 0xCC, 0x22, 0x33, 0x62, 0x37, 0x83, 0x24, 0x62, 0x5B, 0xCD, 0xBA, 0x9D, 0x92, 0x1A"