I created an integration to provide Zigbee lock management in HA. This integration automatically creates the necessary helpers, automations, and dashboard YAML to allow anyone (who can install HACS and add /packages support in their config) to quickly setup a KeyMaster-like UI for control of user codes on a ZHA keypad lock.
Good to see this, it looks quite similar to what I’ve just written up on how I’m managing Yale Assure locks with zigbee2mqtt. Some clever person could probably combine the two.
Good timing! Given the differences here are mostly just the automations YAML and the service calls to ZHA vs Z2MQTT, it would be fairly trivial to modify this integration to support both types of locks. The flow would then create the automations based on which protocol the selected lock uses.
Adding support for syncing multiple locks would be a bit more effort.
*I also don’t have a Zigbee lock at my disposal (I prefer Z-Wave).
I made this because I used to have some, and I manage a few HA instances for folks who do. I was always annoyed by the lack of support for ZHA locks. Like you, I had created my own set of helpers and automations in YAML I’d created to solve this, but it wasn’t easily scalable and not something less HA-savy folks could jump into. Hence I created this integration to make it simpler and easier to set up.
Excellent! I will try this one with a Yale Zigbee Lock (YRD256L TSDB). I have the Yale Zigbee Gateway as well, but trying to keep my lock setup simple with just the lock and without the Yale Gateway. Everything works nice and stable (lock / unlock, state, and battery) but I miss the user code management module. Do you guys have any idea if we have this planned for HA natively?
I don’t think HA has plans for native user-code management of locks, as there are so many differences between brands and protocols, etc.
For your lock, if you’re not using the gateway, then I don’t think I’d expect there to be anyway to access the lock settings other than the keypad.
I’m not familiar with how HA integrates with the Yale Zigbee gateway. If it connects with ZHA (Zigbee Home Automation) in HA then this will work as is. But my guess is that the Yale is cloud connected, so you’ll need an integration specific to your Yale hub to get it into HA.
Ok, I’m stuck with the installation of this Lock Manager. I believe I’ve successfully downloaded and install it as an integration. But, I don’t know what to do next. The last set of instructions on the Github page states,
I see you enter the user’s name for a lock code slot with this manager. So when someone uses their code to unlock the zigbee door lock, will an entity or attribute be set with that person’s name so that a notification could be fired off saying, “Benjamin Franklin unlocked the door!”?
You could most definitely set this up in an automation, and once sorted, it could be included into the integration. Ironically, I don’t actually have a Zigbee lock with a keypad, so I’m not really able to set this up myself, as I can’t see exactly what is passed in the zha_event when the lock is operated with the keypad.
What you’d need to do, is use:
Setup a user code in the ZHA Lock Manager
Start a ZHA Event capture: Developer Tools > Events > Listen To Events > “zha_event” > start listening
Operate the lock from the keypad with the code you entered in the ZHA Lock Manager.
Share the full ZHA_event details here. *It shouldn’t include the pin in the event so there’s nothing private in the event.
From this we can build an automation that listens for this event, and references the code slot # used to operate the lock against the input_text helper with the user name that corresponds with that code slot.
I need the zha_event details to know what attribute is used to reference the code_slot and whether the slot # ties exactly the to the slot you provided in the lock manager. (e.g. which code slot the code belongs to in your lock manager configuration) I’m not certain on this, but I think some ZHA locks start the first user code slot at #2, while others don’t, so there may not be a one size fits all mapping between the code slot communicated by the lock and the slot the code is tied to in the integration.
Getting back to this now that I have my Zigbee locks setup again and have installed this awesome integration (thanks!!), below is the event from my unlock:
I recently put together a new option for those of you managing Zigbee locks through ZHA: ZHA Lock Manager.
It takes a slightly different approach compared to the project here:
Instead of relying on helpers, automations, or a static dashboard, it provides a dedicated sidebar panel that updates dynamically.
You can change the number of slots you manage later on, rather than being locked to the original setup.
It includes an optional Alarmo integration, so keypad unlocks can automatically disarm your alarm system.
If you already use ZHA, the integration installs via HACS and is fairly lightweight to get started with. Just another option for folks who want a more direct way to handle lock code management.
Screenshot Preview
Here’s what the side panel looks like in Home Assistant:
This integration looks absolutely amazing! Are there any plans to get this into the realm of zigbee2mqtt by chance? Or any update on it as I believe there was already some interested parties?
This is exactly what the community has been after a simple lock manager. In my opion this looks better than the Zwave options out there. Would be very keen to see this in Zigbee2MQTT. Would this be technically feasible or are there specific ZHA commands that are used?
Hey there. I created a custom integration specifically for Z2M locks. It’s very new, but I’m using it reliably in my production setup. Try it out and let me know what you think.
Thanks @bharat! look slick! Have tried but can´t get to work. I think the problem is that it tries to set first pin to slot “1” in nimly and the first slots there, typically like up to 5 or 7 can not be used (depending on how many master codes you have).
And also it is very probable that you will already have codes already. So would be very good to be able to choose what slots to use, like
“Begin slot”: 70
“End slot”: 90
Would that be possible to add? (:
Edit: Bonus question. How do you know the lock actually updated with the pincode successfully? If not, does it give an error code in UI?
Hey @Doorman! Thanks for taking a look at the project. I just pushed a new version that lets you set the first/last slot for your configuration. Try that out and see if it works for your needs!
And to answer your bonus question, the integration reads the Z2M traffic and looks for a confirmation from each lock that it’s made the correct pin code modification. I’ve only tested that out on my Yale Assure locks, but it works reliably for me!
Hi @bharat, complete noob here, I’m six months in after years on Hubitat & Vera. Have 2 yale locks on HA and installed Lockly via the custom repository on HACS.
The integration is live on the configured page, but red flag 1 is that the install shows no icon and V0.0.0? And second red flag when i try and find the card to add to a test page it’s doesn’t show up in the search. Have i screwed up the download?
Then would really appreciate a bit more on how to set up the entries within the app itself…
I have 2 yale assure zigbee locks set up via zigbee2mqtt which sounds similar to your setup so it has to be possible!!
Cheers (from down under)
Mike
Hey @mrudman! You’re on the right track… thanks for trying this out.
The README says that you can access it via HACS, but the reality is that you can’t yet (until they approve my brands PR which I’ve been waiting on for 2 weeks…)
If you installed it by doing the “custom repository” approach in HACS then you’ll see that the version is v.0.0.0 – that’s fine. It’s just a placeholder for “dev version”.
Can you send screenshots of what you’ve got in the Settings → Devices & Services → Lockly page? You should have at least one configuration entry there.
As long as you have a config entry there then you’re in good shape. Go to any dashboard, go into edit mode, and search for “lockly”. You should see this: