Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Security System: Turn off the zones together when the alarm is disarmed #14

Closed
wants to merge 1 commit into from
Closed

Security System: Turn off the zones together when the alarm is disarmed #14

wants to merge 1 commit into from

Conversation

paolotremadio
Copy link
Contributor

@paolotremadio paolotremadio commented Jul 24, 2018

Scenario: the alarm is set to "Away". One of the zones is triggered by one sensor. The alarm is now "Alarm". Turn the alarm to Off. Turn the alarm to "Away" again will automatically go to "Alarm" because one or more zones are still activated. We should give the option to automatically turn off / reset the zones when turning off the alarm.

@Darko2
Copy link

Darko2 commented Jul 24, 2018

I got the same issue of alarm turning right back on but i dont use zones. I suspect the “Alarm triggered” switch should be reset too.

@paolotremadio
Copy link
Contributor Author

@Darko2 can you please list the steps to reproduce? so I can have a look into it.

@Darko2
Copy link

Darko2 commented Jul 28, 2018

I ran some simulations to try to replicate the issue.
I tried to repeat the steps manually, my automations would ordinarily do, and this is what I got:

  • security system state = disarmed
  • all security system switches to off (stay, away, night, triggered)
  • alarm triggered switch to on
  • arm away switch (or any other arm switch) to on
    Alarm is immediately triggered.

Alarm is not triggered if the alarm triggered switch is left on while in arm state:

  • security system state = arm away
  • alarm triggered switch to on (alarm is triggered)
  • disarm alarm
  • arm away switch to on

I get now that an error in my automation behavior is the root cause of the problem, setting the trigger to on even when the alarm was disarmed should not happen.

Still, If alarm is disarmed (either with turning off the arm switches, or with setting the system state to disarm) the alarm triggered switch should be reset to off and if the alarm system state is changed from disarm to arm, the alarm triggered switch should first be set to off then the system should be armed.

Hope this helps. Thanks!

@paolotremadio
Copy link
Contributor Author

The reason of this PR is exactly that: fixing automations. I had an automation that was turning off the "alarm" switches when turning off the alarm. It worked but re-enabling the alarm was going straight in "Alarm" mode. The reason is: a race condition in the plugin. You can run a single change at the time, because the plugin is trying to store the settings on disc (async). If you change two or more accessories at once (with an automation), some will not be stored in the internal state and the UI will be out of sync. This PR solves my issue to start. I would ask @grover to think about a long term solution :)

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.

2 participants