Skip to content

ISSUE: Infinite Loop when Clearing Pin (Schlage Bug) #556

@justdaniel-gh

Description

@justdaniel-gh

Describe the bug
When disabling a user code, keymaster attempts to clear the pin. However, the pin "never clears" and so it infinitely loops trying to clear it. You can see this in the debug logs and the zwave_js events.

Environment (please complete the following information):

  • OS: HassOS
  • Type of system that HA is running on: RPi4
  • Home Assistant version:
    Installation method Home Assistant OS
    Core 2026.1.3
    Supervisor 2026.01.1
    Operating System 17.0
    Frontend 20260107.2
  • Component version: 0.1.2
  • Z-Wave integration name: zwave_js
  • Lock make and model:Schlage BE469ZP

Logs
2026-02-01 13:48:35.181 DEBUG (MainThread) [custom_components.keymaster.coordinator] [clear_pin_from_lock] Frontdoor: Code Slot 9: Clearing PIN
2026-02-01 13:48:35.731 DEBUG (MainThread) [custom_components.keymaster.coordinator] [clear_pin_from_lock] Frontdoor: Code Slot 9: Clear command sent, confirming
2026-02-01 13:48:35.732 DEBUG (MainThread) [custom_components.keymaster.coordinator] [clear_pin_from_lock] Frontdoor: Code Slot 9: PIN Not Cleared, will retry
2026-02-01 13:48:35.747 DEBUG (SyncWorker_2) [custom_components.keymaster.coordinator] [write_config_to_json] JSON File Updated
2026-02-01 13:48:35.750 DEBUG (MainThread) [custom_components.keymaster.coordinator] [schedule_quick_refresh_if_needed] Scheduling refresh in 15 seconds
2026-02-01 13:48:35.750 DEBUG (MainThread) [custom_components.keymaster.coordinator] Finished fetching keymaster data in 0.571 seconds (success: True)

... repeats every 15 seconds ...

zwave_js:
2/1/2026, 1:49:49 PM - value updated
Arg 0:
└─commandClassName: User Code
└─commandClass: 99
└─endpoint: 0
└─property: userCode
└─propertyKey: 9
└─newValue: 000000
└─prevValue: 000000
└─propertyName: userCode
└─propertyKeyName: 9

Additional context
The problem appears to be in coordinator.py in clear_pin_from_lock. You're only checking for "" or "0000" to be returned; however, if the pin length is any other length except 4, this doesn't catch it. I've got a generic fix and I can submit a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions