ZWave JS and ZStick 7

I am a new user coming from SmartThings. I have over 100 Zigbee and 100 ZWave devices. My question in this thread is realted to getting ZWave JS up and running using the new ZStick 7 from Aeotec. On their site they showed how to get it running with ZWave JS to MQTT so I thought it was fully supported, however when I tried installing it using the regular ZWave JS integration it would not auto-generate the 16bit network key.

While instructions state to use /dev/ttyUSB0 (or whatever is applicable for your system), I also read that it is better to use the one with the device id so that if the stick gets moved the system will still be able to find it. Therefore I used this:

  /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-if00-port0

The network key was not auto populating and none of my google searches yielded any results but a few posts tipped me on the fact that the network key was in “the name” of the device or something along those lines. I looked in the same place where I found the path shown above and noticed that in several places there was a 32 chr sequence (I edited the sequence out with Xs on this post), also identified as ID_SERIAL which I am guessing is the network key. I used it and I was able to complete the installation.

Before I tear down the zwave network on SmartThings to add it to HA, can someone confirm I am on the right path?

Thanks!

DEVLINKS: >-
  /dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-if00-port0
  /dev/serial/by-path/platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0-port0
DEVNAME: /dev/ttyUSB0
DEVPATH: >-
  /devices/platform/scb/fd500000.pcie/pci0000:00/0000:00:00.0/0000:01:00.0/usb1/1-1/1-1.3/1-1.3:1.0/ttyUSB0/tty/ttyUSB0
ID_BUS: usb
ID_MODEL: CP2102N_USB_to_UART_Bridge_Controller
ID_MODEL_ENC: CP2102N\x20USB\x20to\x20UART\x20Bridge\x20Controller
ID_MODEL_ID: ea60
ID_PATH: platform-fd500000.pcie-pci-0000:01:00.0-usb-0:1.3:1.0
ID_PATH_TAG: platform-fd500000_pcie-pci-0000_01_00_0-usb-0_1_3_1_0
ID_REVISION: '0100'
ID_SERIAL: >-
  Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ID_SERIAL_SHORT: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
ID_TYPE: generic
ID_USB_DRIVER: cp210x
ID_USB_INTERFACES: ':ff0000:'
ID_USB_INTERFACE_NUM: '00'
ID_VENDOR: Silicon_Labs
ID_VENDOR_ENC: Silicon\x20Labs
ID_VENDOR_ID: 10c4
MAJOR: '188'
MINOR: '0'
SUBSYSTEM: tty
TAGS: ':systemd:'
USEC_INITIALIZED: '1775536663'

The network key is just a random set of 16 bytes that you can generate however you please. The zwave_js docs suggest this:

  1. A network key. This key is used in order to connect securely to compatible devices. The network key consists of 32 hexadecimal characters, for example 2232666D100F795E5BB17F0A1BB7A146 (do not use this one, pick a random one). Without a network key security enabled devices cannot be added securely and will not function correctly. You must provide this network key in the configuration part of the Z-Wave JS Server. For new installations, a unique default key will be auto generated for you. TIP: You could use a site like random.org to create your own random network key. Make sure that you keep a backup of this key in a safe place. You will need to enter the same key to be able to access the securely paired devices.

The zwave_js addon says this:

Option network_key
Security Z-Wave devices require a network key before being added to the network. You must set the network_key configuration option to use a network key before adding these devices.
If you don’t add a network key, it will autogenerate one for you.
To generate a network key manually, you can use the following script in, e.g., the SSH add-on:

hexdump -n 16 -e '4/4 "%08X" 1 "\n"' /dev/random

You can also use sites like this one to generate the required data:
https://www.random.org/cgi-bin/randbyte?nbytes=16&format=h

For your path, you should use this, with whatever you redacted with “x”'s added back:

/dev/serial/by-id/usb-Silicon_Labs_CP2102N_USB_to_UART_Bridge_Controller_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx-if00-port0

@rccoleman - Thank you! I guess the 32chr serial number was a happy coincidence. Unless someone can spy the serial number from outside the network, I guess I should be safe leaving that as the network key. I am not operating Fort Knoxx so I doubt someone will be eager to hack my zwave mesh network anyway. If they really want to open a door, they can more easily just kick it in.

Or break a window. Yes, the dongle serial number is probably fine to use as a network key.

1 Like