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

I just downloaded the snapshot from http://www.cd-jackson.com/downloads/openhab2/org.openhab.binding.zwave-2.1.0-SNAPSHOT.jar
and placed it in the addons folder, after removing the regular binding.
From my 33 Zwave devices, I got 20 up and running after some time. Remainder not yet, however most are battery operated devices.
However when I check the version in karaf I see:

237 | Active | 80 | 2.1.0.201702082223 | ZWave Binding

@chris Is this the latest snapshot, or is the above link no longer valid?
Other issue is that I cannot get the Network Viewer to display. If I click the link in Habmin it does not show. With previous 2.1.0 binding it did work. Do I need to upgrade more than only the binding ?

I think I found a more recent version here:
https://openhab.ci.cloudbees.com/job/openHAB2-Bundles/lastBuild/org.openhab.binding$org.openhab.binding.zwave/

After updating it shows current date as version, and my network view also works.

It is, but itā€™s not been updated with the latest changes yet. Iā€™ll build a new version later.

This is the standard branch - not the test version with security.

http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/8

I believe this is the right device. This time they didnā€™t get as far as last time where it actually had the details identified in the attributes section, but the 014F rings a bell, and that is the model of the bulb from my Amazon purchase. If itā€™s helpful I can try to dig thru some logs and see if the old log lines referencing the device when it did recognize the details but still listed as unknown device.

Iā€™ll do a binding update of the test version this evening and then letā€™s take a look - just to make sure that thereā€™s no hang-overs from the ESH update issues over the past day or threeā€¦

After that, if problems persist, then a debug log would be good.

The reason I wanted to change to the snapshot is to be able to use the network healing.
I donā€™t have any security enabled devices.
Is network heal now also included in the standard branch ?

No - only this branch as it relies on the updated transaction management. Iā€™ll do an update of this branch this evening.

As an added update, here is a snippet of logs from a few days ago with the first download of the new security enabled binding. This discovery was able to fully identify the device (I believe) as seen from the log fully outlining the Thing type and matching to the DB entry provided above. But alas it still sat as an unknown device.

2017-02-07 22:43:18.285 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 24: Device discovery could not resolve to a thingType! 014F:4754:3038::5.8
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: ProtocolInfo
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Listening = true
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Routing   = true
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Beaming   = true
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Version   = 4
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: FLIRS     = false
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Security  = false
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Max Baud  = 40000
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Basic    = BASIC_TYPE_ROUTING_SLAVE
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Generic  = GENERIC_TYPE_SWITCH_MULTILEVEL
2017-02-07 22:43:29.067 [DEBUG] [rialmessage.IdentifyNodeMessageClass] - NODE 24: Specific = SPECIFIC_TYPE_POWER_SWITCH_MULTILEVEL

I had the same issue with a Linear GD00Z garage door opener showing up as an Unknown Device. Itā€™s:

http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/11

I downloaded the source and compiled my own to do some testing and found it had to do with the version check on the device. I noticed there was no min or max version in the database and that the device had no version. Not sure if it was correct, but I found if I modified ZWaveProduct to set versionMin and versionMax if they were null in the database, then the version checking code was skipped and it was matched. I can provide a patch if you would like. Now I just need to figure out how to make use of the Barrier command class.

Iā€™m also looking into the Kwikset deadbolt ( http://www.cd-jackson.com/index.php/zwave/zwave-device-database/zwave-device-list/devicesummary/283 )and figuring out how to detect lock/unlock using the Alarm command class. I have a hack that seems to work for me, but Iā€™m sure isnā€™t the correct way of doing it. I can provide more information regarding what happens here if you would like.

Hope that helps,

I donā€™t quite understand this. Iā€™ve got tests on this now and I just checked that with null for the version from the database, it should work ok as it sets the min/max to 0 and 255.255. Or, do you meant that this device actually doesnā€™t return a version, and this is what is causing the failure? That would be a bit strange as I think itā€™s mandatory, but then Iā€™ve found a bunch of things that are meant to be ā€œmandatoryā€, but devices are still certified :confused:

Sure - I expect itā€™s similar to what I have here with the Yale where itā€™s sending alarms when state changes (I really donā€™t understand why they chose this strategy). I donā€™t think it is too hard to process this, but itā€™s not top of my list right now. What Iā€™d suggest is to raise an issue on the issue list with your findings rather than discuss it here as it will likely get lost ;).

