You may download or clone the project from GitHub - FutureTense/lock-manager: Home Assistant Lock Manager
Many thanks to @ptdalen for his Zwave Lock Manager project, without which this project wouldn’t be possible.
I was looking for a bit simpler lock manager, as I only have one Zwave lock. If I add others, setting up a new manager would be simple with a few global replaces. Anyways, let’s take a look at one of the “codes” that I setup (Not every day of the week is displayed)
The top section is somewhat obvious. You can enter a name for the code slot, the PIN for the lock. The Notifications
input_boolean will notify
you when the code is used on the lock. The Enabled
input boolean means the system is allowed to use the PIN with your lock, however it does not mean that your code is “in” your lock.
Look at the Status
notification. When that reads Connected
, that means Home Assistant has added the PIN to the lock. If it reads Disconnected
then the code has been removed from the lock. Simply put, Connected
means the specified PIN is in the lock’s code slot at this moment
and Disconnected
means the PIN is not in the lock at this moment
.
Each code has it’s own automation that is triggered whenever it’s status notification changes. That automation adds or removes the PIN from the lock. By using a collection of binary_sensors
it’s possible to add many different options to the lock system. Each option in the GUI has an associated binary_sensor, and those are “added” together (technically using the AND operator), so you can create some complex lock access scenarios.
I’ve added a few of them which I’ll try to describe. By default, when you setup a code, you set the name of the person using the code and the PIN. Whenever you change the PIN text, the system automatically turns of the “Enabled” input boolean. Turn the boolean on and you will have an “always active” code. Use these for your family members. The code I’m showing here is what I use for a neighbor who visits our pets when we go away. I just use the Enabled boolean to turn it on when we leave, and off when we get home.
To let someone access the lock a specifc number of times, I would enable the “Limit Access Control” boolean and use the slider to set the number of times the user can execute an “unlock” command.
Enable the Date Range and specify the Start/End dates, and the system will add the code when the system time falls between those ranges.
Below that are the “days” settings. If you want to let someone access the lock only on Monday-Friday, turn off the Saturday and Sunday booleans. Each day also has time settings. If the start and end values are the same, then the user can access the lock for 24 hours on that day. If you specify a range, the PIN can only be accessed during that time period.
Suggestions are welcome, and thanks again to @ptdalen whose code I borrowed and examined to put this package together.
See the README for installation instructions.