This write-up provides a “how-to” to actually get this configuration completed for Z-Wave for those that don’t want to use the automatic configuration that the binding provides.
Z-Wave things can be configured in the same way as other OH2 bindings - for general information refer to the OH2 documentation. Note that at the time of writing, text configuration of things is only available in the development version of the binding - not the master or snapshot versions.
At the time of writing, there are around 550 devices in the Z-Wave database, so I’m not going to describe them all here ;). Rather, this is a specific example that will hopefully provide enough information to get you started.
When things are configured through the REST interface using a UI, the binding uses information it gathers from the device to decide the device type in order to ascertain the thing type. If you are manually configuring your things in a text file, then you are responsible for ensuring the correct configuration, and resolving the thing type.
Specifically, you must derive the thing-type, and the node ID in order define the thing, and from there you will need to establish the channels that the thing supports in order to define the items and the channel links.
The thing-type can be found in the Z-Wave database - find your device, and from the top of the XML file you will find the thing type definition. To view the XML from the database, find your device, and click the EXPORT button, followed by openHAB-2.
This will display the XML file, and the top of this has the thing-type.
You should note that there are occasionally multiple versions of a device where the firmware provides different functions - you need to ensure that you get the correct version for your device. One way to find your device version is to look in the XML file that OH generates - this is stored in the /userdata/zwave
folder. You should find the COMMAND_CLASS_VERSION
information and use the applicationVersion
.
Below is an example of the definition of a Z-Wave controller and a switch.
Bridge zwave:serial_zstick:controller "ZWave Controller" [ port="/dev/tty.usbmodem1421", controller_softreset="false", controller_master="true", heal_enable="true", security_networkkey="11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF 00" ]
For the node, you need to define the nodeid
.
Thing zwave:tkb_tz88_00_000:controller:node2 "ZWave Node 3: TZ88" (zwave:serial_zstick:controller) [ node_id=3 ]
You then require the channel-type in order to define the item and channel link. Again, this is defined in the database XML -:
The channel type is used to build the link as defined in the documentation.
Below is an example of linking an item to the switch in node 3.
Switch Switch_ZWave_Node3 "TZ88 Switch" { channel = "zwave:tkb_tz88_00_000:controller:node3:switch_binary" }
The allowable item type for each channel is defined in the channel configuration file in the binding. This link provides the live version used in the binding so should be up to date.