Skip to content
raman325 edited this page Aug 21, 2026 · 3 revisions

Custom Cards

Lock Code Manager registers three custom Lovelace cards. They're the building blocks the UI Strategies generate, but you can also place them yourself anywhere in a hand-built dashboard.

The user card and the lock codes card have visual editors in the dashboard UI, so you can configure them by clicking Edit dashboard → Add card → Custom: LCM User Card / Lock Codes Card without writing YAML. The tables below document every option for users editing in YAML or building strategies.


User card (custom:lcm-user)

Displays a single Lock Code Manager user with inline editing of name/PIN/enabled state, real-time updates over WebSocket, and collapsible Conditions and Lock status sections.

Renamed in 5.0. This card was custom:lcm-slot, and that name still works — it is the same card, and it logs a deprecation warning. It will be removed in a future release, so change type: custom:lcm-slot to type: custom:lcm-user in any dashboard you wrote by hand. Generated dashboards update themselves.

The card no longer shows a slot number anywhere. See Upgrading to 5.0.

Features

  • Inline editing of the slot name, PIN, and enabled toggle (no need to dive into the integration's options page).
  • Real-time updates: name, PIN, and condition entity changes pushed live over a WebSocket subscription.
  • Status badges at the card header: active, inactive, disabled, pending sync, suspended.
  • Conditions section showing the configured condition entity (calendar, schedule, binary_sensor, etc.) with a Wire condition entity dialog for adding one inline.
  • Optional condition helper entities (toggles, schedules, etc.) surfaced under the condition entity for quick access from the dashboard.
  • Lock status section showing per-lock sync state and (optionally) the actual code currently on each lock.
  • Lock-count badge showing how many locks the user is configured on.
  • Remove user, with a confirmation naming them. The confirmation exposes whether to clear their code from the locks, because the two answers are different intents: revoke the credential, or hand it over and stop managing it. It defaults to clearing.

Configuration

Either config_entry_id or config_entry_title is required — not both. Identify the user with user_entity_id, name, or (deprecated) slot.

Option Type Default Description
config_entry_id string LCM config entry ID. Use this for stability across renames.
config_entry_title string LCM config entry title. Convenient for hand-edited YAML.
user_entity_id string An entity belonging to the user to display. The steadiest way to address one: it survives renames, which a name does not. This is what generated dashboards use.
name string The user to display, matched ignoring case and punctuation. Convenient to write by hand.
slot int Deprecated. The slot number the user holds. Still accepted so existing dashboards keep working; prefer user_entity_id or name.
code_display masked | unmasked | masked_with_reveal masked_with_reveal How code values render in the Lock status section. See Code display modes.
show_conditions bool true Show the Conditions section.
show_lock_status bool true Show the Lock status section.
show_code_sensors bool true Deprecated. No longer rendered by the slot card; the hero PIN at the top of the card already displays the synced code with a show/hide toggle. Still accepted for backward compatibility so existing dashboards continue to validate.
show_lock_sync bool true Show per-lock sync state inside Lock status.
show_lock_count bool true Show the lock-count badge in the card header.
collapsed_sections array of condition | conditions | lock_status [] Sections that start collapsed. (Both condition and conditions are accepted.)
condition_helpers array of entity IDs none Extra helper entities (input_booleans, schedules, switches, etc.) surfaced underneath the condition entity for quick toggling from the dashboard.

Example

type: custom:lcm-user
config_entry_id: 01HZK9X4GR3PQ8YFAB6V0CZ7TM
name: Raman
code_display: masked_with_reveal
collapsed_sections:
  - lock_status
condition_helpers:
  - input_boolean.guest_arrived
  - schedule.guest_quiet_hours

Add user card (custom:lcm-add-user)

New in 5.0. A button that opens a dialog for adding a user to a config entry, so an entry can be managed entirely from the dashboard. Generated dashboards place one between the users and the locks.

Features

  • Name, and an optional PIN with a show/hide toggle.
  • Generate PIN, with a length between 4 and 12 digits. This calls generate_pin rather than inventing one locally, so the same safety filtering applies, and it reveals the result — a code you cannot read is one you cannot pass on.
  • An optional condition entity, if Home Assistant has made its entity picker available to the dashboard. When it has not, the field is left out rather than replaced by a free-text entity ID, and you can set the condition from the user card afterwards.
  • An enabled toggle.

Submitting calls add_user and reloads the page, because the view is strategy-generated and the new user has no card until the strategy runs again.

The card decides nothing beyond those fields — the integration picks the slot number. Capacity and allocation rules live in one place, and a second copy in the frontend would drift.

Configuration

Either config_entry_id or config_entry_title is required — not both.

Option Type Default Description
config_entry_id string LCM config entry ID. Use this for stability across renames.
config_entry_title string LCM config entry title. Convenient for hand-edited YAML.

Example

type: custom:lcm-add-user
config_entry_id: 01HZK9X4GR3PQ8YFAB6V0CZ7TM

Lock codes card (custom:lcm-lock-codes)

Displays all code slots for a specific lock — both LCM-managed and unmanaged — with status badges and inline editing for the unmanaged ones.

Features

  • Shows every slot on the lock with its current code (subject to Code display modes).
  • Status chips per slot: Active, Inactive, Disabled, Empty, Pending sync.
  • Sync-status indicators with distinct visual treatment for in-sync, out-of-sync, syncing, and suspended states.
  • LCM-managed slots are clickable: clicking navigates to the slot's config entry view.
  • Unmanaged slots are inline-editable: click the code value to set or clear it (uses set_usercode / clear_usercode from Services and Actions).
  • Reveal/hide button for masked codes when code_display: masked_with_reveal.

Configuration

Option Type Default Description
lock_entity_id lock entity (required) The lock to display codes for.
title string lock's friendly name Custom title for the card.
code_display masked | unmasked | masked_with_reveal masked_with_reveal How code values render. See Code display modes.

Example

type: custom:lcm-lock-codes
lock_entity_id: lock.front_door
title: Front Door Codes
code_display: masked_with_reveal

Code display modes

Both cards (and every strategy that wraps them) accept the same code_display values:

Mode Description
masked Codes are always hidden as bullets. Length is preserved when known.
unmasked Codes are always visible in plain text.
masked_with_reveal (default) Codes are masked but can be revealed individually with a per-card toggle button.

Privacy reminder: masked only hides codes in this card's UI — it doesn't redact PIN values from logs, the underlying text.* PIN entities, the device activity log, or the recorder database. See PIN Codes Visible in Activity Log for the broader picture.

Clone this wiki locally