Zwave things syntax?

Playing now with OH 2.5.5 and PaperUI for a few weeks with a couple of things successfully.
I want to convert to .things configuration files, but I can’t find authoritative documentation, nor good/simple example .things files from which I could deduce the syntax.

I’ve been relying on the openhab.log file to tell me syntax errors and I’m using the “things show” console command as a reference about my thing configuration I’ve done in PaperUI.

The best approximation of my switch thing which I was able to come up with so far is this:

Thing zwave:device:88748295:node3 "MySwitch" (zwave:serial_zstick:88748295) [
    node_id = 3
] {
    Channels:
        Type switch_binary : switch_binary
}

“things show” says

UID: zwave:device:88748295:node3
Type: zwave:device
Label: MySwitch
Status: ONLINE
Bridge: zwave:serial_zstick:88748295

Properties:
    zwave_class_basic : BASIC_TYPE_ROUTING_SLAVE
    zwave_class_generic : GENERIC_TYPE_SWITCH_BINARY
    zwave_neighbours : 
    zwave_frequent : false
    zwave_version : 1.25
    zwave_listening : true
    zwave_deviceid : 12337
    zwave_nodeid : 3
    zwave_routing : true
    zwave_beaming : true
    zwave_secure : false
    zwave_class_specific : SPECIFIC_TYPE_POWER_SWITCH_BINARY
    zwave_manufacturer : 99
    zwave_devicetype : 20304

Configuration parameters:
    switchall_mode : 255
    node_id : 3

Channels:
    ID: switch_binary
    Label: Switch
    Type: zwave:switch_binary

But it’s not working when I attach an item to the channel.

Also, PaperUI did set the Type field to “zwave:ge_45604_00_000”, whereas now it’s “zwave:device”.
Not sure whether it matters and how I would define it in the .things file.

Welcome to the community!

I’d agree that the documentation is a little sparse, but before we go there I’m wondering why you want to convert over to .things files if you’ve got ZWave working through PaperUI. There’s nothing wrong with doing so, but if you’ve only been using OH for a short period of time then that might be something to come back to later on. I personally found it a lot easier to wrap my head around things after I was much more comfortable with channels and items. Personally, I only use .things files for devices that can’t be discovered by PaperUI.

Cheers!

I personally really like the files as well as it allows me to automate changes across multiple systems.
Max, you need to define a bridge thing as well on which your devices will depend. The format is:

Bridge zwave:serial_zstick:controller "ZWave Controller" [ port="/dev/ttyACM0", controller_softreset="false", controller_master="true", heal_enable="true", security_networkkey="xxx" ]
{
	aeon_zw100_01_008 sensor1 "Sensor 1" [ node_id=2 ]
	aeon_zw111_00_000 bedroomSwitch "Bedroom" [ node_id=4 ]
}

where serial_zstick is your zwave controller type (and xxx your matching key). aeon_zw100_01_008 is a sample device type.

Hope this gets you to the finish line :slight_smile:

1 Like

Hi Russ, I found the PaperUI OK for experimentation, but for scaling up the number of things (as a software engineer) I prefer text files :wink: Fewer clicks and I’ll version-control them with Git.

Makes total sense to me.

Stick around long enough and you’ll eventually witness a debate between users who think everything should be in a GUI and users who think everything should be coded by hand. I’m of the opinion that we need both so that we can serve beginners, power users, and everyone in between.

Hi Mark, thanks for your things snippet. After some more fiddling I was able to get this thing configuration to play:

Bridge zwave:serial_zstick:88748295 "Z-Wave Serial Controller" [ port="/dev/ttyUSB0", controller_softreset="false", controller_master="true", heal_enable="true", security_networkkey="..." ]
{   
    Thing ge_45604_00_000 id101 "label101" [ node_id=3 ]
}

I guess I do now understand the notion of thing types better.

You can also use the REST API to automate OH configuration. Install the REST Docs under User Interfaces to see examples & test syntax.

2 Likes

This seems of limited value in the specific zwave context, where the channels are dynamic and you are likely to end up poking around in PaperUI anyway to find them in order to link Items.

I submitted a documentation update to help with this going forward: https://github.com/openhab/org.openhab.binding.zwave/pull/1349/files

Please be aware of

1 Like

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.