Skip to content

raman325/lock_code_manager

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

851 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lock Code Manager

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 events
    • binary_sensor / switch / input_boolean — active when on
    • schedule — 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!

Integrations That Cannot Currently Be Supported

Some lock integrations cannot currently be supported due to limitations in their underlying libraries. See the wiki for details.

Condition Entity Integrations Not Supported

Some integrations create entities whose states don't map to LCM condition entity semantics ("access allowed" / "access denied"). The integration may still be usable with LCM by driving slot Enabled switches from its own automation logic instead of attaching its entities as condition entities. See the wiki for details and the scheduler-component workaround.

Installation

The best way to install this integration is via HACS.

  1. Set up your locks in Home Assistant through a supported integration (Z-Wave, ZHA, Matter, Schlage, Zigbee2MQTT/MQTT, etc.)
  2. Add this repository as a custom integration repository in HACS
  3. Go to Settings > Devices & Services > Add Integration
  4. Select Lock Code Manager
  5. Follow the prompts - additional information about the configuration options are available in the Wiki

Blueprints

Pre-built automations and templates for common lock management patterns. See BLUEPRINTS.md for full details, input tables, and import buttons.

Template blueprints

  • Calendar Condition — Binary sensor for calendar-based slot access
  • Date Range Condition — Binary sensor for start/end date access

Automation blueprints

  • 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

Learn More

Visit the Wiki for detailed documentation including configuration, troubleshooting, dashboard setup, and development guides.

UI & Dashboards

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.

AI Usage

While I began this project before AI coding agents and wrote the bones myself, since November 2025 it's been hard NOT to code with a coding agent. You will notice that almost all of my PRs since then have been co-authored with Claude (I've also experimented with Codex and Copilot).

If you look at any of the PRs, particularly the meaningful ones, you'll notice many commits. Some come from AI code reviews, but many come from my own code reviews or from me steering the design. I can't say I've audited everything line for line, but I can comfortably say that it's not exfiltrating your data or doing anything evil.

If you are uncomfortable using this integration because of concerns around AI, I completely understand and that is your prerogative. If you ever want to chat about it — whether it's to convince me that what I'm doing is wrong, to learn more about it, or anything in between — find me on the Home Assistant Discord.

About

Lock code manager for locks integrated with Home Assistant

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

  •  

Packages

 
 
 

Contributors