custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.9k stars 232 forks source link

Call-Service is not working #453

Open m3obsessed opened 3 years ago

m3obsessed commented 3 years ago

The call service within the button-card is not working and I cannot figure out why. Would love your help.

I set up my floor plan as a tab within Lovelace, using the config-template-card. The card is the Picture-Elements card, with many elements for each of the rooms in the house (I am only showing one room). The alarm is set up as a button (using the button-card). I want to disarm the alarm when it is armed by tapping the icon. And I want to arm the alarm when it is disarmed by tapping the icon.

In reality, when I tap, I get a pop up window showing the details/history of the entity and options to turn the alarm on. The service-call is not executed. I have tried many things. nothing seems to work. Here is the yaml code:

cards:

Alarm

    - type: custom:button-card
      entity: alarm_control_panel.17_denbigh_close_alarm_control_panel
      name: ' '
      show_state: false
      size: 40px
      style:
        top: 8%
        left: 95%
      state:
        - value: armed_home
          icon: mdi:shield-alert
          color: red
          tap_action: 
            action: call-service
            service: alarm_control_panel.alarm_disarm
            service_data:
              entity_id: alarm_control_panel.17_denbigh_close_alarm_control_panel
        - value: armed_away
          icon: mdi:shield-alert
          color: red
          tap_action: 
            action: call-service
            service: alarm_control_panel.alarm_disarm
            service_data:
              entity_id: alarm_control_panel.17_denbigh_close_alarm_control_panel
        - value: disarmed
          icon: mdi:shield-alert-outline
          color: green
          tap_action: 
            action: call-service
            service: alarm_control_panel.alarm_arm_home
            service_data:
              entity_id: alarm_control_panel.17_denbigh_close_alarm_control_panel
RomRider commented 3 years ago

*_action is not valid inside the state array.