Security

Keymaster for Home Assistant Z-Wave Locks: Setup & Alternatives

Written with AI assistance by the editorial team.
Updated November 27, 2026 15 min read

Updated November 25, 2026. This guide was rewritten for current Keymaster. Keymaster v0.1.0 (October 23, 2025) was a breaking refactor that removed the generated packages/ files, and the project wiki says the packages directory is no longer used. The earlier version of this post described the old packages-and-helpers setup; if you followed it, the notification example below replaces the one that was here.

The Z-Wave keypad deadbolts in our test home run PIN code management through Keymaster, the long-standing HACS integration for Z-Wave lock code slot management. We have not run Lock Code Manager, the newer alternative, so the comparison below uses its documentation for that side.

This post covers what lock code management is, what changed in Keymaster’s rewrite, how the two integrations compare, and the unlock notification we run.

What lock code management actually means

A Z-Wave keypad deadbolt stores up to ~30 PIN codes locally on the lock itself; you punch in a code, the lock opens. The codes are stored in numbered “slots.” Slot 1 might be your own code, slot 2 another household member’s, slot 3 a guest’s, and so on.

Out of the box, Home Assistant’s Z-Wave JS integration exposes the lock as a lock entity (locked or unlocked) and a few diagnostic sensors. It does not give you a friendly way to manage which PINs are in which slots, restrict slots to certain dates and times, or get a notification telling you who just unlocked the door.

That’s the gap Keymaster (and Lock Code Manager) fills. They sit on top of Z-Wave JS and add:

  • A slot-management UI (assign a name and a PIN to slot 1, 2, 3, etc.)
  • Time/day restrictions per slot (a guest PIN that only works on set days and hours)
  • Slot-aware unlock events (so you can see which slot was used)
  • Auto-generated Lovelace dashboards for managing all of this

Useful for a household that hands out codes to guests or contractors. Not strictly necessary if you only have two PINs and never change them.

The two integrations

There are essentially two HACS integrations doing this job in 2026:

Keymaster (FutureTense/keymaster) — the older, more entrenched option. It has been the de-facto answer in HA forums for years, and it is still actively released: the latest release when this was checked was v0.6.5 (November 19, 2026), per its releases page.

Lock Code Manager (raman325/lock_code_manager) — the newer alternative. Its documentation lists Z-Wave, Matter and a wide lock list, plus first-party blueprints.

What changed in Keymaster v0.1.0

If you are reading older Keymaster guides, this is the part that will trip you up.

  • No more packages. Before v0.1.0, Keymaster generated YAML package files per lock, and setup started with adding a packages include to configuration.yaml. The v0.1.0 release notes list “Remove package files,” and the wiki says the packages directory structure is no longer used and can be deleted.
  • Slots are the integration’s own entities. Each slot’s name, PIN, enable switch, schedule and limits are entities created by Keymaster itself, managed from its dashboard, rather than a pile of generated helpers and scripts in your config.
  • Parent and child locks. One lock can be the parent and others its children. A child slot follows the parent’s settings unless you turn on that slot’s “override parent” option. This replaces hand-written automations that copied settings from one lock to another.
  • The dashboard is generated. The README describes Lovelace strategies that build the Keymaster dashboard from a single line of YAML.
  • It needs a recent Home Assistant. The repository’s HACS manifest listed Home Assistant 2026.7.0 as the minimum when this was checked. Update Home Assistant before updating Keymaster across a big version jump.

Keymaster vs Lock Code Manager: side-by-side

The Keymaster column reflects what we run (see the Keymaster repository for the version history); the Lock Code Manager column is drawn from its project documentation, not hands-on use.

