Skip to content

feat(homebridge-ring): add allowDisarm option to block disarm from HomeKit#1650

Open
salmanesm wants to merge 5 commits intodgreif:mainfrom
salmanesm:feature/disable-homekit-disarm
Open

feat(homebridge-ring): add allowDisarm option to block disarm from HomeKit#1650
salmanesm wants to merge 5 commits intodgreif:mainfrom
salmanesm:feature/disable-homekit-disarm

Conversation

@salmanesm
Copy link

@salmanesm salmanesm commented Sep 1, 2025

feat(homebridge-ring): add allowDisarm option to block disarm from HomeKit

Closes #1651

Summary

Adds a new optional config flag, allowDisarm (default: true), to the Homebridge Ring plugin. When set to false, HomeKit Disarm requests are quietly blocked, while Arm Home/Away/Night continue to work as usual.

Why

Throwing an error from the .onSet handler produced a red error banner in the Home app / Siri, which was confusing even though the block was intentional. This change switches to a no-op + snap-back: the request is ignored and the Home app tile immediately reverts without an error toast.

What changed

  • Config: allowDisarm?: boolean (default true, backward-compatible).
  • security-panel.ts:
    • If state === DISARM and allowDisarm === false, log a warning, reset Target and Current state so the UI snaps back, and return early (no Ring API call, no thrown error).
  • Docs: README updated with a config snippet.

Behavior

  • allowDisarm: true → unchanged (HomeKit can arm & disarm).
  • allowDisarm: false → Disarm is ignored; UI/Siri show no error; Ring remains armed.

Config example

{
  "platform": "Ring",
  "refreshToken": "<your-token>",
  "allowDisarm": false
}

…rom HomeKit

- Introduced `allowDisarm` configuration parameter to the Homebridge Ring plugin.
- When set to `false`, disarming the Ring Alarm from HomeKit is blocked for added security.
- Updated documentation to reflect
@salmanesm
Copy link
Author

Hi @dgreif — this adds an optional allowDisarm flag (default true).
When false, HomeKit “Disarm” is quietly ignored (no error toast), while arming modes still work.
Docs updated with a config example. Happy to adjust naming, default, or placement if you prefer!

@salmanesm
Copy link
Author

Config used for validation: "allowDisarm": false
Expected behavior:
• Arm Home/Away/Night succeed
• Disarm is ignored (no error toast)
• Log: [Ring Alarm] Disarm attempt from HomeKit blocked (allowDisarm=false)
Implementation resets both TargetState and CurrentState so the Home app stays in sync.

… is blocked

When allowDisarm=false, set Target & Current back to the actual state and re-assert
after onSet (200ms, 1000ms) so the Home app reliably snaps back without an error.
- Compute `effectiveAllowDisarm`: `blockDisarm === true` → false; else `allowDisarm !== false`
- Use `effectiveAllowDisarm` in `security-panel.setTargetState` to decide whether to no-op/snap-back on disarm
@dgreif
Copy link
Owner

dgreif commented Feb 1, 2026

Thanks for the PR @salmanesm! I see the error banner as a "feature", not a bug. What are the scenarios where you expect a disarm to fail and are ok with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: add allowDisarm option to block HomeKit Disarm on Ring Alarm (PR #1650)

2 participants