Testing Z-Wave binding on openHAB-2

Continuing the discussion from ZWave status under OH2:

I think the OH2 Z-Wave binding is ready for testing - thanks to those who have been helping - especially @xsnrg, @avdleeuw and @christianjwaite.

I’ve put a binary for the OH2 Z-Wave binding on the HABmin github site for ‘adventurous’ people to test - it’s not in the master branch at the moment, so you need to go here where you will find the Z-Wave JAR, the HABmin2 JAR, and also the serial transport JAR - you need them all since this is running outside of Karaf, so dependencies need to be added manually.

A few pointers about the OH2 zwave binding…

Firstly, this is new, it will therefore have bugs, and you can expect it not to work ‘properly’ - you have been warned :slight_smile:

The database is different in OH2 - the data needs to be added to the online database by uploading the node xml files - you will need to do this, and possibly manually update the data before the new devices are available. This is covered elsewhere, but you can find the database here. If you have a device that isn’t supported by the binding, then the best approach is to go to the database, search to see if the device exists (it might exist with different IDs) and if it doesn’t, create it by uploading the nodeX.xml file that OH2 generates (in the /userdata/zwave folder).

Most of the protocol layers in the biding are basically the same as OH1. I’ve tried to keep the two in sync with new command classes and bug fixes, but I will have inevitably missed something. If you find something that doesn’t work, and you know it was recently fixed/added in OH1, then please try and refer to this when you raise an issue as it will make it easier to fix.

The converters have changed significantly though - this layer translates the zwave data to openhab data, and it was quite complex in OH1. I’ve simplified it, and also brought it in line with OH2/ESH concepts. There may be bugs here as I can’t test every command class since I don’t have them all.

A few new command classes have been implemented - color, zwave-plus-info, device-reset-locally, alarm_v2/3.

Getting Started -:

Copy the files to your addons folder…

Firstly, you need to manually add the controller - in HABmin or PaperUI, you need to go to the add thing option (in HABmin, this is the Configuration | Thing Configuration menu, and click on the + at the top). Select the “Z-Wave Serial Controller” thing. You need to go to the port settings and set the COM port address.

You should soon see a bunch of new things being found - click on the ADD button, and hopefully things will work ok! If the node name isn’t a real name (e.g. instead of device name it shows the Type and ID) then it means the device isn’t detected in the database and we need to work this out… It should still generate the XML files, so we need to feed them into the database. If you’re unsure about what to do here, then please discuss it so we can get this right - once this gets sorted for a device, hopefully everyone else will be able to use the device very easily…

Once the things are generated, the channels and items should also be generated automatically. If this doesn’t work as you expect, then we likely need to sort this out in the database.

Hot tip - if you creating sitemaps, you can use HABmin to copy the item names (since they can be long!). Hover the mouse over the channel name (in thing config, channels), and after a second or so a button will appear - click on this and the item name is copied to clipboard).

Any issues, please let me know (of course :wink:) and I’ll try and sort things out. There will no doubt be some issues, especially as people start to work with devices that I don’t have…



And what @chris always forget to mention :grinning:: if you are downloading files from github choose the raw download, otherwise you could get a corrupted file :sunglasses:

1 Like

Absolutely - I was thinking I must mention that when I was writing the message as well :blush:. Thanks.

If the file sizes aren’t around 500k for zwave, and 4MB for HABmin, then there’s something wrong with the download…

Very exciting!
But somehow the serial binding comes up as a “doc” file!

Renaming to .jar doesn’t seam to help - I get no serial thing to select.

Ooops - my bad - I renamed it to doc to get through email filters, but this shouldn’t matter (as best as I can tell, OSGi doesn’t care about the extension and it should run with .doc)…

What do you mean exactly? The serial transport won’t impact this at all since the things are defined in the binding… I should also correct what I said above in that it’s actually called “Z-Wave Serial Controller”, so it might just be you’re looking in the wrong place (sorry - I’ll edit the instructions above).

When I do this, I am presented with a menu “select binding”, the last option is “Z-Wave Binding”. If I select this, I get to step two “Select thing type …” But here, there are no thing to select.

Am I in the wrong place again? :slightly_smiling:

Edit: This after I press ‘+’ in the items configurations menu…

I think you’re in the right place - are you using HABmin or PaperUI (I don’t tend to use PaperUI so I’m not sure what it does)…

What you should see is below (but the controller is obviously toward the bottom)…

Let me just check that there’s no problem with the database as I imported some new XML files this morning, and annoyingly if there’s a problem with any XML file in any binding, then no ‘thing database’ for any binding is available…

Ah! OK, then it might be that I have not correctly added a device to my new aeon gen 5 stick. But I read the instruction as that I had to select com port etc for the aeon, which I haven’t. Maybe it is magic.

