Button to activate/deactivate alarm without code

I have an alarm button that gives me that status of my alarm:

type: 'custom:button-card'
entity: alarm_control_panel.somfy_protexiom_alarm
  - value: disarmed
    icon: 'mdi:shield-home'
    color: red
    name: Alarm off
  - value: armed_away
    icon: 'mdi:shield-home'
    color: green
    name: Alarm On

I would like to be able to click this button so that it activates and deactivates my alarm. At the moment when i click it it comes up with a box asking for the code. Is there any way around this? Perhaps with an automation?

Kind regards

Add a tap action to call a script.

In the script put the code to toggle your alarm state.

Many thanks for the reply. I am a newbie with hardly any coding knowledge… I have added my alarm to HA using a custom component (https://github.com/spiderjn/Hass-Somfy-Protexiom)

Is there something specific to this component that I have to call or is there a more general way to toggle the alarm?

Try something like this in a script

      - service: alarm_control_panel.alarm_arm
        entity_id: alarm_control_panel.somfy_protexiom_alarm
          entity_id: alarm_control_panel.somfy_protexiom_alarm
          code: !secret alarm_code

You probably need to delete one of the entity_id lines, since it depends on the implementation.