Configuring ZWAVE on raspberry pi - Help!

I have a yale smart lock that I want to control remotely. After doing a bit of research I found that I could use Home Assistant to do this using Z-Wave. So I got a Zwave module that slots into the lock. Then followed the instructions for installing HA on the Pi. Amazingly I got it installed eventually. Now I’m looking at the HA page on my laptop. When I go to try and configure Z-Wave it asks for a path to a USB stick and a Network Key. I also read in the docs that " On the Raspberry Pi you will need to enable the serial interface in the raspi-config tool before you can add Z-Wave to Home Assistant." OK now I’m lost. 2 questions to start.

1- What is the raspi-config tool and how do I enable the serial interface with it? Where do I find the Network key?
2- And do I need to buy a USB stick with Z-wave on it? (Actually I just counted and that might be 3 questions.)

I thought this would be a cheaper option than say Smartthings, but so far I have bought a raspberry Pi, a blank USB stick, and a micro SD-card. If I now have to buy a Z-wave stick for £40 then it’s not looking like a cheaper alternative at all! Any help would be greatly appreciated. Thanks

Yea, you need something like the Aeotec Zwave stick (that’s the one I have - there are others). The up side is that if you add any more Zwave devices, the stick serves as a hub and handles them all. I have a number of devices that come through the stick.

Do your have a Rpi 3 or 4? When I upgraded to the 4, I had to go through some gymnastics to get me older stick to work with it (after working fine on the 3 - Rpi made some changes to the USB ports).

Here’s the extent of my Zwave configuration in my configuration.yaml file:

zwave:
  usb_path: /dev/serial/by-id/usb-0658_0200-if00

As you can see, it’s pretty simple (I don’t have any security devices, though). Looking at the docs, you might need that for a door lock… Here’s the link (you likely already found this):

Z-Wave - Home Assistant (home-assistant.io)

