Zigbee Lock Manager

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.

Disclaimer: I’m not a developer by trade, and this is my first integration.

6 Likes

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 :laughing: (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.

Thank you for this, I’ve been trying to figure out a way to manage this for a while now.

1 Like

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,

But, I can’t find the folder that is mentioned or any yaml file to copy to create a new dashboard. Can anyone help a newbie? Thanks.

NEVERMIND! Of course, again, right after I post this message I figured it out.

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:

  1. Setup a user code in the ZHA Lock Manager
  2. Start a ZHA Event capture: Developer Tools > Events > Listen To Events > “zha_event” > start listening
  3. Operate the lock from the keypad with the code you entered in the ZHA Lock Manager.
  4. 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:

user unlock (slot 1)
event_type: zha_event
data:
  device_ieee: 00:24:46:ff:fd:01:35:41
  unique_id: 00:24:46:ff:fd:01:35:41:2:0x0101
  device_id: 1d34d5634ad1c71ac0a50bd016ab8cc9
  endpoint_id: 2
  cluster_id: 257
  command: operation_event_notification
  args:
    source: Keypad
    operation: Unlock
    code_slot: 1
  params: {}
origin: LOCAL
time_fired: "2025-02-26T17:14:01.748676+00:00"
context:
  id: 01JN1M0JMMPR5243R5JATCC8NG
  parent_id: null
  user_id: null

It would definitely be great to have somehow an “unlock/lock” history that could be used on cards.

In case it helps, below is also events from manual lock/unlock

Manual lock (rotate lock inside)
event_type: zha_event
data:
  device_ieee: 00:24:46:ff:fd:01:35:41
  unique_id: 00:24:46:ff:fd:01:35:41:2:0x0101
  device_id: 1d34d5634ad1c71ac0a50bd016ab8cc9
  endpoint_id: 2
  cluster_id: 257
  command: operation_event_notification
  args:
    source: Manual
    operation: Manual_Lock
    code_slot: 65536
  params: {}
origin: LOCAL
time_fired: "2025-02-26T17:14:05.144597+00:00"
context:
  id: 01JN1M0NYRPJ5S3NNBWAV243X0
  parent_id: null
  user_id: null
keypad lock
event_type: zha_event
data:
  device_ieee: 00:24:46:ff:fd:01:35:41
  unique_id: 00:24:46:ff:fd:01:35:41:2:0x0101
  device_id: 1d34d5634ad1c71ac0a50bd016ab8cc9
  endpoint_id: 2
  cluster_id: 257
  command: operation_event_notification
  args:
    source: Manual
    operation: OnTouchLock
    code_slot: 65536
  params: {}
origin: LOCAL
time_fired: "2025-02-26T17:13:58.458494+00:00"
context:
  id: 01JN1M0FDT0332X0CRB2FDP5YH
  parent_id: null
  user_id: null
manual unlock (rotate inside)
event_type: zha_event
data:
  device_ieee: 00:24:46:ff:fd:01:35:41
  unique_id: 00:24:46:ff:fd:01:35:41:2:0x0101
  device_id: 1d34d5634ad1c71ac0a50bd016ab8cc9
  endpoint_id: 2
  cluster_id: 257
  command: operation_event_notification
  args:
    source: Manual
    operation: Manual_Unlock
    code_slot: 65536
  params: {}
origin: LOCAL
time_fired: "2025-02-26T17:14:04.926334+00:00"
context:
  id: 01JN1M0NQYJGGPD7FBE1RWDKCA
  parent_id: null
  user_id: null

I am trying to get this configured, but no mater what I do the helper entities are not being created. Has anyone encountered this before?


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:

1 Like

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?

1 Like

Some really nice addon you got going here!!!

Sorry for bugging you but any chance that it might be working with Z2M? (For Nimly locks)

Thank you in advance!