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

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:

What are you doing when you get this error. I guess youā€™re saving something in HABmin given that this error is from the REST server?

What device do you have? Generally, we can probably do something - locks are actually a bit poor with the way they provide info, but the binding has some ways to provide this information (normally) but it may depend on the device.

Hi Chris,
Yes, trying to save over the -76 value fails sadly, not sure why though

Iā€™m using a yale keyfree connected lock, I believe smartthings have achieved this, will check tomorrow.

I also use a key free yale lock at my house and it is working fine. To debug more, Iā€™d need more information I think.

Itā€™s a nice lock isnā€™t it :slight_smile:

Iā€™ll get a screenshot of what Iā€™m trying to correct tonight - at the moment the ā€œshutdownā€ field has -76 as a value, and wonā€™t let me save any details as this is a required field (requires higher than 1), unfortunately it wonā€™t save and log gives the above error.

Iā€™m afraid it doesnā€™t give any more logging than that.

I noticed in my bundle list, there is both a v2.1.0.20170918 and a v2.2.0.20170926

which should I be using now? 2.2 is the later version, and you did say youā€™d be putting up a 2.2ā€¦ ?

I cleared both out from my bundle list and reinstalled from your .jar link at top, and it now lists 2.1.0.201709182108.

On the settings page, the -76 value has now gone from the shutdown field, however, it still gives server error when I try to save with:

2017-09-27 18:26:19.616 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at ā€˜things/zwave:device:d6762775:node3/configā€™ for thing ā€˜zwave:device:d6762775:node3ā€™: null

Iā€™ve been using two of them for three years, and just had the touchscreen fail on one. Unclear what the problem is, itā€™s mostly unresponsive and when it does respond, touches are not registered in the right place. For now Iā€™ve swapped the external side with a spare Iā€™ve had sitting on a shelf for the past year, awaiting our remodel to be completed.