How can I verify the Z-Wave network key is correctly configured?

I am troubleshooting the inclusion of a Yale lock using “add node secure” (Hassio 0.96.3). Before I get into device specific steps I might need to do (or redo), I wanted to verify that my network does, in fact, have a key correctly configured and available to use in the “add node secure” step. I have read various posts that talk about manipulating or recreating various config files (such as options.xml), but wanted to know if there is a sure fire way to identify successful configuration of the network key.

Is there something I should see in the logs … at start up, or during the inclusion process? In a config file?

I can post additional detail as needed, but wanted to first ask this question about how to establish that I have successfully configured a key. (I’m pretty confident I followed the docs’ and configuration.yaml steps correctly, so I’m thinking there is some missing tip that I have not yet found in searching the forums.).

Cheers, and thanks in advance.

Check the second line or so in OZW_log.txt It should say
Info, Setting Up Provided Network Key for Secure Communications

OK. So now I know for sure that I do not have the key setup correctly. The log is pretty clear on that. Thanks for the tip.

2019-07-22 22:46:48.879 Always, OpenZwave Version 1.4.3440 Starting Up
2019-07-22 22:47:23.006 Info, Setting Up Provided Network Key for Secure Communications
2019-07-22 22:47:23.007 Warning, Failed - Network Key Not Set

Here is my configuration.yaml, with “z” in place of actual last character.

zwave:
  usb_path: /dev/ttyACM0
  network_key: "0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x0z, 0x1z"

I am using Raspberry Pi 3 w/ AEON Labs ZW090 Z-Stick Gen5 USB stick. I did not add a key when first setting up my Z-wave network. Should I need to do anything different now that I am adding the key later, after already adding a few non-secure nodes? I have not yet “power cycled” the Pi, which I thought I might do, just for kicks, in case that is needed.

You can just continue to use the network as normal. The key only allows for encrypted communication. Just make sure the log show that the key is accepted.

The network is working fine, and I can add my lock as a non secure node, but the key is not accepted in the inclusion step, and consequently I cannot control the lock with HA. It is a Yale Assure Touchscreen 226 (shows as “Assa Abloy Yale Key Free Touchscreen Deadbolt (YRD446) Locked”). I think you have helped me determine that the key is not set up correctly, so I think I’ll try to solve that first.

A restart of the Pi (not hard power down) did not help.

Here is what my config/options.xml looks like.

<?xml version="1.0" encoding="utf-8"?>
<!-- To be effective, this file should be placed in the user data folder specified in the Options::Create method -->
<Options xmlns='http://code.google.com/p/open-zwave/'>
  <Option name="logging" value="true" />
  <Option name="Associate" value="true" />
  <Option name="NotifyTransactions" value="false" />
  <Option name="DriverMaxAttempts" value="5" />
  <Option name="SaveConfiguration" value="true" />
  <!-- <Option name="RetryTimeout" value="40000" /> -->
  <!-- If you are using any Security Devices, you MUST set a network Key -->
  <!-- <Option name="NetworkKey" value="0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10" /> -->

  <!-- Some Devices have a big UserCode Table, that can mean startup times
  when refreshing Session Variables is very long (Especialy on Security
  Devices) This option will make the UserCode CC stop on the first
  "available" usercode slot rather than retrieve every one -->
  <Option name="RefreshAllUserCodes" value="false" />
  <Option name="ThreadTerminateTimeout" value="5000" />
</Options>

I don’t know XML, but am guessing that the <! tag is a comment, since that is not my network key, and it looks like the sample from the docs.

Any further tips or suggestions are appreciated.

No need to play with the options.xml for the key.

What do you mean by this?

Try removing the lock and re-adding it as well.

If you initially setup zwave using configuration.yaml and did not set a network key, it is likely a “null” value in the config entries storage. Adding the network_key to the config file does not yet override the config entries value, so it’s unset (it will work in a future HA release). If you check the .storage/core.config_entries file and see the network_key set to an empty value, that is the problem.

To fix, you can either a) delete the ZWave integration from the UI and restart (it will auto-import the config settings including the key), or b) stop HA, edit the file .storage/core.config_entries and set the network_key value (be careful of formatting), start HA. Although it will work, I would avoid editing the options.xml file.

2 Likes

When I did “add node secure”, it added the lock, but the log had some verbiage to say that it did not obtain or accept (I forget exact words, and don’t have that log) a network key. I have since learned that the z-wave integration did not have a network key, which is the problem.

1 Like