KeymasterLock Code Manager
RepositoryFutureTense/keymasterraman325/lock_code_manager
InstallHACS custom integrationHACS custom integration
Config storageUI config entries (generated packages/ YAML removed in v0.1.0)UI / config entry only
ProtocolsZ-Wave JS, ZHA, Zigbee2MQTT, Schlage WiFi (Matter emerging)Z-Wave JS, ZHA, Zigbee2MQTT, Matter
Entities per slotA set of native entities per slot (name, PIN, enable, schedule, limits, last-used event)Fewer, per its docs
Automation modelPer-slot entities and events you can use in automationsService calls + first-party blueprints
BlueprintsCommunity-contributedFirst-party, including Auto Re-lock, Calendar PIN Setter, Slot Usage Limiter, Slot Usage Notifier, Lock on Door Close
PIN-usage trackingPer-slot “last used” event entitiesBuilt-in per-slot usage sensors
Multi-lock syncBuilt-in parent/child locks with per-slot overrideBuilt-in slot sync with drift detection
Auto dashboardLovelace strategy dashboardDashboard strategy
MaturityOlder, very widely documented (much of it for pre-0.1.0 versions)Newer, actively developed

Which locks and protocols each one supports

The most common real question is “will it work with my lock?” Both are protocol-level tools — they talk to whatever lock your radio integration already exposes, so support comes down to which radios and lock types each one understands.

Lock / protocolKeymasterLock Code Manager
Z-Wave JS deadbolts (Schlage, Yale, Kwikset)YesYes
Zigbee via ZHAYesYes
Zigbee via Zigbee2MQTTYesYes
Matter locksEmergingYes
Schlage WiFi (Encode)Listed providerCheck current docs
Cloud/LAN locksAkuvox supported via local_akuvox; Nuki/Tedee in progressCheck current docs

Practical takeaway: for a mainstream Z-Wave or Zigbee keypad deadbolt, both work. WiFi, cloud and Matter locks are a moving target on both — check each project’s current support table before you buy, since they depend on the underlying integration exposing code-slot control at all.

Before you start: prerequisites

Both integrations sit on top of an already-working lock. Before you install either one:

  • Your lock is paired and controllable in Z-Wave JS (or ZHA / Zigbee2MQTT / Matter) — you should be able to lock and unlock it from the raw lock. entity first. Neither add-on pairs the lock for you.
  • HACS is installed. Neither integration ships in core Home Assistant; both are HACS custom integrations.
  • You’re on a current HA release. Current Keymaster lists Home Assistant 2026.7.0 as its minimum (see its HACS manifest). Check Lock Code Manager’s README for its own requirement.
  • No packages directory is needed for Keymaster any more. If you still have a Keymaster folder under packages/ from a pre-0.1.0 install, the wiki says it can be deleted.

Installing Keymaster via HACS

Keymaster installs through HACS (the Home Assistant Community Store): open HACS, search for Keymaster, download it, then restart Home Assistant and add it from Settings → Devices & Services → Add Integration → Keymaster. Point it at your Z-Wave lock entity and set the number of PIN code slots you want to manage. Add each further lock as its own Keymaster entry, and choose a parent lock for it if you want its slots to follow another lock’s.

Setting up Lock Code Manager

We don’t run Lock Code Manager, so treat this as the general procedure from its documentation rather than a tested walkthrough:

  1. Install via HACS. In HACS, add raman325/lock_code_manager (as a custom repository if it isn’t indexed yet), download it, and restart Home Assistant.
  2. Add the integration. Go to Settings → Devices & Services → Add Integration → Lock Code Manager, then pick the lock entity (or entities — LCM can manage several locks under one config) and the number of code slots.
  3. Fill slots from the UI. Each slot gets a name, a PIN, and an enabled toggle.
  4. Add blueprints as needed. LCM ships first-party blueprints — Auto Re-lock, Lock on Door Close, Calendar PIN Setter, Slot Usage Limiter, and Slot Usage Notifier — that you import from the repo and point at your slots.

Migrating from Keymaster to Lock Code Manager

We have not done this migration, so here’s the general procedure rather than a post-mortem. There’s no in-place converter — the two integrations name their entities differently, so it’s a clean cutover:

  1. Write down your slot map first. Record every active slot: number, name, PIN, and any time/day restriction. This is your source of truth for re-entry.
  2. Clear the codes off the lock. Use Keymaster to empty each slot so you don’t leave orphaned PINs in the deadbolt’s local storage. The lock only holds ~30 codes; stale ones cause confusion later.
  3. Remove Keymaster. Delete the Keymaster config entries from Settings → Devices & Services and restart.
  4. Install and configure Lock Code Manager (steps above), recreating the same slot count.
  5. Re-enter every code from your slot map, including restrictions, and verify each one physically at the keypad before you rely on it.
  6. Update automations for the new entity names. Anything that references Keymaster’s slot entities needs its entity IDs changed. Look at the entities LCM actually created rather than assuming a naming pattern.