One thing I’ve found (the hard way) is that it is really important to follow this sequence when adding and deleting devices that the stick can manage:

  1. In HA, go to Configuration → Integrations
  2. Click on Configure under the Zwave integration
  3. To add a node (i.e., device), click on Add Node. This puts the stick into “pairing mode” (for lack of a better term
  4. Do whatever the device says to do to add it
  5. Click on Cancel Command

The device should now show up in the list of Nodes on that page.

I noticed there’s an option to Add Secure Node. That may make you life a little easier, but I’ve never used that.

Curious to see how this works out for you - I’m thinking of doing something similar with our locks.

@imlac The Pi doesn’t have a Z-Wave controller built in, so that’s absolutely going to be needed as @KSC mentioned.

I understand your concern over cost, it can add up, but you have to consider what, if anything, HA has to offer over your Smartthings setup. I went through a bit of the same: a full Pi kit with a case, etc, was US $120 but I already had the Aeon Gen5 stick from my last system, but then I bought another Pi as a backup in case mine failed so I could get back up right away if needed.

If I add it all up it is nearly US $300 but not only is that a far cry lower than buying a new computer for my last system (which was failing) but then the $80/year for the subscription and my ROI is pretty low. Additionally I am gaining some integrations I didn’t have before, and that is also a determining factor.

If you come over to an open source HA for the cost alone then you might be disappointed, you will always need the hardware.

Thanks for the info Kirby. Appreciate you taking the time to reply. I guess I’ll have to shell out for a Z-wave stick. I actually have a brand new Raspberry 4. So I’ll also need to limber up for some gymnastics! What is the configuration.yaml file? Where is it and how do I update it?

Thanks CO_4X4. Yeah it looks like I’ll have to wait a few years before the benefits of HA get ahead of the costs of Smartthings. I’ll get a Z-wave stick and go from there.

Oops - I forgot you’re just starting this adventure :wink:

There’s a subdirectory on your SD card called config. It has ALL the files you can change that manage and control HA. In that directory is a file called configuration.yaml that includes all the control parameters, such as the zwave configuration.

To get to those, I’ve set up a Samba Share through HA:

  1. go to the Supervisor panel (it looks like the HA icon)
  2. At the top of the screen, click on the “Add-on Store”
  3. A whole bunch of add-ons will show up
  4. Under “Official Add-ons” is the Samba Share add-on
  5. Click on that and install it
  6. Under the configuration section, you set a username and password - these are the credentials you’ll use to login to the “share”

You will then be able to find this on a Windows machine.

Alternatively, you can install the File Editor. That runs within the HA environment and will show up on the side bar of HA as a wrench icon. At the top of that panel is a folder icon - click on that and you will see the complete config directory. Click on configuration.yaml and it will open in the main window.

If you make edits, then don’t forget to save them (it’ll be a bright red disk icon on the top right.

Some suggestions on editing these files:

  • Spacing is critical - most issues seem to arise from an extra space
  • Make small changes, save the file, and then check the configuration by going to the configuration panel (gear icon on the left) and scrolling down to Server Controls. If the Check Configuration isn’t prominantly at the top of that page, then you have to enable it by following these instruction: Advanced Configuration - Home Assistant (home-assistant.io)
  • Click on the Check Configuration button. That will show you if there any syntax errors in the configuration.yaml file.

Hope this helps get you going! And of course, don’t hesitate to keep asking questions - the forum is monitored by a lot of folks with immense knowledge on HA (and home automation in general).

2 Likes

Thanks again Kirby. I’ll probably be back to you once I have the Z-wave stick set up!

1 Like

Hey @imlac, welcome to the community!

Just want to jump in and give a pointer on the Aeotec stick.
The older “Z-Stick Gen5” that @KSC mentions doesn’t work directly on the Raspberry Pi 4, but will work if you connect it through an external powered USB hub. It was a weird issue with how a resistor in the Z-Stick was wired, that the Pi 4 thinks is a electrical short and powers off the port.

Aeotec released a new version of the stick called the “Z-Stick Gen5+” which, as well as adding some new z-wave features, fixes that incompatibility.
It costs the same as the old one used to, so you won’t be worse out of pocket, but just make sure when you are ordering that is is the + model you are getting, to keep things simple.

Unfortunately, they have the same model number, ZW090, but they pretty heavily advertise the Raspberry Pi 4 compatibility, so look out for that :blush:

Hi FreelancerJ. Yes that’s exactly the one I’ve ordered. It definitely says Pi4 compatible. There seems to be a never ending succession of things to do and add to get where I want to be. It’s like I’ve just nipped down to the corner shop for some coffee and eventually find myself in South America roasting Arabica beans I’ve just picked.

1 Like

Thanks, @FreelancerJ - I do have the older one, and that was a pain setting up when I upgraded to the Pi 4. Glad to know they’ve fixed that issue!

I think the biggest thing now on the “never ending” stuff is just that this is the get started point. You’re basically experiencing the onboarding cost. Once you have a Raspberry Pi, SD Card and Z-Wave Controller, those are costs that don’t come up again (well maybe the SD Card, but not for a long while).

So I’m the future when you want to add temperature sensors around your house, or convert your light switches to be smart, or add open/close sensors to your windows and/or doors, you get a zwave one of those and that’s the only cost, your Pi/Z-Wave stick just connects to them and you’re done.

And if you later find you want a piece of smart equipment around that house on Wifi or Bluetooth, home assistant will act as a hub to centralise it all in one place, rather than needing a new app or account for every new device.

So it can feel like a bit much to swallow for the “cost of entry” but it sets you up to come out ahead in the long run :blush:

Let us know if you need any help when the Z-Stick arrives, but with the steps from Kirby up there I feel like you’re gonna get it all up and running in one fell swoop anyway :slight_smile:

1 Like

So was I, I didn’t have another power point to connect a hub where I’ve got my Pi set up, so was pretty thrilled when I found they had an updated version :stuck_out_tongue:

1 Like

Well I got my zwave stick today. Went through the add integration screen for Zwave. Tried a few USB locations. It eventually liked “/dev/ttyAMA0” (I think), because Zwave now appears in my list of integrations. When I click on configure, I get to a screen with 3 functions: Start Network, Node management and OZW logs. I click on Start Network. It says Starting Z-Wave network. And just sits there. And never finishes. An hour and a half later it’s still displaying the same message. I looked at the OZW log bit and it says “Driver Failed” as the last message. Anybody have any ideas what’s wrong?

Looking at another thread, probably the /dev/ttyAMA0 location was wrong. So deleted it and redid it with /dev/serial/by-id/usb-0658_0200-if00. But it’s still just sitting there saying “Starting Z-Wave Network”.

Z-Wave discovery can take a little bit and the window will eventually time out. Two things you can try (and your first USB address was probably correct) is to give it 10-15 minutes and refresh the page or you can create automation for when Z-Wave starts to send you an email or pop up a notice in HA (use the trigger of event -> zwave.network_ready. The fact that you can see the ‘Start Network’ is a good sign.

Did you restart HA after adding your card? Do you have the stick on a powered USB hub? If you plugged the stick directly into the Pi you may have issues (most, including myself did).

The stick is plugged into the raspberry Pi. I don’t have a powered USB hub. How many other flipping things am I going to need ! The latest log has a different error now:

2021-01-13 11:16:24.589 Always, OpenZwave Version 1.4.3469 Starting Up
2021-01-13 11:16:26.301 Info, Setting Up Provided Network Key for Secure Communications
2021-01-13 11:16:26.302 Info, mgr, Added driver for controller /dev/ttyAMA0
2021-01-13 11:16:26.302 Info, Opening controller /dev/ttyAMA0
2021-01-13 11:16:26.302 Info, Trying to open serial port /dev/ttyAMA0 (attempt 1)
2021-01-13 11:16:26.303 Info, Serial port /dev/ttyAMA0 opened (attempt 1)
2021-01-13 11:16:26.305 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2021-01-13 11:16:26.306 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_MEMORY_GET_ID: 0x01, 0x03, 0x00, 0x20, 0xdc
2021-01-13 11:16:26.306 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_CONTROLLER_CAPABILITIES: 0x01, 0x03, 0x00, 0x05, 0xf9
2021-01-13 11:16:26.306 Detail, contrlr, Queuing (Command) FUNC_ID_SERIAL_API_GET_CAPABILITIES: 0x01, 0x03, 0x00, 0x07, 0xfb
2021-01-13 11:16:26.306 Detail, contrlr, Queuing (Command) FUNC_ID_ZW_GET_SUC_NODE_ID: 0x01, 0x03, 0x00, 0x56, 0xaa
2021-01-13 11:16:26.306 Detail,
2021-01-13 11:16:26.306 Info, contrlr, Sending (Command) message (Callback ID=0x00, Expected Reply=0x15) - FUNC_ID_ZW_GET_VERSION: 0x01, 0x03, 0x00, 0x15, 0xe9
2021-01-13 11:16:26.306 Detail, contrlr, Notification: DriverFailed
2021-01-13 15:03:12.742 Error, Options have been locked. No more may be added.
2021-01-13 15:03:12.742 Error, Options have been locked. No more may be added.
2021-01-13 15:03:12.743 Error, Options are already final (locked).
2021-01-13 15:03:33.009 Info, mgr, Cannot add driver for controller /dev/ttyAMA0 - driver already exists

Well, your initial investment might be a bit higher than you thought, but not really that much. The powered USB hub is because a Raspberry Pi’s USB ports don’t supply enough constant 5v power to the stick, so the powered hub fixes that for you. A minor expense of $9.00 fixes that. While your stick may seem to work at first, it’s possible that it’s not fully working.

The problem, as I understand it, is that the Pi will provided that 5v power for the stick but that it will fluctuate, and when it does then the stick doesn’t like it because it wants to be talking to the Z-Wave network constantly and needs the 5v, not 4.1 or whatever it may fluctuate to.

I went through the same growing pains of “FFS, I have to get another thing to make this work?!?”, but really the Pi + Stick + Hub was all I needed and Z-Wave was fully operational.

You are still using /dev/ttyAMA0, which is not a valid path for USB z-wave controllers.

Thanks for taking the time to reply freshcoast. In my configuration.yaml file I have zwave: “/dev/serial/by-id/usb-0658_0200-if00” and when I reset up the Z-wave integration the second time I used the same path. Where do I need to change the path from “/dev/ttyAMA0” to “/dev/serial/by-id/usb-0658_0200-if00” ?

That’s what mine set to and works fine, I know that the Z-Wave reconfigures it when it saves it to the settings, but this works:

zwave:
  usb_path: /dev/ttyACM0
  device_config: !include zwave_device_config.yaml

And translated in the core config entries it is stored as:

{
                "entry_id": "986d7981e35ad7ce5fa65a9c44fcb176",
                "version": 1,
                "domain": "zwave",
                "title": "Z-Wave (import from configuration.yaml)",
                "data": {
                    "usb_path": "/zwaveusbstick",
                    "network_key": -NONE OF YOUR BUSINESS :) -
                },
                "options": {},
                "system_options": {
                    "disable_new_entities": false
                },
                "source": "import",
                "connection_class": "local_push",
                "unique_id": null
            },