How to Arm and Disarm from a button with no "More Info"

I would like to toggle between arm_away and disarm in Lovelace without the More Info box popping up. My yaml is below. Can someone help me tweak this, perhaps with a tap_action?

type: button
name: Alarm
states:
  - value: disarmed
    color: 'rgb(255, 0, 0)'
    icon: 'mdi:bell-off'
    name: 'OFF'
  - value: pending
    color: 'rgb(251, 210, 41)'
    icon: 'mdi:security'
    name: PENDING
  - value: armed_away
    color: 'rgb(0, 255, 0)'
    icon: 'mdi:security'
    name: ARMED
show_state: true
entity: alarm_control_panel.ha_alarm

This does not appear to be valid configuration for the button card:

states:
  - value: disarmed
    color: 'rgb(255, 0, 0)'
    icon: 'mdi:bell-off'
    name: 'OFF'
  - value: pending
    color: 'rgb(251, 210, 41)'
    icon: 'mdi:security'
    name: PENDING
  - value: armed_away
    color: 'rgb(0, 255, 0)'
    icon: 'mdi:security'
    name: ARMED

You mean you don’t want to type in the code?
In that case you need to make a script for each arm mode with the code as data.
So…
Script 1
Action arm_away … code: 1234

script 2
action arm_home … code: 1234
and so on…

Then have the scripts as the buttons.

@tom_l I took it from this post and it seems to be working fine for me, but it gives me a pop-up and I want it to toggle with a tap. @Hellis81 I’d love to type the code. This is my foray into modifying Lovelace with raw yaml and I’m learning as I go. I have no formal coding experience so I’m hoping to get some help with baby steps like this so I can build a foundation from which to get my hands dirty on my own.

If you look closely that is a completely different card.

Their card:

type: 'custom:button-card'

Your card:

type: button

This is why you are seeing the odd pop-up behaviour. As I said, all of this is invalid for the card you are using:

states:
  - value: disarmed
    color: 'rgb(255, 0, 0)'
    icon: 'mdi:bell-off'
    name: 'OFF'
  - value: pending
    color: 'rgb(251, 210, 41)'
    icon: 'mdi:security'
    name: PENDING
  - value: armed_away
    color: 'rgb(0, 255, 0)'
    icon: 'mdi:security'
    name: ARMED

Only these options are valid.

I’m not here to argue, to be clear. I’m a noob and there’s a lot I don’t know. Two things I do know:

  1. the example I linked-to includes in the yaml action: more_info. So, I have no reason to expect that by strictly following that yaml I will be any closer to achieving the result I am seeking, which is to forego more_info. I don’t yet know how to create a custom button-card and…

  2. type: button is working fine. It’s giving me the same result that the custom:button-card had intended to achieve for the original user. If I were to create a custom button card, the appearance of the card would be the same as that which I currently have. I want to change the functionality of the button so there is no more_info upon tapping.

Perhaps this is the question I should ask: How would one modify the original yaml such that the action were not more_info, but rather, a toggle between arm_away and disarm? With that info, I will just need to learn to make a custom:button-card and I’ll be all set.

Only because the developers are clever. You will find all that extra yaml I pointed out is being ignored and generating warnings.

By reading the link I posted and adjusting the the tap_action to call a single script ( call-service as scripts are services). The script should use the choose action to determine whether to disarm or arm. If the alarm is armed, disarm it, and vice-versa.

I see. I have a lot to learn yet about scripts. Thank you for giving me some info to work with so I now know what I’m looking for. I really appreciate it.

No problem. Have a go (best way to learn) and if you have any issues post them here for help.