You are on the right track, though in my case with an August Lock Pro, I had to add the network_key value in the options.xml because I never set a network key when I first configured the Z-Wave device. Setting network_key in the configuration.yaml won’t do anything since you already setup Z-Wave in Home Assistant.

Others say not to mess with options.xml, but that is what I did to fix my lock issue. First remove lock from Z-Wave network, then add the network_key to options.xml, restart Home Assistant, add Secure Node, and hope it works.

I stopped using my USB Z-Wave dongle with HA because of issues like these, so I can’t provide any detailed instructions. Best of luck to you!

Deleting the integration from the configuration menu and re-adding it auto generates a random key for you. :wink:

The @freshcoast diagnosis was spot on, but thanks to all who responded. Great example of community support - awesome that I could find the tips I needed so easily.

The z-wave section of my config/.storage/core.config_entries file did, in fact, contain a null:

            {
                "connection_class": "local_push",
                "data": {
                    "network_key": null,
                    "usb_path": "/dev/ttyACM0"
                },
                "domain": "zwave",
                "entry_id": "d55b9b3202854ce09d72782fc19f979e",
                "options": {},
                "source": "import",
                "title": "Z-Wave (import from configuration.yaml)",
                "version": 1
            },

I found that adding the key to option.xml, did work, but wanted to stay away from that, as it seems the direction going forward for this component is to have the values imported from configuration.yaml.

So I restored options.xml, and tried option (a) on a backup image. I found that it did work, but some of the entity custom names I used were lost. So tried option (b), which did seem to add the network key to my integration, however I could not add a secure node.

So I went with option (a), had to redo my custom naming, but ultimately I was able to add my Yale Assure lock as a secure node, and voila, I can now control the lock in HA.

1 Like

I managed to pair the yale but it can’t unlock.
Using Raspberry Pi 3 w/ AEON Labs ZW090 Z-Stick Gen5 USB stick

so I should edit the file

.storage/core.config_entries

p/s : do I need to remove device and re-ad again?
and input the following?

````

Thanks

Sorry for slow response. (You probably solved the problem by now!)

I looked at config_entries to diagnose the problem (saw that it contained a null), but, no, I did not fix the problem by editing that file. In my case deleting the Z-wave integration from the UI (Configuration gear icon , then Integrations, then Z-wave integration, and use the trash can icon) and restarting Home Assistant correctly imported the network key and then I could add node secure after that.

To follow what worked for me, I would first make sure you are not defining the key in options.xml and that you have it properly defined in configuration.yaml. Then you should remove the device (since it was not added securely). Then after that, remove the integration from the UI and restart. If you can now see the network key in core.config_entries, you should be able to add the lock as a secure node.

1 Like

I had the same issue when trying to add my kwikset 916 dead bolt; it would let me add it however would not let me control it. The issue lies in how the z-wave is initially setup.

If you have already set up your z-wave network and have added zwave: code to the configuration file follow these steps to fix your secure devices:

Step 1: Remove your secure devices from the z-wave network by selecting the node and clicking “remove node” (Follow each devices remove from network instructions).

Step 2: After you have removed the devices from your network. Remove the z-wave code you manually added to any configuration/option file.

Step 3: Go to Configuration>Integrations> Delete the Z-Wave Integration

Step 4: Go to Supervisor>System>Reboot

Step 5: Create a network key
(There are many ways to generate one however I just changed some of the characters of this example one I found)
0x67, 0x8b, 0x93, 0x5d, 0x84, 0x8b, 0x58, 0x31, 0x06, 0x08, 0xe9, 0xf7, 0xaa, 0x60, 0x9d, 0x5e

(Note: There should not be a z-wave integration after reboot, also your configuration files should be z-wave free at this point)

Step 6: Go to Configuration>Integration>Click “Add Integration”>Add Z-Wave>A dialog box will pop up with 2 text boxes, Path & Network Key

Step 7: For Path Enter: /dev/ttyACM0 For Network Key Enter your network key without parentheses
Example: 0x67, 0x8b, 0x93, 0x5d, 0x84, 0x8b, 0x58, 0x31, 0x06, 0x08, 0xe9, 0xf7, 0xaa, 0x60, 0x9d, 0x5e

Step 8: Start the Z-Wave network and add your devices using Add Node Secure.

For Clean installations:
Go through your initial setup then without changing any configuration files, plug in your z-wave stick and start at Step 4, above.

Google lead me here after many searches trying to recover the key for a Gen 5 Z-Stick. I found that there is a backup utility that can be run on Windows that allows you to back it up and retrieve the bytes for the key (if your key was already joined to a network):

Best of luck future Google-ers.