I will make sure that I have some zwave members on the new stick.

It looks like there’s an error somewhere with the database import I did this morning… Let me work out what’s up :frowning:

I’ve recompiled, and it now seems to work again, so I’m not sure if there’s something strange going on, or if my build environment has an issue earlier… Please give it a go now and see if it’s ok…

I’m afraid I see no difference at my end; I stopped oh2, removed the three previous jars, and downloaded all three. Restarted oh, and habmin still have no items.

Are there any other dependencies that I might be missing?

There shouldn’t be… Are you using a recent version of OH2, or is it a few weeks old? If it’s new, then I guess the next thing is to look in the log - or in the Karaf console - to see if there’s any errors…

@xsnrg is running this version ok, so I don’t think it’s the binding itself (although I stand ready to be corrected :sunglasses:).

I’m using beta2, which is about a week old. Should I go for a nightly instead?
Log give me absolutely nothing - just a info about habin started. I have some http errors which have had for some time. But iirc these database items are compiled in, so I guess http binding is not needed?

Can you tell me how to bring up karaf console?

I just tried last oh2 snapshot, still the same.

It might be worth doing - mine is from the 7th Feb - I forget what changed when in the core, but at least this might rule this out.


It should start when you start up OH2. If you’re running it as a service, then you probably need to run in debug, and then telnet in to port 5005. From there, you can do things like “log:set debug org.openhab.binding.zwave” and “log:display zwave”…

Hmmm - ok, let’s take a step back to make sure I understand…

You’re running HABmin, and you go to Thing Configuration menu, then click on the + button at the top and you get the list of bindings. Z-Wave is included, and when you click on this you get the “Add New Thing Wizard” (as in the image I showed above), but with no devices listed? Is that correct?

1 Like

OK, so this is the console that I have been using… Didn’t know it was karaf… :slight_smile:

But atleast I now got something;
`log:display zwave
17:09:19.303 [DEBUG] [org.openhab.binding.zwave ] - BundleEvent STARTING - org.openhab.binding.zwave
17:09:19.304 [DEBUG] [inding.zwave.internal.ZWaveActivator] - ZWave binding started. Version
17:09:19.305 [DEBUG] [org.openhab.binding.zwave ] - BundleEvent STARTED - org.openhab.binding.zwave
17:09:19.307 [DEBUG] [org.openhab.binding.zwave ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.core.thing.binding.ThingHandlerFactory}={component.name=org.openhab.binding.zwave.internal.ZWaveHandlerFactory, component.id=177, service.id=297, service.bundleid=188, service.scope=bundle} - org.openhab.binding.zwave
17:09:19.310 [DEBUG] [org.openhab.binding.zwave ] - FrameworkEvent ERROR - org.openhab.binding.zwave
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zwave [186]
Another singleton bundle selected: osgi.identity; osgi.identity=“org.openhab.binding.zwave”; type=“osgi.bundle”; version:Version=“”; singleton:=“true”

    at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1582)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.incStartLevel(ModuleContainer.java:1562)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.doContainerStartLevel(ModuleContainer.java:1533)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1476)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.container.ModuleContainer$ContainerStartLevel.dispatchEvent(ModuleContainer.java:1)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]
    at org.eclipse.osgi.framework.eventmgr.EventManager$EventThread.run(EventManager.java:340)[org.eclipse.osgi-3.10.2.v20150203-1939.jar:]

17:09:19.324 [DEBUG] [org.openhab.binding.zwave ] - ServiceEvent REGISTERED - {org.eclipse.smarthome.config.core.ConfigOptionProvider, org.eclipse.smarthome.config.core.ConfigDescriptionProvider}={component.name=org.openhab.binding.zwave.ConfigDescription, component.id=178, service.id=298, service.bundleid=188, service.scope=bundle} - org.openhab.binding.zwave

You’re running HABmin, and you go to Thing Configuration menu, then click on the + button at the top and you get the list of bindings. Z-Wave is included, and when you click on this you get the “Add New Thing Wizard” (as in the image I showed above), but with no devices listed? Is that correct?


This is likely the problem… You are running two copies of the zwave binding I think…

In the console, type list and check if there are two zwave bindings running (or -: “list | grep ZWave”). If so, stop one of the (stop XXX, where XXX is the bundle ID for the old version).


It looks like this;
185 | Active | 80 | | HABmin User Interface 186 | Installed | 80 | | ZWave Binding 187 | Active | 80 | | openHAB Serial Transport Bundle 188 | Active | 80 | | ZWave Binding

  • so the oldest seams to be installed. If I do stop on it, nothing happens.