Zwave - Yale YRD220 Lock

I’m thinking you may want to. I can’t think of a reason why the rule would stop working. Do you have any other rules, and do they stop working too? I’m currently using build 1263 and the same rule, and I do not have this issue.

I do have other rules that work without a hitch. I will do that when I get a chance but thanks for the help. I’m still trying to make sense of why its not working and trying to see if something else is conflicting. Getting friendly with Karaf console :slight_smile: . Anyway, thanks for all your help!

@chris in doing some troubleshooting on why my locks only update initially and then fail, I put my UZB stick on a windows laptop with the Zensys tool. I noticed the below in the log. I get this each time I lock or unlock the door manually. I’m not sure if this is due to the fact that I configured the door locks from OH where it has the security key but just wanted to swing it by you to see what you think. Note I masked all the Hex code below…

02:01:01.174: Received: COMMAND_CLASS_SECURITY.SECURITY_NONCE_GET, hex data: ## ##
02:01:01.218: Received: COMMAND_CLASS_SECURITY.SECURITY_NONCE_GET, hex data: ## ##
02:01:02.376: Received: COMMAND_CLASS_SECURITY.SECURITY_NONCE_GET, hex data: ## ##
02:01:09.317: Invalid Security Encapsulated data received, Nonce not found - fake or expired RI.
02:01:09.327: Received: COMMAND_CLASS_SECURITY.SECURITY_MESSAGE_ENCAPSULATION, hex data: ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ## ##
02:01:09.339: Invalid Security Encapsulated data received, Nonce not found - fake or expired RI.

Did you also configure Zensys Tools to use the same security key that was configured in OH? IIRC, select the controller node, select Command Classes, select Security, select Set Key, enter the key (I think it needs a space at the end), and send. Sometimes it takes a couple tries before you get a success message in the log.

No I didn’t, I imagine that’s what the error is then. The good thing is that each time I opened or closed the lock I saw that message in Zensys. The bad thing is I see it most of the time with OH but not all the time. I’m still wondering if there is something with my system but nothing leads me to any errors. Guess I will try that out and report back… I will keep digging.

I would guess that the key is wrong, but I really know nothing about the Zensys tool, so I don’t really know what these log entries mean. If this comes up when you open the lock though, then the lock will try and send the status, and if I read the log correctly, the controller doesn’t like the encryption. Most likely this is because you didn’t transfer the key to the tool (again - that’s a guess as I don’t know the software at all).

So I have slowly been building my system up and added some more rules. I noticed that I have other rules that also stop working so it doesn’t seem to be related to the lock rule… I guess its a clue…

Turned out to be an issue with persistence. Once I fixed it, everything started working as expected.

1 Like

I’ve just added a Schlage BE469 with a 2.4 snapshot from a few days ago. I’m trying this rule (post 5 from @5iver) for notification which works well except for one issue with persistence:

2018-11-28 21:46:47.116 [INFO ] [eclipse.smarthome.model.script.Rules] - Lock: Alarm events: Lock_GarageAttached_Inner=[{"notification":"ACCESS_CONTROL__KEYPAD_LOCK","level":"0","type":"ACCESS_CONTROL","event":"5","status":"255"}]
2018-11-28 21:46:47.133 [INFO ] [eclipse.smarthome.model.script.Rules] - Lock: Alarm events: Lock_GarageAttached_Inner updated to ON (locked)
2018-11-28 21:46:47.139 [WARN ] [nce.extensions.PersistenceExtensions] - There is no default persistence service configured!
2018-11-28 21:46:47.141 [WARN ] [nce.extensions.PersistenceExtensions] - There is no queryable persistence service registered with the id 'null'
2018-11-28 21:46:47.144 [ERROR] [ntime.internal.engine.RuleEngineImpl] - Rule 'Lock: Update lock states after alarm_raw event': cannot invoke method public abstract org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.persistence.HistoricItem.getState() on null

I do have a persistence with mapdb for everything (at least I think I do):

Strategies {
    default = everyUpdate
}

Items {
    // persist all items on every change and restore them from the MapDB at startup
    * : strategy = everyChange, restoreOnStartup
}

I believe the error comes in from the “is no longer jammed” code (I’ll verify this later today) as that is where it tries to access the previous state of the triggeringItem:

