Add locks reference: code slot helpers, sync script, usercode-cache troubleshooting

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Claude
2026-07-05 19:22:46 +00:00
parent 2a88f83b44
commit 5e213759d6
2 changed files with 39 additions and 0 deletions
+32
View File
@@ -0,0 +1,32 @@
# 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 = 18).
Slot 1 = Fritz family, 2 = cleaner, 4 = carpenter, 5 = backup.
</overview>
<sync>
`script.lock_sync_all_codes` (mode: queued) walks slots 18; for each slot it
calls `zwave_js.set_lock_usercode` on BOTH locks — the slot's code if its
`_enabled` boolean is on, otherwise the slot-1 family code (hardcoded in the
script's default branches). `automation.lock_slot_N_sync_both_locks` (per slot)
also pushes on helper change. An error on any step ABORTS the script — later
slots and the second lock do not sync.
The `input_boolean.lock_code_slot_N_*` / `input_text.lock_code_slot_N_*` /
`input_boolean.lock_slotN_lodge/bunkhouse_enabled` entities are unavailable
leftovers from earlier schemes — ignore.
</sync>
<troubleshooting>
Error `userCode for code slot N not found` from `zwave_js.set_lock_usercode`
= Z-Wave JS value cache has no userCode value for that slot (never
queried/interviewed), NOT a lock or code problem. Fix by forcing a UserCode CC
read to repopulate the cache, then re-run the sync script:
`zwave_js.invoke_cc_api {device_id, command_class: "99", method_name: "get", parameters: [N]}`.
(2026-07-05: lodge slot 3 hit this; gets were run for slots 18 on both locks.)
</troubleshooting>