Native lock code functionality #1000
Replies: 12 comments 9 replies
-
|
I'm not sure there's a meaningful distinction between Option 1 & Option 2. If integrations are creating their own solutions, they are inherently using existing HA constructs. But I agree with your analysis of the cons here, and that's essentially why I didn't implement this for the Schlage integration: there's not really a clean way to model this in HA. Let's consider the features we would want a lock code to have:
Looking at the zwave certification list, I also see:
Some other interesting things to note:
There are probably other things worth considering, but that's what's top-of-mind for me. ;) |
Beta Was this translation helpful? Give feedback.
-
|
It seems this may also be considered at a higher level of abstraction. Rather than a entity for input of lock codes, I'd suggest a more generalized "table" input entity may be better (or, at least, for the underlying foundation to build this on). There are several input items that are tables in form - for example, Lock codes (rows with User ID, Status, Type, PINCode columns), Groups (rows with IDs, Groups Names, Members), Scenes (rows with ID, Name, Members), Schedules, etc. Perhaps the starting place for something like this is a concept like this flex-table-card lovelace https://github.com/custom-cards/flex-table-card?tab=readme-ov-file, and see example images: https://github.com/custom-cards/flex-table-card/blob/master/images/MultiExample.png, but extended into a reusable Entity that could appear on a device's page for lock codes, Groups, Scenes, or other data in 2D table form. Then build from this 2D Table Input Entity to the more purpose-specific integration implementation. |
Beta Was this translation helpful? Give feedback.
-
|
FYI, there is a feature request with related discussions from an end-user point-of-view in the Home Assistant's community forum here:
Can I suggest that you might also want to get zha/zigpy developers involved early for also looking at it from the Zigbee (ZHA) perspective? |
Beta Was this translation helpful? Give feedback.
-
|
Whenever this topic gets focus, it would be great to add the option that a code is not required when the lock request is executed. This feature is available for the alarm_control_panel (aka Use case:
|
Beta Was this translation helpful? Give feedback.
-
|
starting with a more basic concept, lock code management is really management of a table of rows / columns with each row representing the data for a different user, each column being one of the characteristics of the PIN for that row, and having the ability to create, delete, and update rows. Lots of data types could benefit from a generic input entity that could be arranged in rows / columns (lock PINs, bindings, groups, etc.) with create, delete, update row capabilities. The first question I had was whether there was anything like that already in HomeAssistant/Core. I think there is. If you think about it, the calendar entity, https://developers.home-assistant.io/docs/core/entity/calendar, is essentially a row-column type input entity, where each date entry is like a row, and the columns are all fixed name and data type (start, end, summary, location, description, etc.). Granted, for the calendar, the UI doesn't use a "row" but the underlying start, end, summary, location, description data can be seen as column entries. So, perhaps with the calendar entry code as a starting point, someone smarter than me on UI, could change that code such that you could have user-supplied labels and types for the data fields, and a user-supplied number of fields. This would form the basis of a new "core" input type ("data_table"), what could be used for locks, bindings, groups, or anywhere Row/Column type data inputs were needed. In other words, I'm suggesting the architecture update should begin with a more basic building block. |
Beta Was this translation helpful? Give feedback.
-
|
Wonder if have also got input on the architecture of a native lock code functionality concept from @firstof9 & @FutureTense of keymaster? |
Beta Was this translation helpful? Give feedback.
-
|
For reference also see this new pull request by Ahbrown41 for adding a initial Matter lock manager with Code/User Management to Home Assistant’s core: Which in turn is a stripped down PR based on his work on a much larger backend implementation in a seperate PR that now been closed: as well as a matching pull request with a Matter Lock Manager UI for Home Assistant’s frontend: This was also discussion under feature requests discussion section here:
@Ahbrown41 I understand that the home-assistant/core#161936 pull request "only" adds some parts of underlying work that is needed to enable other things to build on top of this to allow usercode management for locks. However I still think that since this could direcctly determine or have indirect consequences on future architecture that at least the concepts and principles here in #1000 and should also be explained / discussed in this related architecture discussion -> #1000 as that way it will allow others in the community to see, give feedback and post their ideas about it too: From what I have seen in the past not even underlying work like this that will affect cross-platform or cross-domain features will normally not be accepted before overall architecture changes and future goals for it has been discussed there under architecture discussion and approved + recorded as an Architecture Decision Record that describes the goal and the process(es) to get to set goal which is stored in the ADR folder in that architecture repository. As I understand it the point with those architecture discussions and ADs is to avoid developers like yourself working on something that have to be scrapped or getting PRs rejected because it is seen as a workaround and not aimed towards the solution that was set in the Architecture Decision Record and decided through such architecture discussions. And while it could be seen as a downside with forcing architecture discussions and recording ADRs however the consequence it that it "introduces an additional burden on core project maintainers to diligently follow architecture discussions and record the results in this repo as an ADR"). Again, recommend that the overall architecture discussion about this is moved to that existing discussion about native lock functionality -> #1000 or alternativly that you open a new discussion there (like example about "native usercode management functionality" for architecture discussions and recording via ADRs, otherwise there is probaly a chance that @mkerstner or @tailg8nj and others who might have input on the architecture for it miss this discussion -> https://github.com/home-assistant/architecture/discussions/new/choose |
Beta Was this translation helpful? Give feedback.
-
|
By the way, also see related roadmap discussion which raised by @mkerstner which discusses benefits of having a unified code management system(s) and a shared credential UI for all integrations (i.e. a protocol-agnostic foundation that suits a range of protocols) that includes codes for both locks and alarm control panels: and the related epic tracker for protocol-agnostic credential management: That highlights that the long term goal for usercode management of users and PIN-codes for each user should really take usercodes for both lock and alarm control panel into consideration here. With a long term vision to aim for a more coherent credential management across supported protocols/devices for users and their usercodes. This roadmap entry also specifically mentions "Aliro" which is a new/upcoming official open standard for making digital door keys work across different manufacturers and platforms that is aiming for official launch by Connectivity Standards Alliance the sometime during 2026 (with the specifications for Aliro 1.0 currently being in the final review phase before it is formally ratified as an official standard from the CSA): Aliro is a "standardized communication protocol between access readers and user devices, providing a convenient and consistent experience" and it can be described as “Matter for digital door keys” as it is all about interoperability between digital keys and locks. "It is important to distinguish between Aliro and Matter. Both are managed by the same organization (CSA), but they have different jobs. Matter is, in a sense, the caretaker. It takes care of administration and control: “Door closed?”, “Lock the door at 10 p.m.”, “Battery level low.” For this purpose, Matter communicates via an existing IP network (Wi-Fi or Thread). The Aliro standard replaces the doorman. It checks access authorization: “Is this person allowed in?” This communication takes place directly between the phone and the lock (point-to-point), without Wi-Fi or a hub."
|
Beta Was this translation helpful? Give feedback.
-
|
FYI, for reference, Home Assistant 2026.4 release (currently in Beta) adds an initial Matter lock user and credential management services feature which allows you to manage your lock users and PIN codes directly from the Home Assistant UI if you have have a Matter-compatible smart lock. This change adds the ability to manage Matter lock codes from within Home Assistant via the new "Manage Lock" menu added to Home Assistant's frontend (UI):
This awesome contribution to Home Assistant's Matter inteation was initiated by @Ahbrown41 See related frontend and backend pull reqeusts:
This concept initially started as a discussion about PIN management for Matter Door Locks under the feature requests discussion section here:
PS: I understand that that initial Matter lock manager "only" adds some parts of underlying work that is needed to enable other enhanced lock management features s to build on top of this to allow usercode management of doorlocks (i.e. managing user permissions for locks and PIN-usercodes). However I still think that implementing this bacis functionality for Z-Wave and Zigbee lock credentials and lock PIN-codes for devices via the Z-Wave JS integration and the ZHA integrations for Home Assistant could direcctly determine or have indirect influence on future architecture that at least the extended and more advanced cross-platform concepts and principles discussed in this related feature request discussion: Note! Again, please also see related roadmap discussion which raised by @mkerstner which discusses longterm benefits of having a unified code management system(s) and a shared credential UI for all integrations (i.e. a cross-platform and protocol-agnostic global foundation that suits a range of protocols) that includes codes for both locks and alarm control panels: and the related epic tracker for protocol-agnostic credential management: By the way, when implementated globally for locks then perhaps same or similar solution could also be done for alarm control panel? |
Beta Was this translation helpful? Give feedback.
-
FYI, apparently a pm from Open Home Foundation noted this is wanted and added credential management for Z-Wave locks to a roadmap: (Note that just because they added it to their roadmap does not mean that someone is actually working on it or planning to work on it yet). |
Beta Was this translation helpful? Give feedback.
-
|
FYI, for reference, @mkerstner mentioned in OpenHomeFoundation/roadmap#70 that he has written down some notes on a first scope for the way forward for credential management (which includes locks and alarm control panels) which he outlined in this initial document:
Note that the section on "Access Tracking & History" there focus on event logging and actions on events. |
Beta Was this translation helpful? Give feedback.
-
|
FYI; mkerstner has created a new issue to track a new WIP (work-in-progress) roadmap item to expand on credential management for locks: For reference, in it he also links to an updated document with his own notes on way forward for credential management in Home Assistant: As I understand it, he is now looking for first feedback after the initial release of the Matter lock credentials management in Home Assistant release 2026.3 so do not potentially miss feedback before moving forward with expanding the scope of credential management for locks. |
Beta Was this translation helpful? Give feedback.





Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
CC @AlCalzone @marcelveldt for input from a Z-Wave/Matter perspective
Background
The
lockplatform natively allows users to control the lock state of a lock, but it is not possible, at least natively, to manage codes for the lock. While not all locks have this functionality, many integrations/protocols support this, includingzwave_js,zigbee,matter, and proprietary WiFi/BLE locks.Today, integrations are forced to handle lock code management on their own. For
zwave_js, there are zwave_js specific services to manage user codes, but there isn't a native UI that makes them easily manageable. As a result, there are integrations like https://github.com/FutureTense/keymaster which hack together a solution using a combination of the HA packages functionality, input helpers, and automations. In addition to generating a lot of artifacts which pollute a user's instance, the UI that gets created is not optimized for the use case and is quite complex given what it's trying to accomplish.Purpose
The purpose of the initial proposal is to come to a consensus that a new entity platform is needed to support codes. There are a lot of details to iron out about this platform, and we can discuss that as a follow up, but I first want to come to consensus that this is needed and that we can't use what we already have.
Considerations
personentity to a code.Options
Option 1: Leave things as is and let integrations create their own solutions
We could choose to do nothing and to continue to let each integration figure this out. Integrations can provide a lot of this functionality through services, and when entity services support responses, most if not all of it will be available.
Pros:
Cons:
Considerations:
Option 2: Use existing HA constructs
Now that most of the input helpers have corresponding entity platforms, integrations could cobble together their own collection of entities that can be used to manage user codes.
textentities could be used to view and set codes (and names), and a switch could be exposed to allow codes to be enabled/disabled.Pros:
textentity already support regex validation and could be used to enforce requirements on the codeCons:
textentity for code,textentity for a name, and aswitchentity for enabled state), that would result in 90 entities for my one lock. In addition to being a lot of entities, users would have to construct a UI for user code management themselves, and that UI would not be well optimized for the use case.Considerations:
Option 3: Establish a new entity type for codes
Pros:
textentity) to provide the needed capabilities while giving integration owners a consistent pattern to follow.Cons:
Considerations:
lockentity. While they would all be tied together through thedevice_registry, I don't think we can assume that a single device is a single lock, although I don't have any good examples to support that theory.Recommendation
I recommend that we go with option 3 but spend some time researching what the requirements are that we need to support before creating an in depth proposal. Even if we were able to get certified using option 1 or 2, the user experience is not great (keymaster is a good way to "test" how option 1 or 2 might look like from a user perspective, and while some of the functionality would definitely be eliminated if integrations supported these things natively, my experience has shown that it is suboptimal)
Beta Was this translation helpful? Give feedback.
All reactions