I am trying to write a rule to parse Alarm_Raw notification from Kwikset 916 Lock so I can update the lock status when it is changed via manual or keypad.
In zwave Logs I see the following:
<code>
[ernal.protocol.commandclass.ZWaveAlarmCommandClass] - NODE 64: NOTIFICATION report - 22 = 1, event=2, status=255, plen=0
[ernal.protocol.commandclass.ZWaveAlarmCommandClass] - NODE 64: Alarm Type = ACCESS_CONTROL (22)
[rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 64: Got a value event from Z-Wave network, endpoint=0, command class=COMMAND_CLASS_ALARM, value=255
[nding.zwave.internal.converter.ZWaveAlarmConverter] - NODE 64: Alarm converter NOTIFICATION event is 2, type StringType
[rg.openhab.binding.zwave.handler.ZWaveThingHandler] - NODE 64: Updating channel state zwave:device:32303136-3131-3033-3030-303035383136:node64:alarm_raw to
{"notification":"ACCESS_CONTROL__MANUAL_UNLOCK","level":"1","type":"ACCESS_CONTROL","event":"2","status":"255"} [StringType]
</code>
I see that it is Report 22 in the Notification Report in the zWave Debug log.
22 refers to manual unlock.
However, the channel is populated with: “ACCESS_CONTROL__MANUAL_UNLOCK”.
I have all of the lock codes (eg: 21 for manual lock, 22 for manual unlock), but I don’t have the String that is sent (eg: ACCESS_CONTROL__MANUAL_UNLOCK)
Is there anyway to get the Notification Report type (eg: 22 in the above example) in my rules for decoding Alarm_RAW ?
Platform information: Openhabian
Hardware: Raspberry Pi 4
OS: Openhabian
Java Runtime Environment: which java platform is used and what version
I’m not sure about the notification type, but for my Schlage Connect what matters is the event type. Here’s my rule, which is a simplified version of one from this post.
Basically, the odd-numbered events are locked states, and the even numbers are unlocked states. When openHAB sees an Alarm_Raw event, it reads the event code and acts accordingly.
You need jsonpath transformation if you don’t already have that installed.
rule "Update door lock status"
when
Item Door_Lock_Alarm_Raw received update
then
if (Door_Lock_Alarm_Raw.state != "")
{
switch (transform("JSONPATH", "$.event", triggeringItem.state.toString)) {
case "1", case "3", case "5" :
{
Door_Lock.postUpdate(ON)
// logInfo("Rules", "Lock updated to ON (locked)")
}
case "2", case "4", case "6" :
{
Door_Lock.postUpdate(OFF)
// logInfo("Rules", "Lock updated to OFF (unlocked)")
}
case "11" :
{
Door_Lock.postUpdate(OFF)
logInfo("Rules", "Lock is jammed, so setting lock to OFF (unlocked)")
}
}
}
end
The event codes might be different for your Kwikset lock, but I hope it helps!
If the notification code shows up on a channel that’s available to openHAB, then you can use it to trigger rules. But I suspect that it won’t be much different from what you’re doing now, and probably no faster to respond.
Out of curiousity, why do you want to avoid jsonpath?