if (transform("JSONPATH", "$.event", triggeringItem.previousState(true).state.toString) == "11"

Why would that complain? I think this is a not very common case so I can remove it without issue, but I’d like to understand why it has an issue. Is that syntax okay with the mapdb? Or has something changed in 2.4+?

thanks for any help.

Your logs says that you do not have a default persistence service configured… try setting one and see if that resolved the issue.

Thanks. I thought that a “*” in the persistence was a “default”, didn’t realize that there is a specific setting for it called Default. That problem is now solved.

Next problem is that I don’t get the raw message update when locking using the outside button. The lock state is updated, but not the raw. Any ideas on this? I don’t have debugging on; I’ll turn it on and see if anything comes in. I do get a raw message update when it is unlocked. Odd that it doesn’t work for locking.

2018-11-30 07:48:08.553 [vent.ItemStateChangedEvent] - Lock_GarageAttached_Inner changed from OFF to ON
2018-11-30 07:48:08.557 [GroupItemStateChangedEvent] - gLock changed from OFF to ON through Lock_GarageAttached_Inner

This sentence caught my eye; I’m using a * also on my persistence. Am I doing it wrong? Here’s what I got for mine, what should it be?

        // Picture Switch
		Picture* : strategy = everyChange, restoreOnStartup

Best, Jay

Only if you have a problem :slightly_smiling_face:. There’s probably nothing wrong with your persistence file (or mine, for that matter), but there’s a separate place in PaperUI where you set the default persistence. I’ve never had a problem with it being unset until I tried the rules above. I don’t know what else will go wrong without it being set. See the link that @5iver posted here. The documentation says it is “important”, so I guess it is!

This is really odd, but maybe Schlage updated the firmware… my BE469s do not update the lock state on their own. Logs would be helpful.

HI Guys,

I have YRD220, but the raw codes are only returning a type and value similar to the Kwikset codes mentioned above by ptmuldoon. Is this correct?

Hi All

Setting up a Zwave Yale lock with the rule, thanks @5iver.

Seems like a few users had this:

21:56:47.709 [ERROR] [untime.internal.engine.RuleEngineImpl] - Rule 'Lock: Update lock states after alarm_raw event': cannot invoke method public abstract org.eclipse.smarthome.core.types.State org.eclipse.smarthome.core.persistence.HistoricItem.getState() on null

I believe ive got my item names correct and my default persistence is setup.

items:


Group:Switch:OR(OFF,ON)    gLock                       "Locks [MAP(lock.map):%s]"
Switch                     FrontDoor_DoorLock              "Lock (Front Door [MAP(lock.map):%s]"     (gLock)       {channel="zwave:device:a1562d1c:node28:lock_door"}
String                     FrontDoor_DoorLock_Alarm_Raw    "Lock (Front Door): Alarm Raw [%s]"       (gLock)       {channel="zwave:device:a1562d1c:node28:alarm_raw"}
Number                     FrontDoor_DoorLock_AutoRelock   "Lock (Front Door): Alarm Raw [%s]"                     {channel="zwave:device:a1562d1c:node28:config_decimal_param2"}
Number                     FrontDoor_DoorLock_Battery      "Lock (Front Door): Battery Level [%s]"   (gBatteries)  {channel="zwave:device:a1562d1c:node28:battery-level"}

rule:

rule "Lock: Update lock states after alarm_raw event"
when
    Item FrontDoor_DoorLock_Alarm_Raw received update
then
    val actionItem = gLock.members.findFirst[ item | item.name.toString == triggeringItem.name.toString.replace("_Alarm_Raw","") ]
    logDebug("Rules", "Lock: Alarm events: {}=[{}]",actionItem.name,triggeringItem.state.toString)
    switch (transform("JSONPATH","$.type",triggeringItem.state.toString)) {
        case "ACCESS_CONTROL" : {
            switch (transform("JSONPATH", "$.event", triggeringItem.state.toString)) {
                case "1", case "3", case "5" : {
                    actionItem.postUpdate(ON)
                    logDebug("Rules", "Lock: Alarm events: {} updated to ON (locked)",actionItem.name)
                }
                case "2", case "4" : {
                    actionItem.postUpdate(OFF)
                    logDebug("Rules", "Lock: Alarm events: {} updated to OFF (unlocked)",actionItem.name)
                }
                case "6" : {
                    val StringBuilder message = new StringBuilder(actionItem.name)
                    message.append(" was unlocked with")
                    switch (transform("JSONPATH", "$.code", triggeringItem.state.toString)) {
                        case "1" : {
                            message.append(" user code 1")
                        }
                        case "2" : {
                            message.append(" user code 2")
                        }
                    }
                    logDebug("Rules", "Lock: {}",message.toString)
                    //SMS_Notification.sendCommand(message.toString)
                    //Kodi_Notification.sendCommand(message.toString)
                }
                case "11" : {
                    logDebug("Rules", "Lock: Alarm events: {} is jammed, so setting lock to OFF (unlocked)",actionItem.label)
                    actionItem.postUpdate(OFF)
                    //SMS_Notification.sendCommand(actionItem.label + " is jammed")
                    //Kodi_Notification.sendCommand(actionItem.label + " is jammed")
                }
                case "16" : {
                    val String message = actionItem.label + " keypad is disabled due to too many failed codes"
                    logDebug("Rules", "Lock: Alarm events: {}",message)
                    //SMS_Notification.sendCommand(message)
                    //Kodi_Notification.sendCommand(message)
                }
                default : {
                    val String message = "Unknown door lock Event, " + triggeringItem.state.toString
                    logDebug("Rules", "Lock: Alarm events: {}",message)
                    //SMS_Notification.sendCommand(message)
                }
            }
            if (transform("JSONPATH", "$.event", triggeringItem.previousState(true).state.toString) == "11" && transform("JSONPATH", "$.event", triggeringItem.state.toString) != "11") {
                val String message = actionItem.label + " is no longer jammed"
                logDebug("Rules", "Lock: Alarm events: {}",message)
                //SMS_Notification.sendCommand(message)
                //Kodi_Notification.sendCommand(message)
            }
        }
        case "BURGLAR" : {
            //gSiren.sendCommand(ON)
            val String message = "Intruder at " + actionItem.label
            logDebug("Rules", "Lock: Alarm events: {}",message)
            //SMS_Notification.sendCommand(message)
            //Audio_Notification.sendCommand(message)
        }
        case "POWER_MANAGEMENT" : {
            val String message = "Power Management alarm for " + actionItem.label + ", " + triggeringItem.state.toString
            logDebug("Rules", "Lock: Alarm events: {}",message)
            //SMS_Notification.sendCommand(message)
        }
        default : {
            val String message = "Unknown Type in alarmRawParser, " + triggeringItem.state.toString
            logDebug("Rules", "Lock: Alarm events: {}",message)
            //SMS_Notification.sendCommand(message)
        }
    }
    /*
        {"notification":"ACCESS__MANUAL_LOCK",                          "type":"ACCESS_CONTROL","event":"1","status":"255"}
        {"notification":"ACCESS__MANUAL_UNLOCK",                        "type":"ACCESS_CONTROL","event":"2","status":"255"}
        unlocked with zwave? event 3
        locked with zwave? event 4
        {"notification":"ACCESS__KEYPAD_LOCK",  "code":"1",             "type":"ACCESS_CONTROL","event":"5","status":"255"}
        {"notification":"ACCESS__KEYPAD_UNLOCK","code":"1",             "type":"ACCESS_CONTROL","event":"6","status":"255"}
        {"notification":"ACCESS__LOCK_JAMMED",                          "type":"ACCESS_CONTROL","event":"11","status":"255"}
        {"notification":"ACCESS__KEYPAD_LOCK",                          "type":"ACCESS_CONTROL","event":"5","status":"255"}
        {"notification":"ACCESS_CONTROL__KEYPAD_TEMPORARILY_DISABLED",  "type":"ACCESS_CONTROL","event":"16","status":"255"}
        {"notification":"BURGLAR__TAMPER_UNKNOWN",                      "type":"BURGLAR","event":"2","status":"255"}
        {"notification":"HOME_SECURITY__INTRUSION_UNKNOWN",             "type":"BURGLAR","event":"2","status":"255"}
        {"notification":"POWER__REPLACE_BATTERY_SOON",                  "type":"POWER_MANAGEMENT","event":"10","status":"255"}
        {"notification":"POWER_MANAGEMENT__REPLACE_BATTERY_SOON",       "type":"POWER_MANAGEMENT","event":"10","status":"255"}
    */
end

Hi Chris

I stopped the binding. Deleted 225 codes from the XML and restarted the binding but the UI still loads 250 and the config status updates takes ages in the log viewer for it to go from NIF to ONLINE.

What am i doing wrong :slight_smile:

Can you elaborate on what the issue was Hector? Thankyou

There should be an element in the XML that states the number of supported codes - you should change this to a smaller number, and then the binding will only download that number of codes.

1 Like

Thank you Chris