Jump to content

pyschlage library expanded?


hart2hart

Recommended Posts

Posted

Good morning @Goose66  I was just reading about the plugin issues related to library version and supporting python version required to run it.  That prompted me to look at the public documentation for pyschlage.  I notice some methods that may have been added at some point.  With these methods (if I read correctly -- big if) could we possibly now detect unlock events and quickly get the user that unlocked it?  for example method below.  Thanks!

lasspyschlage.log.LockLog(created_at: datetime, message: str, accessor_id: str | None = None, access_code_id: str | None = None)

A lock log entry.

access_code_id: str | None= None

Unique identifier for the access code that triggered the log entry.

accessor_id: str | None= None

Unique identifier for the user that triggered the log entry.

created_at: datetime

The time at which the log entry was created.

message: str

The human-readable message associated with the log entry.

Posted

Unfortunately the newer versions of the pyschlage library require Python 3.12 or better. The latest eISY/Polisy firmware has Python 3.11. I don’t believe we can use the newer versions of the pyschlage library.

Posted
Unfortunately the newer versions of the pyschlage library require Python 3.12 or better. The latest eISY/Polisy firmware has Python 3.11. I don’t believe we can use the newer versions of the pyschlage library.

Thanks. @Goose66 I suspected that it would not be until python was updated on eISY. However, once/if that occurs, would the newer library provide features like detection of who just unlocked the door?

Going into an area I don’t know, do you think/guess will it be possible to use the updated library from another box like rpi or on eISY once the HomeAssitant extension is released to leverage those features?
Posted (edited)

I don't think retrieving the log entries is new - it appears available in the version of the API we are using. What is new since the last time you and I talked about adding this feature is the ability to pass both timestamp values and a string value to IoX with state (driver) changes to display in the Admin Console and the UD Mobile app. So we could conceivably parse the latest log entry from the API and add these two states to the node in IoX.

However, this would be for display only. You couldn't really write programs for this, unless the "unique identifier" for the user could be reduced to a, say, 8 digit hash value that you could compare in program code?

Edited by Goose66
Posted
I don't think retrieving the log entries is new - it appears available in the version of the API we are using. What is new since the last time you and I talked about adding this feature is the ability to pass both timestamp values and a string value to IoX with state (driver) changes to display in the Admin Console and the UD Mobile app. So we could conceivably parse the latest log entry from the API and add these two states to the node in IoX.
However, this would be for display only. You couldn't really write programs for this, unless the "unique identifier" for the user could be reduced to a, say, 8 digit hash value that you could compare in program code?

Thanks. If we get to that point, does it look like access_code_id could be used in programs to identity the code used to disarm?
Posted (edited)

So something like this:

Last Access Time: 2024-12-26 08:05:56
Last Access #: 63824331
Last Access Message: Unlocked by Access Code

You would have to do some testing to learn what hash codes go with what access_ids, unfortunately. The Last Access Message may contain the text name associated with the access_id, but it seems like we looked at this before and that wasn’t the case. Perhaps I can retrieve the text name and append it to the message, e.g.:

Last Access Message: Unlocked by Access Code: Goose66

Edited by Goose66
Posted

That sound good! As we discussed in the past (can't find thread or DM but recall the exchange), the ability to catch the unlock event and the Access Code (not the actual number but a representation) would be a great feature for me. 

 

With the Schlage ZWave locks these WiFi versions replaced I used a UserNumber and with that via a program then sent a Disarm security command via Envisalink (likely using NodeLink at that time).  I had a user on the lock with the Distress Code so that code could be entered on the lock to send through as Distress code to alarm monitoring.  This was a big plus when having hands full coming in door located near alarm keypad and even greater to allow entry though doors not near the keypads.

Posted

You must remember that the state here is refreshed by polling of a cloud service like every 20 seconds or so, or every minute if there’s been no activity for a while. Your not going to be able to disarm an alarm system on unlock unless it can be disarmed up to a minute after the code is entered in the lock.

What’s more, if you turn up the frequency of polling, Schlage may end up rate limiting requests or even blocking access for all users.

Posted

If you had something that triggered your program in real time, like the alarm panel or a motion sensor, the you could call the Force Update command on the lock  before checking the last access user.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing

    • No registered users viewing this page.
  • Who's Online (See full list)

  • Forum Statistics

    • Total Topics
      37.6k
    • Total Posts
      376k
×
×
  • Create New...