Noob - Trying to tweak "Schlage Lock Events"

One of the things that's important to my use cases is being able to tell how my door locks have been changed (e.g., knob/key lock, knob/key unlock, keypad lock, keypad(code) unlock, hub/digital lock, hub/digital unlock).

It would be sweet if these was an "attribute" on the device, but it's not.

So, some created the "Schlage Lock Events" app. That does a "subscribe" to "lock.locked" and "lock.unlocked". For my older Schlage locks, this seems to largely do the trick fine.

However, for the newest one (S2 ZW+), it appears (from the Hub logs) to be actually triggering 2 different events. The first one is a "DoorLockOperationReport" that ends up coming through to the app as "xxx was locked [digital]". However, that is followed by a "alarmv2.AlarmReport" that ends up generating an event in the log say "xxx was locked by thumb turn [physical]".

What perplexes me is that the app only gets that first "[digital]" event--I have it writing to the log and, although the device logs two things, the app only sees one. For the older non-plus locks, they only send one log message (and it is the "right" one).

For the life of me, I don't know why the code isn't seeing the second thing. I tried looking through the HE doc, but didn't find much.

Here's where it subscribes:

   subscribe(lock, "lock.locked", lockHandler)

And, here's where it starts to look at the event:

def lockHandler(evt) {
      log("Lock event: ${evt.type} : ${} : >${evt.descriptionText}<")

Here's what I see in the logs for the device itself:

  1. I unlocked it from the hub (02:05:53)
    --Garage Inside Door Lock was unlocked [digital]
    --skipped AlarmType:25
  2. I then twisted the knob (02:07:26)
    --Garage Inside Door Lock was locked [digital]
    --Garage Inside Door Lock was locked by thumb turn [physical]

But, the app only saw:

  1. Garage Inside Door Lock was unlocked [digital]

  2. Garage Inside Door Lock was locked [digital]

Whatever is happening with the device (driver?), it seems to know that "digital" is right for the 'unlock' event, so it (for whatever reason) skips the "alarmType:25" in that case.

But, in the case of the thumb-lock, it generates a second message.

And, I'm trying to figure out why that isn't being passed to the app.

I am suspecting it's because the "alarmv2" isn't a "lock.locked" or "lock.unlocked" event??

How does a noob figure out what I should be looking for (the "magic strings" to put in the subscribe call)?


As mentioned in the other thread, Subscribe for apps is documented.

Now,\ the documentation may not be enough for you to move forward if you aren't a programmer, but that is to be expected as app/device coding documentation is geared around programmers.

There are probably a 100+ user apps that are published that use subscribe, too, though if you need examples.

As I said in the other thread, I've been programming 40+ years.

It's that the documentation is missing things like how to know what that valid strings are for the "attributeName" string.

Even the document itself appears wrong, as it refers to the "handlerMethod" as a string in the call without the attributeName.

Refer to the other thread. I'm not going to repeat everything two places. :slight_smile:

alarmType:161 is a failed entry attempt. It would be great to be able to act on that as an alarm

1 Like

Download the Hubitat app