-
-
Notifications
You must be signed in to change notification settings - Fork 14
Add a UI for lock code management
Lock Code Manager provides custom Lovelace strategies and cards for managing PINs directly from your Home Assistant dashboard.
The easiest way to get started is to create a dedicated dashboard using the Lock Code Manager strategy. This automatically generates views for each of your LCM config entries.
- Go to Settings > Dashboards > Add Dashboard
- Choose a name (e.g., "Lock Codes") and icon
- Open the dashboard and click the pencil icon to edit
- Click the three dots menu and select Raw configuration editor
- Replace the content with:
strategy:
type: custom:lock-code-manager| Option | Required | Default | Description |
|---|---|---|---|
use_slot_cards |
No | true |
Use streamlined slot cards instead of legacy entities cards |
show_code_sensors |
No | true |
Show code sensors in lock status section |
show_conditions |
No | true |
Show conditions section in slot cards |
show_lock_status |
No | true |
Show lock status section in slot cards |
show_lock_sync |
No | true |
Show sync status per lock in lock status |
collapsed_sections |
No | [] |
Which sections start collapsed (empty = all expanded) |
show_per_configuration_lock_cards |
No | true |
Show lock cards in per-config-entry views |
show_all_lock_cards_view |
No | true |
Add a "User Codes" view with cards showing all lock codes |
code_display |
No | masked_with_reveal |
Code visibility mode for slot cards and lock codes cards |
Legacy options (still supported but deprecated):
-
include_code_slot_sensors→ useshow_code_sensors -
include_in_sync_sensors→ useshow_lock_sync -
code_data_view_code_display→ usecode_display -
show_all_codes_for_locks→ useshow_all_lock_cards_viewand/orshow_per_configuration_lock_cards
strategy:
type: custom:lock-code-manager
show_all_lock_cards_view: true
show_per_configuration_lock_cards: true
code_display: masked_with_reveal
show_lock_sync: trueIf you want to add Lock Code Manager to an existing dashboard, you can use the view strategy for a single config entry.
| Option | Required | Default | Description |
|---|---|---|---|
config_entry_id |
Yes* | - | Config entry ID to render (use this OR config_entry_title) |
config_entry_title |
Yes* | - | Config entry title to render (use this OR config_entry_id) |
use_slot_cards |
No | true |
Use streamlined slot cards instead of legacy entities cards |
show_code_sensors |
No | true |
Show code sensors in lock status section |
show_conditions |
No | true |
Show conditions section in slot cards |
show_lock_status |
No | true |
Show lock status section in slot cards |
show_lock_sync |
No | true |
Show sync status per lock in lock status |
collapsed_sections |
No | [] |
Which sections start collapsed (empty = all expanded) |
show_lock_cards |
No | true |
Append lock codes cards below the slot cards |
code_display |
No | masked_with_reveal |
Code visibility mode for slot cards and lock codes cards |
*Either config_entry_id or config_entry_title is required, but not both.
Legacy options (still supported but deprecated):
-
include_code_slot_sensors→ useshow_code_sensors -
include_in_sync_sensors→ useshow_lock_sync -
code_data_view_code_display→ usecode_display -
show_all_codes_for_locks→ useshow_lock_cards
views:
- strategy:
type: custom:lock-code-manager
config_entry_title: House Locks
icon: mdi:lock-smart
title: Lock CodesFor advanced users building custom sections-type views, Lock Code Manager provides
section strategies that generate cards when Home Assistant renders the section.
Note: Section strategies simply render a single card (
lcm-slotorlcm-lock-codes) within a grid section. You can use the cards directly in your dashboard without using section strategies - see Custom Cards below.
Renders a single slot section with either the new lcm-slot card or legacy entities card.
| Option | Required | Default | Description |
|---|---|---|---|
config_entry_id |
Yes | - | Config entry ID for the LCM instance |
slot |
Yes | - | Slot number to display |
use_slot_cards |
No | true |
Use new lcm-slot card (true) or legacy entities card |
code_display |
No | masked_with_reveal |
Code visibility mode |
show_conditions |
No | true |
Show conditions section |
show_lock_status |
No | true |
Show lock status section |
show_code_sensors |
No | true |
Show code sensors in lock status |
show_lock_sync |
No | true |
Show sync status per lock |
collapsed_sections |
No | [] |
Sections to collapse by default: conditions, lock_status
|
Example:
views:
- type: sections
title: Lock Codes
sections:
- strategy:
type: custom:lock-code-manager-slot
config_entry_id: 1234567890abcdef
slot: 1
code_display: masked_with_reveal
- strategy:
type: custom:lock-code-manager-slot
config_entry_id: 1234567890abcdef
slot: 2Renders a lock codes section showing all slots for a specific lock.
| Option | Required | Default | Description |
|---|---|---|---|
lock_entity_id |
Yes | - | The entity ID of the lock |
code_display |
No | masked_with_reveal |
Code visibility mode |
Example:
views:
- type: sections
title: All Lock Codes
sections:
- strategy:
type: custom:lock-code-manager-lock
lock_entity_id: lock.front_door
code_display: masked
- strategy:
type: custom:lock-code-manager-lock
lock_entity_id: lock.back_doorLock Code Manager provides two custom cards that can be used independently or are automatically included by the strategies.
The slot card displays a single code slot with inline editing, real-time WebSocket updates, and collapsible sections. This is the default card used by the strategies.
Features:
- Inline editing for name, PIN, and enabled toggle
- Real-time updates via WebSocket
- Collapsible conditions and lock status sections
- Status badges showing active/inactive/disabled state
- Per-lock sync status
Configuration:
| Option | Required | Default | Description |
|---|---|---|---|
config_entry_id |
Yes* | - | Config entry ID for the LCM instance |
config_entry_title |
Yes* | - | Config entry title (alternative to ID) |
slot |
Yes | - | Slot number to display |
code_display |
No | masked_with_reveal |
How to display codes (see below) |
show_conditions |
No | true |
Show the conditions section |
show_lock_status |
No | true |
Show the lock status section |
show_code_sensors |
No | true |
Show code sensors in lock status |
show_lock_sync |
No | true |
Show sync status per lock |
collapsed_sections |
No | [] |
Which sections start collapsed (empty = all expanded) |
*Either config_entry_id or config_entry_title is required, but not both.
Example:
type: custom:lcm-slot
config_entry_id: 1234567890abcdef
slot: 1
code_display: masked_with_reveal
collapsed_sections:
- lock_statusThe lock codes card displays all code slots for a specific lock. It shows status badges, supports inline editing for unmanaged slots, and provides click-to-navigate for LCM-managed slots.
Features:
- Shows all slots on a lock with their current codes
- Status badges (Active, Inactive, Disabled, Empty)
- Sync status indicators
- Inline editing for slots not managed by LCM
- Click managed slots to navigate to their config entry
- Reveal button for masked codes
Configuration:
| Option | Required | Default | Description |
|---|---|---|---|
lock_entity_id |
Yes | - | The entity ID of the lock to display codes for |
title |
No | Lock name | Custom title for the card |
code_display |
No | masked_with_reveal |
How to display codes (see below) |
Example:
type: custom:lcm-lock-codes
lock_entity_id: lock.front_door
title: Front Door Codes
code_display: masked_with_revealBoth cards support three code display modes:
| Mode | Description |
|---|---|
masked |
Codes are always hidden (shown as bullets) |
unmasked |
Codes are always visible |
masked_with_reveal |
Codes are masked but can be revealed with a toggle button (default) |
If you prefer the old entities-card based UI, set use_slot_cards: false in your strategy configuration:
strategy:
type: custom:lock-code-manager
use_slot_cards: false
include_code_slot_sensors: trueNote: When using legacy mode (use_slot_cards: false), installing the
fold-entity-row card provides
a cleaner UI by collapsing related entities into expandable rows.

Getting Started
Features
- Blueprints
- Tracking lock state change events
- Using Condition Entities
- Unsupported Condition Entities
- Number of Uses (deprecated)
- Notifications
Advanced
Development
Troubleshooting
FAQ
Supported Integrations