Zwave - Yale YRD220 Lock

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

Do you still see alarm_raw events? If so, what log entries from the rule do you see? There is a log entry at the second line of the rule, so you should at least see this, or it would appear as though the rule is not triggering. It would probably be helpful to see what modifications you’ve made to the rule.

Sorry Scott, i just updated my post. Yes,I see the raw events. The rule is posted above.

21:59:26.416 [INFO ] [smarthome.event.ItemStateChangedEvent] - FrontDoor_DoorLock_Alarm_Raw changed from {"parameter-4":"1","notification":"ACCESS_CONTROL__KEYPAD_UNLOCK","code":"99","level":"251","type":"ACCESS_CONTROL","event":"6","parameter-1":"99","parameter-2":"3","status":"255","parameter-3":"251"} to {"notification":"ACCESS_CONTROL__MANUAL_LOCK","level":"2","type":"ACCESS_CONTROL","event":"1","status":"255"}
21:59:26.427 [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

Are you using MapDB? You’ll need to use something that has historical data, or change this…

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

… to…

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

At least, I think that was what fixed it for MapDB users. :wink:

1 Like

Yes, I’m using Mapdb. It was set to influx, but ive changed it to MapDB as default. I modified the rule to remove the single occurance of

(true)

And that has removed the error but I dont see any item updates

22:27:21.831 [INFO ] [smarthome.event.ItemStateChangedEvent] - FrontDoor_DoorLock_Alarm_Raw changed from {"notification":"ACCESS_CONTROL__MANUAL_LOCK","level":"2","type":"ACCESS_CONTROL","event":"1","status":"255"} to {"parameter-4":"1","notification":"ACCESS_CONTROL__KEYPAD_UNLOCK","code":"99","level":"251","type":"ACCESS_CONTROL","event":"6","parameter-1":"99","parameter-2":"3","status":"255","parameter-3":"251"}
22:27:46.056 [INFO ] [smarthome.event.ItemStateChangedEvent] - AtticVoltage changed from 237 to 236
22:27:46.059 [INFO ] [smarthome.event.ItemStateChangedEvent] - AttickWhToday changed from 1.024 to 1.032
22:27:46.060 [INFO ] [smarthome.event.ItemStateChangedEvent] - AttickWhTotal changed from 30.544 to 30.551

But what do you see in the openhab.log? There should be log entries from the rule… possibly more errors. Your alarm_raw data also seems odd… I’ve never seen parameter stuff in mine.

If you still have Influx up, and are persisting the locks to it, then you coud also just specify the persistence type, like (this is from memory though)…

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