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.name} : >${evt.descriptionText}<")
.....
}
Here's what I see in the logs for the device itself:
- I unlocked it from the hub (02:05:53)
--Garage Inside Door Lock was unlocked [digital]
--skipped AlarmType:25 - 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:
-
Garage Inside Door Lock was unlocked [digital]
-
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)?
Thanks