OH2 Z-Wave refactoring and testing... and SECURITY

I don’t want to cast suspicion in a wrong direction, but just for giggles - do you have any other devices included in your ZWave network already? Or is this the first device you’re attempting to add in?

If you have other devices, and it’s a relatively small number - you might like to try a hand at clearing your controller, and starting fresh. A few of us have had a similar experience where we’re unable to securely include devices when there are other devices already included. May not be the case for you, but if you find this to be the case as well, I think we might have enough of a quorum to try and find out what is the same/different between us.

Hmm, yes I’ve run into that too. Once I include a non-secure device I can no longer include a secure device… except with the version of the binding I’m running.

Anyways, even if I get secure inclusion working once I switch to a new version of the binding the security on the locks stops working. It’s annoying because I don’t really see a reason why in the code, just the xml.

Apparently I’m missing something somewhere…I have installed the new binding as described, it is working…I put the controller into inclusion mode, and added my linear garage door opener, but its not included in the security network so I can’t access it. How do I find the network key? And how do I get this info to the linear device?

In Habmin, enable Tools> Advanced Settings, find your controller and look under Z-Wave Network Settings to add/change/remove your key. Changing the key will require reincluding your secure devices.

Do I just make up anything here, or is there a specific way the key should be formatted?

There is some detail here with a handy link for generation of random hex:

Use 16 pairs of random hex numbers (00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF).

I just upgraded from OH 2.1 Snapshot using the zwave package at the top of this topic in my addons directory to OH 2.2 build #1000 and I am getting the following log messages when starting OH.
Does anyone have an idea what I may have missed during the OH2.2 package update/upgrade?

2017-08-04 00:08:55.556 [ERROR] [org.openhab.binding.zwave ] - FrameworkEvent ERROR - org.openhab.binding.zwave
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zwave [9]
Another singleton bundle selected: osgi.identity; osgi.identity=“org.openhab.binding.zwave”; type=“osgi.bundle”; version:Version=“2.2.0.201708020845”; singleton:=“true”

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

Did you previously install a zwave binding through PaperUI or addons.cfg? If so, they need to be uninstalled.

1 Like

previously my zwave binding was installed in the installed in the openhab2-addons directory and not PaperUI, before I upgraded to OH2.2 snapshoot I removed the zwave binding from the -addons dir. Then I upgraded to OH2.2 snapshoot and installed the zwave buinding from PaperUI. I believe this is the recommended procedure?

To use this refactored/development version of the Z-Wave binding, you should not have the “mainstream” version installed.

Uninstall the Z-Wave binding that comes with the OH2 distribution from PaperUI and then deploy manually the *.jar from the link in the first post of this thread.

See also: post #6 & post #11 & post #1314

I have the 2.2-SNAPSHOT.jar installed build #1000. I read in this post that the 2.2 zwave binding included changes from the zwave dev binding that you are suggesting. I could try to uninstall via PaperUI my current zwave binding however, I am certin after I manually deploy the test zwave binding you specified in the link that it will not work b/c it is a 2.1 binding. feel free to correct me if i am wrong. I just want to make sure you are understanding i am running OH2.2
Thanks, David

It will work. I am running 2.2.0 snapshot with this test binding.

whoops, thanks for the post #1314. you are correct I somehow still have my old zwave binding installed:

OpenHAB
2.2.0-SNAPSHOT
Build #1000

openhab> bundle:list -s |grep -i zwave
9 | Installed | 80 | 2.1.0.201707291849 | ZWave Binding | org.openhab.binding.zwave
212 | Active | 80 | 2.2.0.201708020845 | ZWave Binding | org.openhab.binding.zwave

The refactored/development version of the Z-Wave binding includes several improvements (like security support, mesh healing, etc) versus the “mainstream” one included in the OH2.x distribution. Chris has listed these features in post #1

The “mainstream” version of the Z-Wave binding included in the OH 2.2.x snapshot does not cover these new features. It does include the latest Z-Wave database info for devices.

The 2.1 binding will work on your 2.2 snapshot core. The bindings don’t have to be the same version as the core.
For example, you could have a 1.x version binding working in OH 2.2.x (where x = snapshot build). Same applies to 2.x bindings.

What may? not work is a 2.2.x snapshot version of a binding on top of an older core like 2.0.0 (because the old 2.0.0 core may not include additional enhancements that would be required for a newer binding).

I was going to reply with the same info :slight_smile:, but not sure if the internationalization changes that went in recently might have changed that.

bundle:uninstall 212

1 Like

that did it, thanks everyone :slight_smile:

1 Like

No - database changes will have no impact on security. This will only change the type of a notification, but if you can’t securely include a device, then this will not matter.

The only reason I can think of to cause this is if you aren’t retaining settings following the update, and the security key is changing.

The binding is tolerant to many different formats. Fundamentally it needs 16 hex values -:
0x11 0x22 0x33…
11,22,33
11 22 33
0x11,0x22,0x33
112233

It should reformat it for consistency, but should accept any of the above formats, and possibly some other variants.

I’ve made a small update to the binding to add a delay between the end of inclusion, and the start of key exchange (ie secure inclusion). I’d appreciate if people could give it a go if you’re having problems with secure inclusion - feel free to post a log on a ticket on my website.

I’m not sure that this will help, but it’s worth a try…

@Chris, What do you mean by that? I thought something similar since it said the nonce’s were unknown, but after checking the correct key is set in habmin.

Also, I’ve installed 2.1.0.201708041056 version. It works!!! The locks started securely and are working.

@Chris, you’re my hero!

Simply that if the key set in the controller changes between updates, it will stop working. If the network key is removed for some reason, then the binding will select a new one - I was just wondering if this was happening for some reason…