2026-07-05 19:22:46 +00:00
|
|
|
|
# Door Locks & Codes
|
|
|
|
|
|
|
|
|
|
|
|
<overview>
|
|
|
|
|
|
Two Z-Wave (zwave_js) keypad locks: `lock.lodge_front_door_lock` (node 3) and
|
|
|
|
|
|
`lock.bunkhouse_frontdoor_lock`. 8 shared code slots, managed from the
|
|
|
|
|
|
"Lock Management" Lovelace view via helpers:
|
|
|
|
|
|
`input_text.lock_slotN_user`, `input_text.lock_slotN_code`,
|
|
|
|
|
|
`input_boolean.lock_slotN_enabled` (N = 1–8).
|
|
|
|
|
|
Slot 1 = Fritz family, 2 = cleaner, 4 = carpenter, 5 = backup.
|
|
|
|
|
|
</overview>
|
|
|
|
|
|
|
|
|
|
|
|
<sync>
|
2026-07-05 19:41:42 +00:00
|
|
|
|
All code writes go through `script.lock_sync_slot` (fields: `slot` 1–8), the
|
|
|
|
|
|
single source of truth. Per slot it: resolves the code (slot's own code if
|
|
|
|
|
|
`_enabled` on, else the slot-1 family code), REFUSES non-4-10-digit codes
|
|
|
|
|
|
(persistent notification "slot N SKIPPED", nothing written), then per lock does
|
|
|
|
|
|
a UserCode CC `get` (repopulates the Z-Wave value cache so a missing cached
|
|
|
|
|
|
slot can't error) followed by `zwave_js.set_lock_usercode` — every zwave call
|
|
|
|
|
|
`continue_on_error` so one lock/slot never blocks the rest.
|
2026-07-05 19:22:46 +00:00
|
|
|
|
|
2026-07-05 19:41:42 +00:00
|
|
|
|
- `script.lock_sync_all_codes` — warns (persistent + `notify.mobile_app_donavan_s_iphone_16_pro`)
|
|
|
|
|
|
if a lock's `*_node_status` sensor isn't alive/asleep, then runs
|
|
|
|
|
|
`lock_sync_slot` for slots 1–8.
|
|
|
|
|
|
- `automation.lock_slot_N_sync_both_locks` (×8) — trigger on the slot's
|
|
|
|
|
|
`_enabled` OR `_code` helper change → `lock_sync_slot` for that slot.
|
|
|
|
|
|
- `automation.lock_codes_full_sync_self_heal` — full sync daily 04:00 and
|
|
|
|
|
|
10 min after HA start, so transient failures heal within a day.
|
|
|
|
|
|
|
|
|
|
|
|
Disabled slots are overwritten with the family code (design choice), so the
|
|
|
|
|
|
family code exists in multiple lock slots.
|
2026-07-05 19:22:46 +00:00
|
|
|
|
</sync>
|
|
|
|
|
|
|
|
|
|
|
|
<troubleshooting>
|
|
|
|
|
|
Error `userCode for code slot N not found` from `zwave_js.set_lock_usercode`
|
2026-07-05 19:41:42 +00:00
|
|
|
|
= Z-Wave JS value cache has no userCode value for that slot, NOT a lock or code
|
|
|
|
|
|
problem. The sync script's pre-`get` prevents it; manual fix:
|
|
|
|
|
|
`zwave_js.invoke_cc_api {device_id, command_class: "99", method_name: "get", parameters: [N]}`
|
|
|
|
|
|
then re-run the sync.
|
2026-07-05 19:22:46 +00:00
|
|
|
|
</troubleshooting>
|
2026-07-05 19:41:42 +00:00
|
|
|
|
|
|
|
|
|
|
<backup>
|
|
|
|
|
|
Scripts/automations/dashboards/helper-definitions are mirrored to
|
|
|
|
|
|
`dfritz/home-assistant` repo under `lodge/` (API export — the lodge HA has no
|
|
|
|
|
|
SSH). Nightly Gitea Actions workflow `.gitea/workflows/backup-ha.yaml` IN THIS
|
|
|
|
|
|
SKILL REPO (secrets `HA_TOKEN` + `GIT_TOKEN` on skills/thelonglakelodge; ops
|
|
|
|
|
|
lacks rights to put secrets on dfritz/home-assistant) exports and pushes only
|
|
|
|
|
|
on change; failure emails via action/notify-email. Manual run: the workflow's
|
|
|
|
|
|
`workflow_dispatch`, or `HA_TOKEN=... lodge/backup.sh` in the mirror repo.
|
|
|
|
|
|
</backup>
|