I wasnā€™t sure what was happening either. From looking at it, I agree the code should work. I got the following when I added in a debug line for the checks:

2017-02-10 12:02:33.506 [WARN ] [wave.discovery.ZWaveDiscoveryService] - NODE 26: Device discovery could not resolve to a thingType! 014F:4744:3030::0.0

and

2017-02-10 12:02:30.267 [DEBUG] [.binding.zwave.internal.ZWaveProduct] - Min Version didnā€™t match: 0.0.0 - 0.0.0

I think there is no version from the device. I donā€™t see a version an applicationVersion in the XML file for the Version command class for that device.

Thanks for all your work on this. :slight_smile:

I see comments in another thread saying it works ok -:

If thereā€™s no version, then the node class will return 0.0 which should work fine (the test does actually test this case and it passes the test) -:

https://github.com/cdjackson/org.openhab.binding.zwave/blob/dev-switchall-config-type/src/test/java/org/openhab/binding/zwave/test/internal/ZWaveProductTest.java#L44

So, not so sure whatā€™s up really, but it seems it should work ok. Iā€™ll update this security branch later so it would be worth trying again with this.

Sounds good. Iā€™ll take a look and see what happens :slight_smile:

1 Like

Hi @chris. Thanks for all your work with this!

Thought Iā€™d try out this new version, mainly because Iā€™ve got massive problems with ā€œdeadā€ nodes (ie nodes that the controller completely refuses to communicate with even though theyā€™re perfectly functional) and I hope theyā€™ll be happier after some healing. Iā€™ve only got one small question that I havenā€™t found the answer to in this thread: This renaming of command classes, is it completed or will there be more of it? What I mean is, if I upgrade to the snapshot version now (deleting all my Things), will I be able to upgrade to the stable 2.1 (or 2.2 or whatever) later without needing to delete everything again?

Probably not. The renaming of command classes is complete, but I also want to rename the channel names to be more systematic. This is related to the move toward dynamic channels.

Iā€™m hoping to do all the changes here before merging into the master branch, but if you use this branch now, it will likely need reconfiguration later.

1 Like

Hi @chris

Firstly, thank-you the security command classes work great. I am unable to lock and unlock my Yale lock (secure inclusion was performed on 2.0 stable binding).

However, I observed the following issues and needed to revert to the stable version:

  • Itā€™s much slower than previous implementations (including 1.7, 1.8 and 2.0)
  • The initial discovery wasnā€™t able to resolve some things. I have 6 of the same types of dimmers, some worked and some were still unknown requiring multiple restarts of the binding.
  • Some things refused to work. In the logs I could see that the command had been received but the thing never changed.
  • Some things which were the 2.0 binding could not be resolved (Fibaro Motion Sensor).

Thanks again for all your hard work on thisā€¦ let me know if you want detailed logs or for me to raise issues in GitHub.

Thanks - these are known issues and discussed above (although I know this is getting to be a long thread now ;). I need to look at the speed issue which is caused by a thread lock I think. The detection of devices should be fixed in the version I loaded last night, although the database for this version might have issues still as it is different than the main OH2 bindingā€¦

Hopefully Iā€™ll work through these issues in the coming week or two.

Cheers
Chris

Successfully added my Danalock V2 when I started to use this new binding.
Although because of exploratory testing i needed to do a complete fresh installation :slight_smile:
Now Iā€™m not able to include my lock ā€œUsing Securityā€.

Network keys are mentioned in this thread, what are those?
I havenā€™t used any, is that my mistake?

Now to something completely different, can I scan for new things from HABmin?
Thanks in advance

The network key is like your password - all security systems have a key of some sortā€¦ Itā€™s configured under the network settings in the controller thing configuration.

It probably doesnā€™t matter - if I remember correctly the binding will choose a random number if you donā€™t set one.

Thereā€™s a discovery button. In the Thing configuration menu, thereā€™s two buttons in the top of the menu - one is the discovery button (magnifying glass icon I think).

I removed some of my changes and updated to the dev-switchall-config-type branch (is that the correct dev branch?) and get the same issues. Also get it with the latest jar from the link above. In looking at this though, I now realize that my device was never successfully secure included. Not sure if that explains my above problems, but it explains why I couldnā€™t get the channel to work. I redid the inclusion with debug logging enabled. Not sure whatā€™s going on with secure inclusion. Iā€™ll try and wrap my head around secure inclusion and see whatā€™s happening. If the log or anything else would be helpful, let me know and I can post it.

Thanks