MiguelRipoll23 / homebridge-securitysystem

Homebridge plugin that creates a security system accessory that can be triggered by HomeKit sensors.
https://www.npmjs.com/package/homebridge-securitysystem
MIT License
151 stars 13 forks source link

Feature request: Dedicated Siren switch for each mode #21

Closed macjl closed 4 years ago

macjl commented 4 years ago

Hello,

I love your plug-in to make a powerfull security system.

Would it be possible to add an option to have multiples Siren Switchs, one for each state : home, away, night?

The security system would be triggered only when the switch which match the current state would be on. This would be easier to create automation. In your example, you would not need condition :

Trigger Condition Scene actions
Motion is detected None Turn on Siren Night
Door is opened None Turn on Siren Away
NFC tag is detected (1) (2) None Set security system to Home
Security system triggers None Play media (1)
MiguelRipoll23 commented 4 years ago

Sure, sounds great!

Right now a more advanced HomeKit app like Eve is required to create the examples listed as you said, adding these switches would remove the need to install an extra app.

I will check this out this weekend and release a new version as soon as everything is tested.

MiguelRipoll23 commented 4 years ago

New version released that adds this feature and #22 🎉, be free to continue the discussion here if you have any feedback.

Have a good weekend.

macjl commented 4 years ago

I've upgraded to last version and it works as expected! Thank you!

The only improvement I can see, is that I have disabled the 'Home' mode via parameter : "disabled_modes": ["home"] But the "Siren Away" switch is still displayed. Do you think it could be hidden in this case?

Have a good weekend too.

MiguelRipoll23 commented 4 years ago

Did you mean "Siren Home", right? Yeah, that should be hidden so let met fix that real quick!

macjl commented 4 years ago

Yes "Siren Home"! Sorry!

MiguelRipoll23 commented 4 years ago

Fixed it on a new release tagged as a beta to add more changes before releasing another version, install it using this command:

npm i homebridge-securitysystem@2.3.1

macjl commented 4 years ago

Thank you!

Really appreciate your work! I' closing this issue now, but open a new one, as I have an other feature that I think could be useful for you.

macjl commented 4 years ago

Hello,

I have make some more tests, and I saw a behaviour that may be not correct.

The security system is set to 'away' mode : [4/18/2020, 9:13:11 PM] [Security System] Current state (Away) OK

Then, the switch 'Siren Away' was pushed on : [4/18/2020, 9:13:21 PM] [Security System] Sensor/s (Triggered) OK.

So, the system is in state 'triggered' mode : [4/18/2020, 9:13:21 PM] [Security System] Current state (Triggered) OK

Now, the switch 'Siren Away' was pushed off. [4/18/2020, 9:13:29 PM] [Security System] Target state (Off) The system is set in state 'Off'. Shouldn't it be set in 'Away' mode instead?

For now, I didn't test it with the global 'Siren' switch to see if the behaviour is different.

MiguelRipoll23 commented 4 years ago

This was actually intended for both the global and mode switches as it's a little bit risky to go back to the same armed state immediately and then triggering it again accidentally (the reason the arming delay is skipped is to avoid having to wait to exit the triggered state).

Changing to an armed state while the security system is triggered is still possible though, but it has to happen very explicitly using the mode menu from the Home app or an automation. Even Apple doesn't let you go back to the same mode prior to the triggered state because it appears already as selected.

I'm okay with changing the behavior if you think that it impacts functionality, I just followed the same rules from the Home app.

MiguelRipoll23 commented 4 years ago

I think setting the off mode when turning off the sirens switches is the most appropriate option to avoid false alarms but if there's any commercial security systems that do a different behavior or it's impacting an use case that you're trying to do feel free to continue the discussion here to rethink it and change it if necessary.

macjl commented 4 years ago

Hello. No problem if it's a wanted behaviour! I was just asking me if it's normal. For my usage, I don't need to change anything. Thank you.