Here I’ll be documenting the steps I took to get a Z-Uno up and running with OpenHAB2.
The Z-Uno is a (semi) Arduino compatible device with Z-Wave built in. It now supports up to 32! channels (up from the 10 that it was initially shipped with).
See: https://z-uno.z-wave.me/technical/
After browsing a couple other posts, it looks like we’ll need to build the entire binding with the appropriate XML - you cannot just modify the XML in {userdata}/zwave like I originally had hoped.
See: Zwave Database entry for zuno and Z-Uno - Arduino Z-Wave node
Prereqs:
1: Install Java SDK https://www.oracle.com/technetwork/java/javase/downloads/index.html
2: Install Maven https://maven.apache.org/
3: Install Git https://git-scm.com/book/en/v2/Getting-Started-Installing-Git
Step 1: “Git” the ZWave Binding source:
git clone https://github.com/openhab/org.openhab.binding.zwave.git
Make sure you can build the project:
cd org.openhab.binding.zwave
mvn package
Step 2: Get the node xml from {userdata}/zwave for reference.
Step 3: Create Z-Wave Database XML
My use case is a RGB LED light strip, so I’ve implemented a few switches (for on/off and other modes) and a few dimmers (to control each color individually).
Depending on your use case, and the channels you implement, you can use exisiting device XMLs as examples. Go to https://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devices find a device; click Export > OpenHAB 2 to view a device’s DB entry.
See attached zmezuno1_0_0.xml for my DB XML as an example.
zmezuno1_0_0.xml (5.0 KB)
Step 4: Add Z-Wave Database XML to binding project source
Save the XML file from the above step to the manufacturer’s folder in source - it should already exist, as they have other products:
org.openhab.binding.zwave/ESH-INF/thing/zwaveme
Step 5: Compile binding jar
cd org.openhab.binding.zwave
mvn package
Jar will be created in the target folder.
Step 6: Add the new binding
-
If your Z-Uno was already added as a thing, delete it via the HABmin interface.
-
Uninstall the current Z-Wave binding (I did this via the terminal client):
bundle:list
Make note of the bundle ID.
bundle:uninstall <ID#>
-
Make sure you still have openhab-transport-serial installed
feature:install openhab-transport-serial
-
Stop OpenHAB
sudo systemctl stop openhab2.service
-
Add new jar to the addons folder (for my install, it is located at /usr/share/openhab2/addons)
-
Start OpenHAB
sudo systemctl start openhab2.service
Step 7: Add the appropriate items
I did this via an items file, as I’m still used to the OH1 way of doing things.
Here are my items for reference:
Switch Light_Kitchen_Cabinets "Cabinets" <light> (Kitchen,iLightSwitches) {channel="zwave:device:169497c2994:node13:switch_binary"}
Switch Light_Kitchen_Cabinets_Fade "Fade" <light> (Kitchen,iLightSwitches) {channel="zwave:device:169497c2994:node13:switch_binary1"}
Switch Light_Kitchen_Cabinets_Flash "Flash" <light> (Kitchen,iLightSwitches) {channel="zwave:device:169497c2994:node13:switch_binary2"}
Dimmer Dimmer_Kitchen_Cabinets_Green "Green [%d %%]" <light> (Kitchen,iLightDimmers) {channel="zwave:device:169497c2994:node13:switch_dimmer"}
Dimmer Dimmer_Kitchen_Cabinets_Red "Red [%d %%]" <light> (Kitchen,iLightDimmers) {channel="zwave:device:169497c2994:node13:switch_dimmer1"}
Dimmer Dimmer_Kitchen_Cabinets_Blue "Blue [%d %%]" <light> (Kitchen,iLightDimmers) {channel="zwave:device:169497c2994:node13:switch_dimmer2"}
Step 8: Add items to sitemap
Here is my sitemap for reference:
sitemap cabinets label="Cabinets"
{
Frame label="Cabinets" {
Switch item=Light_Kitchen_Cabinets
Switch item=Light_Kitchen_Cabinets_Fade
Switch item=Light_Kitchen_Cabinets_Flash
Slider item=Dimmer_Kitchen_Cabinets_Red
Slider item=Dimmer_Kitchen_Cabinets_Green
Slider item=Dimmer_Kitchen_Cabinets_Blue
}
}
Bonus:
Here is my Z-Uno sketch, if anyone wants to reference its setup vs. the process listed here:
ZUnoRGBLEDStrip.ino.txt (6.6 KB)
Just rename the above and remove the .txt; .ino isn’t a supported upload here. The sketch is only using 6 of the 10 channels that are set up, but I added the extra to more easily add functions. If you add channels to your sketch down the road, then you need to exclude the Z-Uno, then include it again.