ZWave Manual Thing Configuration

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.

10 Likes

Awesome @chris!
Since I’m a complete noob I had some trouble grasping how to do it.
Because I have trouble maybe others have trouble so I will post to make it easier for others:
Create a file called “zwave.thing” and put it in “things” folder.
In this you write the info you gathered above.
Using Chris example:

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" ]
{
    Thing zwave:tkb_tz88_00_000:controller:node2 "ZWave Node 3: TZ88" (zwave:serial_zstick:controller) [ node_id=3 ]
    Thing zwave:fib_234_324:controller:node3 "ZWave Node 4: fibaro" (zwave:serial_zstick:controller) [ node_id=4 ]
}

If one looks carefully they can see that we have the node ID from the controller but we change it to another ID in openhab. I think this is so if we exchange one device that might be broken or if we excluded/included and get new controller ID we only need to change in one place, the things file.

Also, for windows we use different port and instead of “/dev/tty.usbmodem1421”, we use the COM port, example COM4.
If I am not correct, please tell me and I will edit my post.

2 Likes

Hi @chris,
has this change been merged in the master or snapshot version?
If not, when will it be merged?

thanks

No, it’s not. It will be merged into the master after the next release.

Hi @chris,
thanks for your reply. When is the next version likely to be released?

thanks again.

I’m not sure, but I expect maybe in a month or so…

I am trying to follow this, but I am getting:

[ERROR] [ding.zwave.handler.ZWaveThingHandler] - NodeID is not set in zwave:intermatic_ha01c_00_000:controller:node4

My *.things file looks like this:

Bridge zwave:serial_zstick:controller "ZWave Controller" [ port="/dev/ttyACM0", controller_softreset="false", controller_master="true", heal_enable="true", security_networkkey="" ]
{
    Thing zwave:intermatic_ha01c_00_000:controller:node4 "Switch" (zwave:serial_zsk:controller) [ node_id=4 ]
}

What version of the binding are running? Currently this is only supported in the development version of the binding.

I was running snapshot version, will try dev branch build

@sintei @ikir: I think your syntax was wrong. When you put things inside a bridge block, the syntax is Thing <thingTypeId> <thingId> [..]. See also: https://www.eclipse.org/smarthome/documentation/features/dsl.html#defining-bridges

So I think corrected example from @ikir would be:

Bridge zwave:serial_zstick:controller "ZWave Controller" [ port="/dev/ttyACM0", controller_softreset="false", controller_master="true", heal_enable="true", security_networkkey="" ]
{
    Thing intermatic_ha01c_00_000 node4 "Switch" [ node_id=4 ]
}

Is it possible to set the zwave thing (dimmer) configuration parameters trough a .things or other text file as well? Or can this only be done in the paper UI or habmin?

No - if you use text files you can’t set the parameters through openHAB (at the moment - hopefully in future this will be resolved as there are some changes being worked on in ESH).

Ah I did define the things trough the .things file, but I -could- set the parameters in openhab paperUI (I am using the development binding and fibaro dimmer 2). Just wondered if it was also possible to set the params in text because it would be a bit faster to set up. But I think then only trough the UI?

Unfortunately at the moment this isn’t possible. As I said, in future this will be supported - hopefully soonish.

No - this isn’t possible either (sorry).

@chris : I would like to know if it is now possible to define Z-Wave things in a config file ?
I tried without success but I am new to the Z-wave binding.

I have done several tries with 3 different parameters:

Thing zwave:nodon_msp31x1_00_000:controller:node2 "Lampe Salon" (zwave:serial_zstick:controller) [ node_id=2 ]
Thing zwave:nodon_msp31x1_00_000:controller:node2 "Lampe Salon" (zwave:serial_zstick:controller) [ zwave_nodeid="2", zwave_manufacturer="357", zwave_deviceid="3", zwave_devicetype="1", zwave_version="1.55" ]
Thing zwave:nodon_msp31x1_00_000:controller:node2 "Lampe Salon" (zwave:serial_zstick:controller) [ node_id=2, zwave_nodeid="2", zwave_manufacturer="357", zwave_deviceid="3", zwave_devicetype="1", zwave_version="1.55" ]

Unfortunately, the thing systematically remains in INITIALIZING state and I got a warning about NODEID being not set.

I am running OH snapshot build 1262 with Z-Wave binding version 2.3.0.201804230754.

PS: using the thing discovered by Paper UI, it is working well, but I would rather keep everything in config files so that I can easily edit and backup.

Yes - as described above. There are limitations with being able to configure devices, but it works if that’s what you want to do. As above though, it’s only available in the development branch - I’ll look to merge this into master in a few weeks (after 2.3 release).

This doesn’t look like a development binding version?

Ok thank you.
Can I download somewhere the development version as a jar file or should I build it from git?

Yes - read the first 6 or so messages in this thread -:

Note that you will need to delete and add back all things to transfer to this version.

Thanks a lot, I installed the development version and thing configuration from a things file seems to work.

I already included 3 devices and I have a difficulty only with the device on battery (Everspring ST814). I will come back with a question after I see what happens after few hours.

1 Like

Can you please tell me what is the syntax to set a configuration parameter in a configuration file ?
For example, for a FGD211, I would like to set config_14_1 to 1 (default is 0). When I use config_14_1=1 it is not taking into account. Maybe the problem is that this parameter is inside a parameter group named configuration. I don’t know what is the syntax to use in such a case. I tried configuration:config_14_1=1 but it is not a valid syntax.