benzman81 / homebridge-http-webhooks

A http plugin with support of webhooks for Homebridge: https://github.com/nfarina/homebridge
GNU General Public License v3.0
178 stars 57 forks source link

Security system current state should not be set automatically #170

Open sjohnr opened 1 year ago

sjohnr commented 1 year ago

Current behavior

When arming a security system from HomeKit, the target AND current state are set in Homebridge, and the Characteristic.SecuritySystemCurrentState is set to the new state automatically.

Expected behavior

When arming a security system from HomeKit, only the target state should be set, and no characteristics should be updated (since HomeKit has already set the Characteristic.SecuritySystemTargetState to the desired state. The downstream security system (e.g. the "accessory") should set the current state using the HTTP API only when the security system has actually armed itself.

Context

Using this library for a security system, HomeKit immediately arms the security system when the state is changed by a user. If the downstream security system later uses the API to update the current state, it has no effect because it is already set in Homebridge and propagated back to HomeKit by this plugin. Additionally, there is no opportunity for the security system to show "Arming" for a period of time. If the security system changes the current state to something else (such as OFF) during the arming period, it triggers a notification in HomeKit (e.g. that the system was disarmed), which should not happen.

Happy to submit a PR if desired.

benzman81 commented 1 year ago

Since I do not use a security system feel free to provide a PR. Since this would change the behavior there should be an additional setting to activate your new behavoir to not break existing configurations.