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

I have been using this build successfully on a pc for a long time, but after i moved to a esxi 5.5 vm and installed the binding again and run feature:install… i keep getting:

2017-09-29 15:34:16.980 [WARN ] [org.apache.felix.fileinstall        ] - Error while starting bundle: file:/usr/share/openhab2/addons/org.openhab.binding.zwave-2.1.0-SNAPSHOT.jar
org.osgi.framework.BundleException: Could not resolve module: org.openhab.binding.zwave [9]
  Unresolved requirement: Import-Package: com.google.common.collect
	at org.eclipse.osgi.container.Module.start(Module.java:434)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.eclipse.osgi.internal.framework.EquinoxBundle.start(EquinoxBundle.java:392)[org.eclipse.osgi-3.10.101.v20150820-1432.jar:]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundle(DirectoryWatcher.java:1253)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.startBundles(DirectoryWatcher.java:1225)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.doProcess(DirectoryWatcher.java:512)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.process(DirectoryWatcher.java:361)[4:org.apache.felix.fileinstall:3.5.6]
	at org.apache.felix.fileinstall.internal.DirectoryWatcher.run(DirectoryWatcher.java:312)[4:org.apache.felix.fileinstall:3.5.6]

when trying to start the binding, if i install the binding from PaperUI it works, and finds the usb passthrough.

Ok for any other like minded noobs out there:

I have been reading this thread as it is a similar issue to mine in that I can’t get it to register securely, and so I have had to ensure the lock is disassociated from openHAB with the following process:

  1. Send “Exclude devices” command for openhab to disassociate from software side
  2. Remove Aeotec zwave stick and unpair from door (hold 2 seconds on stick to enter unpairing mode, THEN unpair process on door)

The door then says “completed” and when searching on z-wave binding, I don’t get an insecure result for the door.

I had restarted openhab and found that for some reason version 2.2 had managed to get back on it - I guess it’s from when I did apt update / upgrade… should that really reinstall bindings?? As a result, both new and old bindings were conflicting and 2.2 (old) was presiding over the new. uninstalling and I can now get the door to connect again…

However I am now at the point where I have the on screen “-76” issue again and can’t save in settings, with the log giving:

2017-09-30 19:21:01.455 [ERROR] [st.core.internal.thing.ThingResource] - Exception during HTTP PUT request for update config at ‘things/zwave:device:48f1902c:node2/config’ for thing ‘zwave:device:48f1902c:node2’: null
2017-09-30 19:21:02.978 [INFO ] [mmandclass.ZWaveDoorLockCommandClass] - NODE 2: Door-Lock config report - timeoutEnabled=true timeoutMinutes=254, timeoutSeconds=30

As a result, I can’t manage the door at all.

I have also noticed when trying to use the “Actions” buttons (Remove / Set as failed / Reinitialise / heal device), I am getting the below error in chrome console:

TypeError: scope.configuration[scope.parameter.name].indexOf is not a function
at b.scope.updateInConfig (controllers.min.js:1)
at fn (eval at compile (angular.min.js:213), :4:551)
at e (angular.min.js:254)
at b.$eval (angular.min.js:133)
at b.$apply (angular.min.js:134)
at HTMLLIElement. (angular.min.js:254)
at HTMLLIElement.dispatch (jquery.min.js:3)
at HTMLLIElement.r.handle (jquery.min.js:3)
(anonymous) @ angular.min.js:107
(anonymous) @ angular.min.js:81
$apply @ angular.min.js:134
(anonymous) @ angular.min.js:254
dispatch @ jquery.min.js:3
r.handle @ jquery.min.js:3

This stops me from using the buttons in that section…

I think i found the cause of it not working, i had openhab2-addons & openhab2-addons-legacy installed from the repo.
When i deleted the 2 packages, it worked again

Yes, I noticed that they kept getting installed despite being stopped and uninstalled…

