Lock Code Manager scales down to a simple UI for managing your lock's PIN codes — and scales up to a programmable, multi-lock, multi-provider PIN platform with scheduled access, condition-driven activation, and automation-ready services. Define your codes once and LCM handles setting, clearing, and monitoring them on every lock, across providers (Z-Wave, ZHA, Matter, and more) without you wiring up the differences.
Whether you just want a clean dashboard for your front door or you're rotating PINs across an Airbnb fleet on a nightly schedule, LCM has you covered.
Features:
- Synchronize PIN codes across multiple locks and providers
- Automatic sync — codes are set and cleared as needed, with retry and drift detection
- Condition entities control when a code is active:
calendar— active during eventsbinary_sensor/switch/input_boolean— active when onschedule— active during scheduled times
- Services and actions for setting/clearing PINs, attaching condition entities, hard-refreshing from the lock, and generating safe random PINs from automations
- Blueprints for advanced use cases like usage limiting, calendar-driven PINs, and more
- Dashboard strategies and custom cards for managing codes and viewing lock status — from one-line auto-generated dashboards to fully hand-composed layouts
Supported lock integrations:
| Integration | Read PINs | Push Updates | Code Events | Notes |
|---|---|---|---|---|
| Z-Wave | Varies | ✅ | ✅ | Some locks mask PINs |
| ZHA | ✅ | ✅ | ✅ | Drift detection fallback if lock lacks programming events |
| Zigbee2MQTT (MQTT)² | Varies | ✅ | ✅ | Same broker as Z2M; PIN support depends on lock |
| Matter | ❌ | ✅ | ✅ | PINs write-only per spec |
| Schlage WiFi | ❌ | ❌ | ❌ | Cloud-based, PINs masked |
| Akuvox¹ | ✅ | ❌ | ❌ | Local API, polling-based |
| Virtual¹ | ✅ | ❌ | ❌ | For testing only |
¹ Custom integration required (Local Akuvox, hass-virtual)
² Zigbee2MQTT (MQTT) — Pair the lock in Zigbee2MQTT with PIN/user-code support for your firmware.
The Code Events column refers to PIN-used automations from Lock Code Manager’s event entity
(which slots were used to lock/unlock).
Zigbee2MQTT lock/unlock actions with user identification are mapped to code slot events for PIN-used automations.
Configure Home Assistant’s MQTT integration on the same broker Zigbee2MQTT uses.
The default Zigbee2MQTT base topic zigbee2mqtt matches what Lock Code Manager expects unless you customize topics
({base_topic}/{friendly_name}/set|get).
During LCM setup, choose your lock.* entity from MQTT.
If you rename the device in HA, keep it aligned with the friendly name in Zigbee2MQTT.
Adding support for new lock integrations is straightforward — see the Adding a Provider guide. Contributors welcome!
Some lock integrations cannot currently be supported due to limitations in their underlying libraries. See the wiki for details.
Some condition entity integrations are not compatible. See the wiki for details.
The best way to install this integration is via HACS.
- Set up your locks in Home Assistant through a supported integration (Z-Wave, ZHA, Matter, Schlage, Zigbee2MQTT/MQTT, etc.)
- Add this repository as a custom integration repository in HACS
- Go to Settings > Devices & Services > Add Integration
- Select Lock Code Manager
- Follow the prompts - additional information about the configuration options are available in the Wiki
Pre-built automations and templates for common lock management patterns. See BLUEPRINTS.md for full details, input tables, and import buttons.
- Calendar Condition — Binary sensor for calendar-based slot access
- Date Range Condition — Binary sensor for start/end date access
- Slot Usage Limiter — Disable a slot after a set number of uses
- Calendar PIN Setter — Extract and set PINs from calendar events
- Auto Re-lock — Re-lock after a delay with day/night support
- Lock on Door Close — Lock when a door sensor detects closure
- Slot Usage Notifier — Notify when a code slot PIN is used
- Condition Linker — Assign a condition entity to a slot via UI
Visit the Wiki for detailed documentation including configuration, troubleshooting, dashboard setup, and development guides.
Lock Code Manager ships custom Lovelace strategies (which auto-generate UI from your config) and custom cards (which you compose yourself). Pick the one that matches how much control you want — from a one-click dashboard that just works (selectable directly from Settings → Dashboards → Add Dashboard on Home Assistant 2026.5+) to a hand-authored layout that places exactly what you want where you want it.
- UI overview & decision guide — start here
- UI Strategies — dashboard, view, and section strategies
- Custom Cards — slot card, lock-codes card, and code-display modes
I am a keymaster maintainer,
and what I learned working on it, and the regular complaints users had about it generating
too many automations, entities, etc. led me to take a different approach. This isn't a
knock on keymaster, unfortunately a lot of what is built in this integration wasn't
possible for most of keymaster's life. I briefly considered implementing this into
keymaster but:
keymasteris still a great solution that works as is.keymasteris surprisingly simple under the hood because it makes Home Assistant do a lot of the heavy lifting for figuring out when to enable and disable a usercode. This integration, on the other hand, attempts to do all of the heavy lifting internally in code, which means it will generate less entities and automations but it is likely more fragile to changes in HA Core or even changes in the codebase.- It would be impossible to seamlessly migrate users from the current implementation of
keymasterto this integration's implementation. Rewritingkeymasterto do this would have been the equivalent of creating a new integration anyway.
A big thank you to the other keymaster maintainers:
- @FutureTense
- @firstof9
As well as the person who created the base concept that keymaster evolved from:
@ptdalen