Background
This guide is for installing an AeonLabs Z-Wave Stick Gen5 usb stick on a a Raspberry Pi and integrating it into the openHAB home automation server for controlling Z-Wave devices.Steps
- Install Z-Stick on Raspberry Pi USB port - powered hub is desired
- The Z-Wave Stick is automatically detected without additional software installation. Correct detection of the USB stick can be verfied with the
lsusb
command:
pi@raspberrypi /usr/share/openhab $ lsusbBus 001 Device 002: ID 0424:9512 Standard Microsystems Corp.Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 001 Device 008: ID 0658:0200 Sigma Designs, Inc.Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp.Bus 001 Device 004: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUBBus 001 Device 005: ID 045e:00f5 Microsoft Corp. LifeCam VX-3000Bus 001 Device 006: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB
The “Sigma Designs, Inc.” device is the Z-Wave USB stick. - Now we need to find out on which path the USB stick is mounted. Using the
dmesg
command right after the USB stick has been plugged in should show the detection of a new USB device. The highlighted text of the output is important for us:
[38617.742571] usb 1-1.3.2.3: new full-speed USB device number 8 using dwc_otg[38617.846416] usb 1-1.3.2.3: New USB device found, idVendor=0658, idProduct=0200[38617.846458] usb 1-1.3.2.3: New USB device strings: Mfr=0, Product=0, SerialNumber=0[38617.854496] cdc_acm 1-1.3.2.3:1.0: This device cannot do calls on its own. It is not a modem.[38617.854648] cdc_acm 1-1.3.2.3:1.0: ttyACM0: USB ACM device - The configuration in openHAB itself is simple. We just have the define the mounted path in the Z-Wave binding section of the openhab.cfg:
zwave:port=/dev/ttyACM0 - OpenHAB doesn’t have a configuration utility for Z-Wave, so you need to install another web management tool which does – HABmin. Download the current release at the HABmin Github repository (Download ZIP buton).
- Once you’ve unzipped it, you’ll find 2 .jar files in the addons directory – these should placed in the corresponding addons directory in your OpenHAB Home share (if you’re also using the Aotec Z-Stick Gen5 , make sure the the Z-Wave binding version is 1.8 or higher).
- Ensure that the permissions are set for habmin to access these add-ons:
sudo chmod -R 555 /usr/share/openhab/addons
and
sudo chown openhab:openhab /usr/share/openhab/addons/
sudo chown openhab:openhab /usr/share/openhab/addons/ - Next, create a new folder in the webapps directory /usr/share/openhab/webapps, and called it “habmin” (lowercase is important).
- Copy the rest of the downloaded files into there.
- Change ownership of the habmin directory to openhab user:
sudo chown -R openhab:openhab /usr/share/openhab/webapps/habmin - Allow the OpenHAB user to access the modem. This is only necessary if your controller is coming up as /dev/ttyACM0, not /dev/ttyUSB*
sudo usermod -a -G dialout openhab - Now, to kick everything into action, restart OpenHAB:sudo service openhab restart
- Wait for 5 minutes then open habmin:
http://192.168.178.20:8080/habmin/index.html - Open the Configuration Tab and select the Bindings group
- Select the Z-Wave binding
- In the right panel under the Properties tab set the following:
Port = /dev/ttyACM0 (should already be populated from openhab.cfg setting)
Heal Time = 2
Enable SUC Mode =
Enable soft reset = falseOpenHAB is Master = true - Under the Devices tab the Z-Wave Stick Controller should be listed
- Click on Include to make the Stick search for other Z-Wave nodes, the stick will look for nodes for 30 seconds.
- Press the Action button on the Multisensor briefly, it will then announce itself to the Stick.
- The Sensor should then appear underneath the Stick.
Comments
Post a Comment