On a side note, I’m wondering if there is a user friendly way for users to ensure they are scanning from openhab first before scanning on the device (as that is the order it needs to go in, while not stating that is the case)… maybe a friendly message for secure devices?

Hmmm - I don’t know what that means :confused: . Can you explain this please?

I’ve put a new version of the binding here. This is a 2.2 version as mentioned a few days ago - this version also has a change to initialisation sequence. There’s now a new step that will check the Z-Wave Plus configuration and set the lifeline association group.

Hopefully this doesn’t cause any issues :wink: . If you spot any problems, please let me know and provide a log (I’m sure you all know the routine :wink: ).

One point to note is that this lifeline setting will remove any other lifeline settings (if you have the ‘master’ setting selected in the controller). It also uses the multi-channel association which will hopefully solve issues with Qubino devices.

Any issues - just shout :slight_smile: . At the moment I’ve also kept the link to the 2.1 version at the top of this thread…

1 Like

NPEs on 2.2.0.201710012139 :

Exception in thread "Thread-421" java.lang.NullPointerException
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.startPolling(ZWaveThingHandler.java:409)
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.startPolling(ZWaveThingHandler.java:435)
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.initialiseNode(ZWaveThingHandler.java:277)
        at org.openhab.binding.zwave.handler.ZWaveThingHandler.ZWaveIncomingEvent(ZWaveThingHandler.java:1278)
        at org.openhab.binding.zwave.internal.protocol.ZWaveController.notifyEventListeners(ZWaveController.java:549)
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.setCurrentStage(ZWaveNodeInitStageAdvancer.java:1124)
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.access$5(ZWaveNodeInitStageAdvancer.java:1115)
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer$1.run(ZWaveNodeInitStageAdvancer.java:201)

Will give it a whirl now and let you know tomorrow - many thanks for this :slight_smile:

With regards to my initial statement, the inclusion mode got me - newbies don’t know that for secure inclusion, openhab needs to be scanning first, THEN the device needs to be activated for search AND in close proximity, personally think a failure for secure devices shouldn’t add the device because it’s a redherring but if it can’t be avoided then that’s just how it is…

I guess a warning for users to say certain z wave devices require a process and aren’t just plug n play as the manufacturer wants you to think.

Crap - strange I didn’t see that here, but I know what this is so I’ll try and update this now…

I’ve updated this - let me know if it’s resolved this issue…

OH appears to cache the manually added bindings, and they are not removed when the file is deleted. This should work for updating to this 2.2 version:

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

This looks to have been corrected.

Thanks.

No… thank YOU!

got the update, did the same as 5iver, however I had to clear the lock with the following:

  1. clear all lock items
  2. remove lock from things
  3. run exclude devices action
  4. hard reset controller (up to this point is just to clear the lock from openhab cache)

Then rebind the lock:

  1. run inclusion mode (scan for new devices)
  2. go to lock and enter inclusion mode)
  3. hold the devices as close as possible
  4. “node #” is displayed, and lock says “completed”, refresh the scan and it now says full name - add to bundles.

I only have 1 z-wave device, so hoping I don’t have to do this for everything… :slight_smile:

unfortunately it doesn’t resolve my 2 issues within the lock settings:

  1. I can’t click the “Action” buttons, I get below in console

https://i.imgur.com/gVKcjtul.png

  1. When trying to save in the lock menu (can’t because of this “-76” and updating gives me the below error):

https://i.imgur.com/eOpcpd4l.png

This is the karaf log for there last error:

openhab> log:list
Logger │ Level
─────────────────────────────────────┼──────
ROOT │ WARN
javax.jmdns │ ERROR
org.apache.karaf.jaas.modules.audit │ INFO
org.apache.karaf.shell.support │ OFF
org.eclipse.smarthome │ INFO
org.jupnp │ ERROR
org.openhab │ INFO
org.openhab.binding.zwave │ INFO
smarthome.event │ INFO
smarthome.event.InboxUpdatedEvent │ ERROR
smarthome.event.ItemAddedEvent │ ERROR
smarthome.event.ItemRemovedEvent │ ERROR
smarthome.event.ItemStateEvent │ ERROR
smarthome.event.ThingAddedEvent │ ERROR
smarthome.event.ThingRemovedEvent │ ERROR
smarthome.event.ThingStatusInfoEvent │ ERROR

Openhab log isn’t updating with an error for this for some reason.

The console error gives:

{“error”:{“message”:“HTTP 405 Method Not Allowed”,“http-code”:405,“exception”:{“class”:“javax.ws.rs.NotAllowedException”,“message”:“HTTP 405 Method Not Allowed”,“localized-message”:“HTTP 405 Method Not Allowed”}}}

Do you experience anything different in Habmin?

I don’t have habmin installed yet - doing now :slight_smile: (Noob sorry)

I only have a few bindings on at the moment - but nothing else in habmin gets these symptoms.

Note that I can still use the locks items ((un)lock/battery check/alarm), but I can’t change any configuration.

Checking the values from that json I can see it is sending the following (and more) to

binding_pollperiod:1800
config_1_1:3
config_2_1:255
config_3_1:7
config_4_1:5
config_5_1:1
config_7_1:10
config_8_1:0
doorlock_timeout:30

I believe config_7 is the payload I’m trying to save (-76) to 10, in this case I also tried to change config_5 too

All of the functionality in PaperUI is in Habmin. Do the two issues you reported above occur in Habmin?

I’m trying to get it installed now (habmin) although there is no install instructions for habmin2?, is it the same as the original habmin?

edit - read in issue tracker it’s now in addons - got it installed fine with the habmin2 zwave module. and it doesn’t save there neither, however rest doesn’t display a error message in console, only the following:

message
eventModel.js:22 {“topic”:“smarthome/things/zwave:device:3c46bc14:node3/config/status”,“payload”:“{"configStatusMessages":[{"parameterName":"config_2_1","type":"PENDING"},{"parameterName":"config_7_1","type":"PENDING"}]}”,“type”:“ConfigStatusInfoEvent”}
eventModel.js:21 message
eventModel.js:22 {“topic”:“smarthome/things/zwave:device:3c46bc14:node3/updated”,“payload”:“[{"label":"Z-Wave Node 3: YKFCON Smart Living Keyfree Smart Lock","bridgeUID":"zwave:serial_zstick:3c46bc14","configuration":{"doorlock_timeout":30,"group_1":["node_1"],"usercode_code_20":"","usercode_code_16":"","usercode_code_17":"","usercode_code_18":"","usercode_code_19":"","usercode_code_7":"","usercode_code_8":"","config_1_1":3,"usercode_code_9":"","config_2_1":255,"usercode_code_3":"","usercode_code_4":"","usercode_code_5":"","usercode_code_6":"","config_7_1":10,"usercode_code_12":"","config_8_1":0,"usercode_code_13":"","usercode_code_1":"","usercode_code_14":"","usercode_code_2":"","usercode_code_15":"","config_3_1":7,"config_4_1":5,"config_5_1":1,"usercode_code_10":"","node_id":3,"usercode_code_11":""},"properties":{"zwave_class_basic":"BASIC_TYPE_ROUTING_SLAVE","zwave_class_generic":"GENERIC_TYPE_ENTRY_CONTROL","zwave_frequent":"true","zwave_neighbours":"1","zwave_version":"22.32","zwave_listening":"false","zwave_deviceid":"0","zwave_nodeid":"3","zwave_routing":"true","zwave_beaming":"true","zwave_secure":"true","zwave_class_specific":"SPECIFIC_TYPE_SECURE_KEYPAD_DOOR_LOCK","zwave_manufacturer":"297","zwave_devicetype":"6","zwave_lastheal":"2017-10-01T23:31:06Z"},"UID":"zwave:device:3c46bc14:node3","thingTypeUID":"zwave:yale_ykfcon_00_000","channels":[{"uid":"zwave:device:3c46bc14:node3:lock_door","id":"lock_door","channelTypeUID":"zwave:lock_door","itemType":"Switch","kind":"STATE","label":"Door Lock","description":"Lock and unlock the door","defaultTags":,"properties":{"binding::OnOffType":"COMMAND_CLASS_DOOR_LOCK"},"configuration":{}},{"uid":"zwave:device:3c46bc14:node3:alarm_general","id":"alarm_general","channelTypeUID":"zwave:alarm_general","itemType":"Switch","kind":"STATE","label":"Alarm","description":"Indicates if an alarm is triggered","defaultTags":[],"properties":{"binding::OnOffType":"COMMAND_CLASS_ALARM"},"configuration":{}},{"uid":"zwave:device:3c46bc14:node3:battery-level","id":"battery-level","channelTypeUID":"system:battery-level","itemType":"Number","kind":"STATE","label":"Battery Level","defaultTags":,"properties":{"binding::PercentType":"COMMAND_CLASS_BATTERY"},"configuration":{}}]},{"label":"Z-Wave Node 3: YKFCON Smart Living Keyfree Smart Lock","bridgeUID":"zwave:serial_zstick:3c46bc14","configuration":{"doorlock_timeout":30,"group_1":["node_1"],"usercode_code_20":"","usercode_code_16":"","usercode_code_17":"","usercode_code_18":"","usercode_code_19":"","usercode_code_7":"","usercode_code_8":"","config_1_1":3,"usercode_code_9":"","config_2_1":255,"usercode_code_3":"","usercode_code_4":"","usercode_code_5":"","usercode_code_6":"","config_7_1":10,"usercode_code_12":"","config_8_1":0,"usercode_code_13":"","usercode_code_1":"","usercode_code_14":"","usercode_code_2":"","usercode_code_15":"","config_3_1":7,"config_4_1":5,"config_5_1":1,"usercode_code_10":"","node_id":3,"usercode_code_11":""},"properties":{"zwave_class_basic":"BASIC_TYPE_ROUTING_SLAVE","zwave_class_generic":"GENERIC_TYPE_ENTRY_CONTROL","zwave_frequent":"true","zwave_neighbours":"1","zwave_version":"22.32","zwave_listening":"false","zwave_deviceid":"0","zwave_nodeid":"3","zwave_routing":"true","zwave_beaming":"true","zwave_secure":"true","zwave_class_specific":"SPECIFIC_TYPE_SECURE_KEYPAD_DOOR_LOCK","zwave_manufacturer":"297","zwave_devicetype":"6","zwave_lastheal":"2017-10-01T23:31:06Z"},"UID":"zwave:device:3c46bc14:node3","thingTypeUID":"zwave:yale_ykfcon_00_000","channels":[{"uid":"zwave:device:3c46bc14:node3:lock_door","id":"lock_door","channelTypeUID":"zwave:lock_door","itemType":"Switch","kind":"STATE","label":"Door Lock","description":"Lock and unlock the door","defaultTags":[],"properties":{"binding::OnOffType":"COMMAND_CLASS_DOOR_LOCK"},"configuration":{}},{"uid":"zwave:device:3c46bc14:node3:alarm_general","id":"alarm_general","channelTypeUID":"zwave:alarm_general","itemType":"Switch","kind":"STATE","label":"Alarm","description":"Indicates if an alarm is triggered","defaultTags":,"properties":{"binding::OnOffType":"COMMAND_CLASS_ALARM"},"configuration":{}},{"uid":"zwave:device:3c46bc14:node3:battery-level","id":"battery-level","channelTypeUID":"system:battery-level","itemType":"Number","kind":"STATE","label":"Battery Level","defaultTags":[],"properties":{"binding::PercentType":"COMMAND_CLASS_BATTERY"},"configuration":{}}]}]”,“type”:“ThingUpdatedEvent”}

Any chance you can pin this link to the top of the thread? I frequently test the updates easily found at the top since the this thread has gotten so big. Thanks!