Budget an evening, do it when nobody needs door access, and keep one physical key on you in case a slot doesn’t take on the first push.

Troubleshooting common Keymaster problems

A quick symptom-to-fix reference.

Slot stuck on “Adding”

“Adding” means Keymaster has sent the PIN and is waiting for the lock to confirm it. Check: the lock is awake and responding in Z-Wave JS; the PIN length is one the lock accepts (some locks silently drop codes of the wrong length — the Schlage BE469ZP is one); Keymaster is current. Then reload the Keymaster entry for that lock.

Lock shows “Disconnected” in Keymaster

Keymaster marks a lock Disconnected when it cannot reach it through the radio integration. If Z-Wave JS itself shows the node alive, reload the Keymaster entry. If the lock really has dropped off the network (dead batteries, lost pairing), fix that first: a Keymaster entry pointed at an unreachable lock keeps retrying and fills the log. Disable the entry until the lock is back.

Lock re-paired but Keymaster points at the old device

If a lock drops off the network and returns as a new device, the Keymaster entry still references the old one. Fix: make sure the re-paired lock has the entity ID the Keymaster entry expects (rename it in the entity registry if needed), then reload the entry and confirm every slot reports Synced.

Lots of entities

Each slot gets its own set of entities, so a lock with many slots adds a lot of them, and a removed lock can leave orphans in the entity registry. Only configure as many slots as you use, and clean up the registry after removing a lock.

What we run today: slot-aware unlock notifications

Whatever integration you use, the most useful automation in a Keymaster setup is a notification that says who just unlocked the door, by name.

Current Keymaster creates a “last used” event entity for every slot on every lock. It fires when that slot’s code is used and carries the slot number and the slot’s name as attributes, so the automation does not have to look anything up:

- id: 'lock_keypad_unlock_notify'
  alias: Lock Keypad Unlock Notification
  description: 'Notify when a door is unlocked by a code, with the slot name'
  triggers:
    - trigger: state
      entity_id:
        - event.front_door_code_slot_1_last_used
        - event.front_door_code_slot_2_last_used
        - event.side_door_code_slot_1_last_used
        - event.side_door_code_slot_2_last_used
  conditions:
    - condition: template
      value_template: >-
        {{ trigger.to_state.state not in ['unknown', 'unavailable', 'None']
           and trigger.from_state.state not in ['unknown', 'unavailable', 'None']
           and trigger.from_state.state != trigger.to_state.state
           and state_attr(trigger.entity_id, 'event_type') == 'unlocked' }}
  actions:
    - variables:
        lock_key: "{{ trigger.entity_id.split('.')[1].split('_code_slot_')[0] }}"
        slot: "{{ state_attr(trigger.entity_id, 'code_slot_num') }}"
        person_name: "{{ state_attr(trigger.entity_id, 'code_slot_name') or ('Slot ' ~ slot) }}"
    - action: notify.mobile_app_your_phone
      data:
        title: "🔓 {{ lock_key | replace('_', ' ') | title }} unlocked"
        message: "{{ person_name }} unlocked it with a code (slot {{ slot }})"
        data:
          tag: "lock-unlock-{{ lock_key }}"
  mode: parallel
  max: 10

front_door and side_door are placeholders for the names you gave the locks in Keymaster; list one event entity per slot you use. Walking through it:

  1. It triggers on the per-slot event entities, one per lock and slot. The entity ID tells you which lock, and the attributes tell you which slot and whose name is on it.
  2. The condition does two jobs. It only passes for an unlocked event, and it ignores changes from or to unknown/unavailable. That second part matters: on a Home Assistant restart every one of these event entities restores its last value at once, and without the guard you get a burst of stale “door unlocked” notifications (and a “maximum number of runs exceeded” warning in the log).
  3. The name comes from the event itself. If a slot has no name, it falls back to “Slot N” so the notification is still useful.
  4. It sends a tagged notification. The tag means a second unlock at the same door replaces the first notification rather than stacking.

