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

Inconsistent behavior with regards to the alarm panel "Arm home"/"Arm away" buttons #17566

Closed
3 tasks done
paravoid opened this issue Aug 13, 2023 · 4 comments · Fixed by #17598
Closed
3 tasks done

Inconsistent behavior with regards to the alarm panel "Arm home"/"Arm away" buttons #17566

paravoid opened this issue Aug 13, 2023 · 4 comments · Fixed by #17598

Comments

@paravoid
Copy link

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

The Alarm Panel, when disarmed, shows two buttons: "ARM AWAY" & "ARM HOME".

The first problem is that these are not guaranteed to exist; Core provides a "supported features" mechanism, and AlarmControlPanelEntityFeature.ARM_HOME and AlarmControlPanelEntityFeature.ARM_AWAY are potential options. The default supported set, as defined in the base alarm_control_panel component, is "0", i.e. no features.

One can create e.g. a trivial template control panel (see below) that doesn't have either of these two, or both. In that case, when clicking the buttons, you get:
Failed to call service alarm_control_panel/alarm_arm_away. Entity alarm_control_panel.test_alarm does not support this service.

You can disable these either or both of these buttons in the card configuration. In that case, a semi-related, second problem is that when editing the configuration for the card, the buttons "arm away" and "arm home" are unchecked, despite the buttons being present. This results in a confusing interaction with the UI:

ha-mqtt-alarm

(Both seem related to the default and/or stub configuration, hence bundling these two up as one issue)

Describe the behavior you expected

At minimum, the presented buttons, and checkboxes when editing the card, should match each other to avoid the confusing recorded interaction above.

With regards to the core issue, I'd expect the default buttons to be a subset of the panel's supported features to avoid errors in an out-of-box configuration.

If that's too difficult or impossible, then perhaps no buttons would be more appropriate? This also feels confusing to users, so I'm not really sure about that...

Steps to reproduce the issue

  1. Create a test alarm panel like so:
alarm_control_panel:
  - platform: template
    panels:
      paradox_alarm:
        unique_id: test-alarm
        name: "Test Alarm"
        value_template: "disarmed"
        disarm:
          service: light.turn_off
          target:
            entity_id: light.test
  1. Try to hit the "Arm away"/"Arm home" buttons. (Problem 1)
  2. Now add arm_away in the above configuration. Try to hit the "Arm home" button.
  3. Now try to edit the Lovelace card to remove the "Arm home" button. (Problem 2)

What version of Home Assistant Core has the issue?

2023.9.0.dev0

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Firefox 116.0, Chromium 115.0

Which operating system are you using to run this browser?

Debian GNU/Linux (sid)

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@karwosts
Copy link
Contributor

karwosts commented Aug 14, 2023

I'm actually not seeing any issue with the stub configuration. If I create a brand new alarm control panel, by default I always see Arm home and Arm away checked by default. The yaml for the brand new alarm card is:

type: alarm-panel
states:
  - arm_home
  - arm_away
entity: alarm_control_panel.manual_alarm

Do you not get the states automatically generated when you add a new alarm control panel card?

The only way I can reproduce anything like what you're showing is if I manually remove the states key from the yaml editor.

@paravoid
Copy link
Author

So if I start from an empty dashboard, and add the alarm panel, then I get the behavior that you did, with arm_home and arm_away preconfigured. Progress!

However, if I create a new dashboard, then Edit, then agree to the prompt to "Take control", then "Raw configuration editor", then the YAML I see is:

- type: alarm-panel
  entity: alarm_control_panel.manual_alarm

@karwosts
Copy link
Contributor

I believe the linked PR addresses all of these issues.

@paravoid
Copy link
Author

I believe the linked PR addresses all of these issues.

😮 That's amazing! Thank you so much!

@github-actions github-actions bot locked and limited conversation to collaborators Aug 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants