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

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!

In Habmin, go to Configuration> Things, select your lock, then select Attributes. Do you see a green checkmark for Using Security? The CONFIGURATION command class requires your lock to be securely included, so this may explain why it is not saving. You may also want to enable debug logging for the zwave binding (log:set DEBUG org.openhab.binding.zwave) to aid in troubleshooting (put it back to INFO when your done).

[EDIT: Nevermind… you already said that you can control your locks, so they must be securely included.]

Good morning,
Yep I have the same as you with regards to the checkbox, only the manufacturer, type / ID, Firmware, Neighbors and last heal time are different.

My initial thought was that the javascript is broken, but then I could see the correct values being passed through in the json (and in the rest) handover. It’s the server side that’s breaking (hence 405 error)

It’s only for this thing though… odd still is that 5iver can’t replicate yet is likely using the same template for device management (as the classes match), so it’s gotta be with my setup only…

after upgrading to 2.2 z-wave refactoring version, my ZW100MultiSensor6_BinarySensor report Triggered and untriggered for i states, but is set as an switch, have u changed it to that instead of ON OFF

I don’t know exactly what device you are referring to, but in general, the database should be the same.

Hi Chris, any idea why I’m getting my issue with not being able to save?

Aeon Labs MultiSensor 6 is the device, a motion sensor
i get this error in the log

LOG:

2017-10-03 19:30:33.470 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule ‘Alarm KontorZW100MultiSensor6_BinarySensor’: null

RULE:

rule "Alarm KontorZW100MultiSensor6_BinarySensor"
when
	Item KontorZW100MultiSensor6_BinarySensor changed to ON
then
	IntrusionCheck.apply(KontorZW100MultiSensor6_BinarySensor, "motion", intrusionTimeUntilSiren, sirenTriggeredDuration, alarmTimers)
end

FUNCTION:

