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

No I use the old version until now.

I know I need to delete all things and readd them.
Anything else that should be considered?

I actually wanted to create thing files once I switch to the new binding. (I use item files - but for things it did not go that way yet) … Any pro/cons for that?

Then I guess you will continue to use the old version unless you change. Nothing should change if there’s an updated release.

ahh alright… I thought I read sometime ago that once 2.3.0 is released the nightly version automatically comes with only the new security binding.

No (well, maybe you did read this :wink: ). I was planning this, but I’m trying to avoid multiple sets of breaking changes so I’ve not yet done the merge.

Please note that due to some ESH dependancy changes, I will be updating the version number to 2.2. Nothing else really changes, but if you cache a link anywhere, it might break.

When I do the next update, I’ll also update the link at the top of this thread.

This will be interesting… I’ve had difficulty getting rid of bindings after a jar file name change. The old binding is still cached if the jar file is just deleted. My crystal ball says there will be a few people running two zwave bindings after this update. IIRC, I think what has worked for me was:

  1. feature:uninstall org.openhab.binding.zwave in Karaf
  2. shutdown OH
  3. delete old jar file
  4. copy in the new jar with the different name
  5. restart OH

Shutting down OH may not be necessary. We shall see!

Thank you for clarifying!

Hi All: Sorry for going back to basics for a moment… I’m very very new to OH2. Integrating secure locks is essential for my overall goals - I initially added my 910 door lock using the stock binding, but commands were unsuccessful, hence why I’ve landed on this thread. I’d just like to confirm my understanding of the installation/configuration steps for Chris’ new binding so I can use, tinker and test. This thread spans a lot of time & versions, contains a lot of information, and so I just wanted to circle back and confirm my understanding with up-to-date info:

  1. Remove all things & items
  2. Uninstall Z-Wave binding
  3. Download new jar file and place in the addons folder.
    ??4.This is where I start to start to see mixed advice/instruction. Do I need to “activate” the new file somehow? Do I reboot and install the stock binding again? Do I need to issue commands in the karaf (if so, I don’t have a console at my Pi, so it looks like I need to open karaf ssh access to my local network to issue commands via putty, yes?)? Do I still need to install serial transport in OH2? ETC…
    ??5. When adding secure devices again, must you use the include functions from OH, and not with the button on my Aeotec Z-Stick Gen5? What (if anything) needs to be done manually configuring a secure key?

Any guidance is appreciated… I know this is toddler stuff…

1 and 2 are fine.

For 3, you can use the following command to load the serial driver, and this ought to start the binding -:

feature:install openhab-transport-serial

Yes. You cannot secure include with the zstick unless it is plugged in and controlled by zwave gateway software. If you read up in the thread, you’ll see discussions about secure inclusion failing at times and other software being used. This works, as long as the same key used in OH is passed to the device.

Just 16 bytes in hex (00 11 22 33 44 55 66 77 88 99 AA BB CC DD EE FF). Here is a link to a key generator that can be used to make one:
https://www.random.org/cgi-bin/randbyte?nbytes=16&format=h

The binding will also generate a random key unless it’s over-ridden…

Cool… I must have missed that due to reusing the key from OH1.

Thanks a ton - Got my lock working! I saw some chatter that this command wouldn’t be necessary in 2.x, but this and the OH initiated inclusion did the trick!

I seem to be having some trouble with user codes. My device supports 250, but I have edited the XML to only support 20 so it does not cause a hangup in Habmin. While I can SEE my user codes, any attempt to change or add within Habmin results in a “pending” state. This pending state I believe is normal at first because the lock is a battery operated device. However, that pending state has still been in effect for 4 days and no changes have been made to the lock. The lock has most definitely checked into the system as I get status updates every 30 minutes. I have also noticed in my XML that the User Codes sections shows up with negative number slots starting at slot 6 (small snippet but the negative numbers continue through 128). Happy to provide any debug log(s) necessary.

<entry>
            <commandClass>COMMAND_CLASS_USER_CODE</commandClass>
            <COMMAND__CLASS__USER__CODE>
              <version>1</version>
              <instances>1</instances>
              <versionSupported>1</versionSupported>
              <numberOfUsersSupported>20</numberOfUsersSupported>
              <userCodeList>
                <entry>
                  <int>1</int>
                  <userCode>
                    <state>OCCUPIED</state>
                    <code>REDACTED</code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>2</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>3</int>
                  <userCode>
                    <state>OCCUPIED</state>
                    <code>REDACTED</code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>4</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>5</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>-6</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>6</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>-7</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>7</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>-8</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>
                <entry>
                  <int>8</int>
                  <userCode>
                    <state>AVAILABLE</state>
                    <code></code>
                    <outer-class reference="../../../.."/>
                  </userCode>
                </entry>

Locks should respond almost immediately - although they are battery operated, they use FLIRS so there’s very little delay.

Make sure you’re using the latest version of the binding as I fixed the negative number issue recently (I’m pretty sure it’s in the current binding anyway).

I should be using the most recent version. 2.1.0.201709182108 is what I am on now.

How long ago since the device was included? If it was a few weeks, then I’d suggest to delete the XML and restart so that this is cleared out.

That fixed my negative numbers, however still not having any luck getting habmin to process user code changes. Still just sits “pending”. Trying to change it through paper UI also gives me a 500 internal sever error.

I’m afraid I’d need to see logs - otherwise it’s just guesswork as to what is happening.

Hi Chris,
I’m getting the following error:

2017-09-26 21:07:22.562 [ERROR] [ome.io.rest.core.thing.ThingResource] - Exception during HTTP PUT request for update config at ‘things/zwave:device:2dee796a:node3/config’ for thing ‘zwave:device:2dee796a:node3’: null
2017-09-26 21:07:24.087 [INFO ] [mmandclass.ZWaveDoorLockCommandClass] - NODE 3: Door-Lock config report - timeoutEnabled=true timeoutMinutes=254, timeoutSeconds=30

Note that my “Shutdown time” is giving -76 and won’t update, it means that I can’t save any settings… I believe you mentioned deleting an XML file? where is this file located?

Update:
I deleted the xml files in /var/lib/openhab2/zwave, however the -76 number remains and I still get the same error 500 message

also, my options for the door are:

  • Lock the door,
  • Show battery percentage
  • Alarm

When the door is unlocked by keypad, the lock function only OPENS the door, but can’t close it regardless of which way the switch is pressed.

Also opening the door from they keypad, doesn’t change the status on open hab? Is there any way for a live update on the door status? Would be awesome if we could have the status updated on the switch, as well as a notification of who opened the door :wink: :wink:

Really happy with this so far :slight_smile: