EHylands / homebridge-qolsys

Homebridge Qolsys IQ Panel plugin
MIT License
15 stars 1 forks source link

Support read only mode #19

Closed cistearns closed 1 year ago

cistearns commented 1 year ago

Currently the plugin requires that a user code pin is set, for changing the arm state. Ideally users could configure the plugin as a read-only mode not requiring the pin code. (though still requiring the C4 key) This would allow sensors to be used for triggers in automations, and viewing the state from a HomeKit screen w/o adding any potential security concerns for those that don't need the ability to change arm states from HomeKit.
Technically the ability to arm stay/away shouldn't require the PIN, so that might be nice to support - though there is probably still a good case to make those optional. Especially in cases where security is monitored.

EHylands commented 1 year ago

Hi, I totally understand what you would like to acheive. The only "problem" is that I haven't found a way to put the Homekit Security System accessory in a read only mode.

Technically the ability to arm stay/away shouldn't require the PIN, so that might be nice to support If the Secure Arm option on your panel in disable, the plugin will not send the pin code to arm stay or arm away.

For the moment, you can enable Secure Arm option on your panel and set an erroneous pin code in Homebridge (0000). Arming state will be available. You won't be able to change the Arming state with the accessory.

I see 2 possible solutions for a Read Only mode:

1- If the state of the Homekit Security accessory is change while Read Only mode is enabled, revert accessory back to actual panel arming state without sending any command to panel. I don't know if that would trigger any automations linked to the Security System acccessory arming state ...

2- I'll try to dig further in the Security System accessory documentation to see if it can be put in read only mode.

EHylands commented 1 year ago

I was able to create a read only Security System in Homebridge by removing the Paired_Write Perm. Unfortunatly, the custom accessory doesn't show up in Home App for the moment ...

const ValidPerms = [ this.platform.api.hap.Characteristic.Perms.EVENTS, this.platform.api.hap.Characteristic.Perms.PAIRED_READ, // this.platform.api.hap.Characteristic.Perms.PAIRED_WRITE, ];

this.service.getCharacteristic(this.platform.api.hap.Characteristic.SecuritySystemTargetState) .setProps({ perms: ValidPerms });

cistearns commented 1 year ago

A couple of added thoughts. One option may be to have a config option allow completely turning off the Security System Accessory (Arm state) and just allow reporting of sensors state.

The other would be to just not allow Disarm as a valid state to set. I haven't dove into the HomeKit docs for that accessory type, but it seems a little weird that they wouldn't have accounted for the fact that Disarm probably isn't command you want to work via Siri, so that it can be a reported state, but not a state to set to or if it is a state that can be flagged to not work with Siri.

That is my main concern with setting up a PIN code - while having support for arming is nice - and maybe some automated disarm cases, but I don't want "Hey Siri Disarm" to work. Maybe I'm incorrect in my assumption that the way this is setup know would allow that?

EHylands commented 1 year ago

Hi,

You can uncheck ´Show Security Panel' option in config to prevent the Security System accessory from showing up in Home App.

Siri will only be able to change a Security System accessory arming state if your device is unlocked. People use dummy switch automations to bypassed that security feature.

Will dig further in Security System accessory characteristics as soon as I can.

cistearns commented 1 year ago

Siri will only be able to change a Security System accessory arming state if your device is unlocked. People use dummy switch automations to bypassed that security feature.

Does that mean that HomePods can't ever change a Security System accessory arming state by default?

EHylands commented 1 year ago

Siri will only be able to change a Security System accessory arming state if your device is unlocked. People use dummy switch automations to bypassed that security feature.

Does that mean that HomePods can't ever change a Security System accessory arming state by default?

Found the following in Homepod Siri documentation:

Check the status of a security accessory: You can use HomePod to lock or check the status of door locks and other smart home security accessories. Say something like “Hey Siri, is the front door locked?” To unlock or open security accessories, you must complete your request on your iOS or iPadOS device because unlocking them requires authentication using Face ID, Touch ID, or a passcode.

Siri through Homepod can't Disarm your security system.

cistearns commented 1 year ago

I think what I was really looking for then was just to make it so that rather than requiring a PIN code to be set (even a dummy one) to run the plugin, that it would be allowed to run with no PIN configured but then ´Show Security Panel' option would be forced to unchecked. But I'm good to close this based on the added information around the Siri behavior etc.