Posted by & filed under article.

If you are new to working with USB serial devices and are about to setup OpenHAB2 and configure your new Z-Stick, then you are the target audience of this post. Being new both to OpenHAB2 and USB serial devices I found it quite frustrating to configure the Z-Wave controller with OpenHAB2.


The first thing you need to know, by plugging the USB Z-Stick into a computer with a Linux operating system running will assign cause the USB to be assigned a port. When the Z-Stick is plugged inn try running:

ll /dev/ttyACM*

The wildcard is needed as the Z-Stick might be assigned to /dev/ttyACM0, /dev/ttyACM1 etc..

Okay, so this is how you locate the serial port the Z-Stick acquired, move over to OpenHAB2 and paperui. Navigate to add-ons and install the Z-Wave Binding.


When the Z-Wave Binding is install, navigate to Configurations -> Things and edit the Z-Wave Serial Controller. The only thing you need to configure is the serial port as found earlier.



Aight! Almost done. OpenHAB2 is configured, but is currently not allowed to read the USB port. You could quickly test it by doing a chmod 666 on the serial port, but dont do that. Instead edit the /etc/default/openhab2 file and add

# openHAB 2 service configuration
# Additional options for the JAVA_OPTS environment variable.
# These will be appended to the execution of the openHAB Java runtime in front of all other options.
# A couple of independent examples:
#   EXTRA_JAVA_OPTS="-Djna.library.path=/lib/arm-linux-gnueabihf/ -Duser.timezone=Europe/Berlin"

# The ports openHAB will bind its HTTP/HTTPS web server to.

Add openhab to dialout and tty.

sudo adduser openhab dialout
sudo adduser openhab tty

Now restart OpenHAB2 with “sudo service openhab2 restart” and you should see the Z-Stick Serial Controller come online.

Walk the extra mile

Yeah, I know… So much configuration when does it stop?! Well there is one more thing you can do. As I mentioned in the beginning you cant be sure that the serial port will change after a restart or if you re-plug the Z-Stick. There is a way you can fix this and that’s with the udev rules. You should checkout this site for a deeper understanding

However, this is the short version for the “Aeotec Z-Stick Gen5”.

Create a new rules file.

sudo nano /etc/udev/rules.d/usb-serial.rules

Create a new entry

SUBSYSTEM=="tty", ATTRS{idVendor}=="0658", ATTRS{idProduct}=="0200", SYMLINK+="ttyUSB-ZWAVE"

I have already found the idVendor and idProduct for Aeotec Z-Stick Gen5. Now reboot and the Z-Stick will be accessible via the symlink /dev/ttyUSB-WAVE.


Remember to update /etc/default/openhab2 and the Z-Wave Serial Controller with the symlink and you should be set.

Hope you found this helpful as I spent a lot of unnecessary time to figure out these concepts.

8 Responses to “Adding Aeotec Z-Stick Gen5 to OpenHAB2”

  1. JR

    Nice article but confused me in the end. Had me with the ttyACM0 part, but then in the pictures you went to ttyUSB0. Including the JAVA OPTS. Is that accurate?



    • olavjh

      Thanks! You will need the JAVA OPTS part. At the end I introduce ttyUSB-ZWAVE as an alias. Each time you restart the computer, z-stick may use ttyACM0 or ttyACM1. To make it more application safe, we can add rules so that ttyUSB-ZWAVE always points to the z-stick so we wont need to worry about what the z-stick will resolve to after a restart.


  2. Kent McLean

    From another home automation site, I learned that you can also identify the Z-stick by ID:
    The ID won’t change, but the link it points to (ttyAMA0 or ttyAMA1 or …) will.

  3. OCedric

    /etc/default/openhab2 edit helped a lot and the extra mile solved future issues ! Thanks dude !

    I was also confused (such as JR) because at the beginning you talk about ttyAMC0 and then you switch to ttyUSB0.

    But anyway, thanks 😉


Leave a Reply

  • (will not be published)