Older guides, including the earlier version of this one, read the lock’s alarm_type / alarm_level sensors and then looked up a slot-name text entity. We moved off that approach. The slot-name lookup can come back as “unknown slot” for child locks, and not every lock reports keypad events through alarm-type sensors — some use the Z-Wave Notification command class instead. The event entities work the same way on all of them.

Lock Code Manager has its own per-slot usage sensors and a Slot Usage Notifier blueprint for the same job; see its documentation.

A “lock didn’t lock” alert

The other automation worth having is a notification when a bolt fails to throw (warped door, misaligned strike), instead of trusting the lock’s silence. How a jam is reported depends on the lock: some set the lock entity’s state to jammed, others expose a separate “lock jammed” binary sensor. Check which one your lock gives you. For the first kind:

- id: 'lock_jammed_alert'
  alias: Lock Failed to Engage (Jammed) Alert
  description: 'Notify when a deadbolt reports jammed instead of locked'
  triggers:
    - entity_id:
        - lock.front_door
        - lock.side_door
      trigger: state
      to: 'jammed'
  conditions: []
  actions:
    - action: notify.mobile_app_your_phone
      data:
        title: "⚠️ Lock Jammed"
        message: >-
          {{ trigger.to_state.attributes.friendly_name }} reported jammed —
          the bolt may not have engaged. Check the door.
        data:
          tag: "lock-jammed-{{ trigger.entity_id }}"

For the second kind, trigger on the binary sensor turning on instead. Pair either with the lock’s auto-relock feature and you get both a retry and a heads-up if the retry fails.

Practical advice

  1. Choose on fit, not on age. The usual complaints about Keymaster in older threads — generated packages, helper sprawl, hand-built sync automations — were about the pre-0.1.0 design (see the v0.1.0 release notes). Compare current Keymaster with current Lock Code Manager for your lock and your needs.

  2. Don’t put a keypad-unlock notification behind a for: debounce. It can lose the notification you care about on a quick unlock-then-relock. Use the notification tag instead — let HA fire the notification and let the phone dedupe.

  3. Keep PIN slots short-lived and rotate them. A 4-digit PIN is fine for short-term access (a one-off contractor) but it’s a tiny keyspace — 10000 codes — and a determined attacker with physical access can brute-force it. Time-restricted slots help: a PIN that only works during a two-hour window one day a week has far less attack surface than a 24/7 PIN. Rotate any PINs given to outside service providers when the relationship ends.

Other options: Keymaster-Basic, keymaster-lite, and Simple Lock

The two-horse race isn’t the whole field. A few lighter forks and alternatives come up in the “which Z-Wave lock add-in” forum threads:

  • Keymaster-Basic — a stripped-down fork of Keymaster that drops the auto-generated Lovelace dashboards and some of the per-slot machinery in exchange for far fewer entities.
  • keymaster-lite — similar spirit: keep the core slot management, shed most of the heavy dashboard and helper generation.
  • Simple Lock — a more minimal approach for people who just want to set and clear a PIN without time restrictions, usage tracking, or dashboards.

These forks date from the older Keymaster design, so check how recently each has been updated before installing one. If your needs are basic — a couple of PINs, no calendars or usage limits — they may avoid some clutter. If you want restrictions, notifications, and multi-lock sync, you’re back to Keymaster or Lock Code Manager.

Frequently asked questions

Can I run Keymaster and Lock Code Manager at the same time? On different locks, effectively yes — but never point both at the same lock, or they’ll fight over the same code slots. During a migration, cut one lock over at a time.

Does either one work without the internet? Yes. Both operate entirely locally through your Z-Wave/Zigbee radio, and the PINs live on the lock itself, so codes keep working even if Home Assistant or your internet is down.

The short version: on current Keymaster, forget the packages folder, use parent/child locks instead of sync automations, and build unlock notifications on the per-slot event entities with a tag-based dedupe rather than a for: debounce. Rotate PINs.


Related guides: Three Schlage BE469ZP locks, years later · Fixing an unreliable Zigbee mesh

Tags #home-assistant #z-wave #smart-locks #keymaster #lock-code-manager
Share X / Twitter Facebook
Keep reading