Skip to content

Commit be91881

Browse files
raman325claude
andauthored
Move dashboard configuration from README to separate file (#851)
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 71382aa commit be91881

File tree

2 files changed

+188
-179
lines changed

2 files changed

+188
-179
lines changed

DASHBOARD_CONFIGURATION.md

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,182 @@
1+
# Dashboard Configuration
2+
3+
Lock Code Manager provides Lovelace strategies and custom cards for managing and monitoring
4+
PINs. You can use the dashboard strategy (full dashboard), the view strategy (single view
5+
for a config entry), or the custom cards directly.
6+
7+
See [this wiki article](https://github.com/raman325/lock_code_manager/wiki/Add-a-UI-for-lock-code-management#dashboard)
8+
for additional details.
9+
10+
## Dashboard Strategy
11+
12+
Use the dashboard strategy to build a full dashboard with one view per config entry, and
13+
an optional "User Codes" view that shows lock codes cards across all managed locks.
14+
15+
| Option | Default | Description |
16+
| ----------------------------------- | -------------------- | ----------------------------------------------------------- |
17+
| `use_slot_cards` | `true` | Use streamlined slot cards instead of legacy entities cards |
18+
| `show_code_sensors` | `true` | Show code sensors in lock status section |
19+
| `show_conditions` | `true` | Show conditions section in slot cards |
20+
| `show_lock_status` | `true` | Show lock status section in slot cards |
21+
| `show_lock_sync` | `true` | Show sync status per lock in lock status |
22+
| `collapsed_sections` | `[]` | Which sections start collapsed (empty = all expanded) |
23+
| `show_per_configuration_lock_cards` | `true` | Show lock cards in per-config-entry views |
24+
| `show_all_lock_cards_view` | `true` | Add a "User Codes" view with cards showing all lock codes |
25+
| `code_display` | `masked_with_reveal` | Code visibility mode for slot cards and lock codes cards |
26+
27+
Example dashboard configuration:
28+
29+
```yaml
30+
strategy:
31+
type: custom:lock-code-manager
32+
show_all_lock_cards_view: true
33+
show_per_configuration_lock_cards: true
34+
code_display: masked_with_reveal
35+
show_lock_sync: true
36+
```
37+
38+
## View Strategy
39+
40+
Use the view strategy when you want a single view for one config entry. If
41+
`show_lock_cards` is true, lock codes cards are appended below the slot
42+
cards within the same view (no extra view is created).
43+
44+
| Option | Default | Description |
45+
| -------------------------- | -------------------- | ----------------------------------------------------------------- |
46+
| `config_entry_id` | - | Config entry ID to render |
47+
| `config_entry_title` | - | Config entry title to render (alternative to ID) |
48+
| `use_slot_cards` | `true` | Use streamlined slot cards instead of legacy entities cards |
49+
| `show_code_sensors` | `true` | Show code sensors in lock status section |
50+
| `show_conditions` | `true` | Show conditions section in slot cards |
51+
| `show_lock_status` | `true` | Show lock status section in slot cards |
52+
| `show_lock_sync` | `true` | Show sync status per lock in lock status |
53+
| `collapsed_sections` | `[]` | Which sections start collapsed (empty = all expanded) |
54+
| `show_lock_cards` | `true` | Append lock codes cards below the slot cards |
55+
| `code_display` | `masked_with_reveal` | Code visibility mode for slot cards and lock codes cards |
56+
57+
Example view configuration:
58+
59+
```yaml
60+
strategy:
61+
type: custom:lock-code-manager
62+
config_entry_id: 1234567890abcdef
63+
show_lock_cards: false
64+
code_display: masked
65+
```
66+
67+
## Section Strategies
68+
69+
For advanced users building custom `sections`-type views, Lock Code Manager provides
70+
section strategies that generate cards when Home Assistant renders the section.
71+
72+
> **Note:** Section strategies simply render a single card (`lcm-slot` or `lcm-lock-codes`)
73+
> within a grid section. You can use the cards directly in your dashboard without using
74+
> section strategies - see the [Slot Card](#slot-card) and [Lock Codes Card](#lock-codes-card)
75+
> sections below.
76+
77+
### Slot Section Strategy
78+
79+
Use `custom:lock-code-manager-slot` to render a single slot section:
80+
81+
| Option | Required | Default | Description |
82+
| ------------------- | -------- | -------------------- | ------------------------------------------------------------- |
83+
| `config_entry_id` | Yes | - | Config entry ID for the LCM instance |
84+
| `slot` | Yes | - | Slot number to display |
85+
| `use_slot_cards` | No | `true` | Use new lcm-slot card (`true`) or legacy entities card |
86+
| `code_display` | No | `masked_with_reveal` | Code visibility mode |
87+
| `show_conditions` | No | `true` | Show conditions section |
88+
| `show_lock_status` | No | `true` | Show lock status section |
89+
| `show_code_sensors` | No | `true` | Show code sensors in lock status |
90+
| `show_lock_sync` | No | `true` | Show sync status per lock |
91+
| `collapsed_sections`| No | `[]` | Sections to collapse by default: `conditions`, `lock_status` |
92+
93+
```yaml
94+
views:
95+
- type: sections
96+
sections:
97+
- strategy:
98+
type: custom:lock-code-manager-slot
99+
config_entry_id: 1234567890abcdef
100+
slot: 1
101+
code_display: masked_with_reveal
102+
- strategy:
103+
type: custom:lock-code-manager-slot
104+
config_entry_id: 1234567890abcdef
105+
slot: 2
106+
```
107+
108+
### Lock Section Strategy
109+
110+
Use `custom:lock-code-manager-lock` to render a lock codes section:
111+
112+
| Option | Required | Default | Description |
113+
| ---------------- | -------- | -------------------- | ------------------------------------- |
114+
| `lock_entity_id` | Yes | - | The entity ID of the lock |
115+
| `code_display` | No | `masked_with_reveal` | Code visibility mode |
116+
117+
```yaml
118+
views:
119+
- type: sections
120+
sections:
121+
- strategy:
122+
type: custom:lock-code-manager-lock
123+
lock_entity_id: lock.front_door
124+
code_display: masked
125+
```
126+
127+
## Slot Card
128+
129+
The `lcm-slot` displays a single code slot with inline editing, real-time WebSocket
130+
updates, and collapsible sections for conditions and lock status. This is the default card
131+
used by the strategies when `use_slot_cards: true` (the default).
132+
133+
| Option | Required | Default | Description |
134+
| -------------------- | -------- | -------------------- | ------------------------------------------------------------ |
135+
| `config_entry_id` | Yes* | - | Config entry ID for the LCM instance |
136+
| `config_entry_title` | Yes* | - | Config entry title (alternative to ID) |
137+
| `slot` | Yes | - | Slot number to display |
138+
| `code_display` | No | `masked_with_reveal` | How to display codes: see modes below |
139+
| `show_conditions` | No | `true` | Show the conditions section |
140+
| `show_lock_status` | No | `true` | Show the lock status section |
141+
| `show_code_sensors` | No | `true` | Show code sensors in lock status |
142+
| `show_lock_sync` | No | `true` | Show sync status per lock |
143+
| `collapsed_sections` | No | `[]` | Sections to collapse by default: `conditions`, `lock_status` |
144+
145+
*Either `config_entry_id` or `config_entry_title` is required, but not both.
146+
147+
Example card configuration:
148+
149+
```yaml
150+
type: custom:lcm-slot
151+
config_entry_id: 1234567890abcdef
152+
slot: 1
153+
code_display: masked_with_reveal
154+
collapsed_sections:
155+
- lock_status
156+
```
157+
158+
## Lock Codes Card
159+
160+
The `lcm-lock-codes` displays all code slots for a specific lock with status badges,
161+
inline editing for unmanaged slots, and click-to-navigate for LCM-managed slots.
162+
163+
| Option | Required | Default | Description |
164+
| ---------------- | -------- | -------------------- | ---------------------------------------------- |
165+
| `lock_entity_id` | Yes | - | The entity ID of the lock to display codes for |
166+
| `title` | No | Lock name | Custom title for the card |
167+
| `code_display` | No | `masked_with_reveal` | How to display codes: see modes below |
168+
169+
Example card configuration:
170+
171+
```yaml
172+
type: custom:lcm-lock-codes
173+
lock_entity_id: lock.front_door
174+
title: Front Door Codes
175+
code_display: masked_with_reveal
176+
```
177+
178+
## Code Display Modes
179+
180+
- `masked` - Codes are always hidden (shown as bullets)
181+
- `unmasked` - Codes are always visible
182+
- `masked_with_reveal` - Codes are masked but can be revealed with a toggle button (default)

0 commit comments

Comments
 (0)