val Functions$Function5<GenericItem, String,  Number, Number, Map<String, Timer>, Boolean> IntrusionCheck = [  
    item,
	type,
	untilSiren,
	sirenduration,
	timers |
	if (AlarmActivateCountdown.state != ON) {
		if (AlarmState.state.toString != "0") {
			logInfo("alarm.IntrusionCheck", "Last active sensor: " + item.name.toString)
			if (SirenTriggered.state != ON) {
				if ((gPetIgnore.members.filter[i|i.name == item.name].size == 0 && item.state == ON && AlarmState.state.toString == "2") || item.state == OPEN) {
					if (!timers.containsKey("timeUntilSirenTimer")) {
						var String intrusionZoneTemp = item.label
						timers.put("timeUntilSirenTimer" ,createTimer(now.plusSeconds(untilSiren.intValue)) [|
							timers.put("sirenTriggeredTimer" ,createTimer(now.plusMinutes(sirenduration.intValue)) [|
								SirenTriggered.postUpdate(OFF)
								IntrusionCount.postUpdate("0")
								timers.remove("sirenTriggeredTimer")
							])
							var Number intrusionCountPlus = (IntrusionCount.state as DecimalType) + 1
							IntrusionCount.postUpdate(intrusionCountPlus.toString)
							LastTriggerItem.postUpdate(type+","+intrusionZoneTemp.toString)
							AlarmTriggeredNotification.sendCommand(intrusionZoneTemp.toString)
							timers.remove("timeUntilSirenTimer")
						])
						SirenTriggerCountdown.sendCommand(ON)
						logInfo("alarm.IntrusionCheck", "Siren triggers in " + now.plusSeconds(untilSiren.intValue).toString)
					}
				} else if (AlarmState == "2") {
					logInfo("alarm.IntrusionCheck", "Ignoring sensor:"+item.name.toString+" gPetIgnore:"+gPetIgnore.members.filter[i|i.name == item.name].size.toString)
				}
			} else {
				logInfo("alarm.IntrusionCheck", "Siren triggered timer rescheduled " + now.plusMinutes(sirenduration.intValue).toString)
				gRelays.members.filter[i|i.state != ON].forEach[relay|
					Thread::sleep(250)
					relay.sendCommand(ON)
				]
				var Number intrusionCountPlus = (IntrusionCount.state as DecimalType) + 1
				IntrusionCount.postUpdate(intrusionCountPlus.toString)
				logInfo("alarm.IntrusionCheck", "Siren triggered by " + item.name.toString)
				LastTriggerItem.postUpdate(type+","+item.label.toString)
				AlarmTriggeredNotification.sendCommand(item.label.toString)
				if (!timers.containsKey("sirenTriggeredTimer")) {
					timers.put("sirenTriggeredTimer" ,createTimer(now.plusMinutes(sirenduration.intValue)) [|
						SirenTriggered.postUpdate(OFF)
						IntrusionCount.postUpdate("0")
						timers.remove("sirenTriggeredTimer")
					])
				} else {
					var Timer sirenTriggeredTimerTmp = timers.get("sirenTriggeredTimer")
					sirenTriggeredTimerTmp.reschedule(now.plusMinutes(sirenduration.intValue))
				}
				if (timers.containsKey("timeUntilSirenTimer")) {
					var Number intrusionCountPlus = (IntrusionCount.state as DecimalType) + 1
					IntrusionCount.postUpdate(intrusionCountPlus.toString)
					logInfo("alarm.IntrusionCheck", "Siren triggered by " + item.name.toString)
					LastTriggerItem.postUpdate(type+","+item.label.toString)
					AlarmTriggeredNotification.sendCommand(item.label.toString)
				} else {
					logInfo("alarm.IntrusionCheck", "timeUntilSirenTimer is not null SirenTriggerCountdown:"+SirenTriggerCountdown.state.toString + " SirenTriggered:"+SirenTriggered.state.toString)
				}
			}
		}
	} else {
		logInfo("alarm.IntrusionCheck", "Ignoring sensor:"+item.name.toString+" AlarmActivateCountdown:"+AlarmActivateCountdown.state.toString)
	}
	if (timers.containsKey("timeUntilSirenTimer")) {
		var Timer timeUntilSirenTimerTmp = timers.get("timeUntilSirenTimer")
		if (timeUntilSirenTimerTmp === null) {
			timers.remove("timeUntilSirenTimer")
			logInfo("alarm.IntrusionCheck", "timeUntilSirenTimer was null removing it!!")
		}
	}
	if (timers.containsKey("sirenTriggeredTimer")) {
		var Timer sirenTriggeredTimerTmp = timers.get("sirenTriggeredTimer")
		if (sirenTriggeredTimerTmp === null) {
			timers.remove("sirenTriggeredTimer")
			logInfo("alarm.IntrusionCheck", "sirenTriggeredTimer was null removing it!!")
		}
	}
    true
]

Sorry - I got that from your earlier message, but what version? (either the version, or the thing type should be ok).

I don’t know what the log entries are about - it sees to be related to rules, not the binding :confused:.

version 1.7 are the devices, ok ill dig deeper into the rules

sry found the problem AlarmTriggeredNotification.state was null

Sorry - I missed this, but no, I’m not sure. I guess there’s an exception being thrown in the binding (or somewhere) - is it being logged anywhere?

Only what I posted further back. It breaks on save, so the value must be getting lost somewhere on backend, I can see it being posted with my values above, but not looked at the code

Odd, it seems to be saving now?..

NPE in Karaf. Let me know if you’d like logs (I was in debug when this occurred).

Exception in thread "Thread-177" java.util.ConcurrentModificationException
        at java.util.HashMap$HashIterator.nextNode(HashMap.java:1437)
        at java.util.HashMap$ValueIterator.next(HashMap.java:1466)
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.doDynamicStages(ZWaveNodeInitStageAdvancer.java:1014)
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer.access$10(ZWaveNodeInitStageAdvancer.java:1010)
        at org.openhab.binding.zwave.internal.protocol.initialization.ZWaveNodeInitStageAdvancer$1.run(ZWaveNodeInitStageAdvancer.java:203)