Add a code to the Template Alarm Control Panel

Personally, I find this feature very useful when we have to integrate multiple alarms into HA and want to orchestrate with our own logic.
This works very well. But, I find that the code is missing in the template, although there are the 2 available attributes: “code_arm_required” and “code_format” !
Is it possible to add the “code” attribute like for the manual “Alarm Control Panel”, please?

Today, I’m bypassing it with a “condition template” in the Template Alarm and a secret !
extract from the template alarm:

arm_away:
          - condition: template
            value_template: !secret home_alarm_evaluate_code

extract from secrets:
home_alarm_evaluate_code: "{{ code == 'xxxx' }}"
Thanks.

Did you look at the example on the alarm template page? It shows you where the codes go:

# Example configuration.yaml entry
alarm_control_panel:
  - platform: template
    panels:
      safe_alarm_panel:
        value_template: "{{ states('alarm_control_panel.real_alarm') }}"
        arm_away:
          service: alarm_control_panel.alarm_arm_away
          target:
            entity_id: alarm_control_panel.real_alarm
          data:
            code: !secret alarm_code
        arm_home:
          service: alarm_control_panel.alarm_arm_home
          target:
            entity_id: alarm_control_panel.real_alarm
          data:
            code: !secret alarm_code
        disarm:
          - condition: state
            entity_id: device_tracker.paulus
            state: "home"
          - service: alarm_control_panel.alarm_disarm
            target:
              entity_id: alarm_control_panel.real_alarm
            data:
              code: !secret alarm_code

If I well understood the doc, these codes are sent as data for the « real » alarms not for the template alarm.

I would love to have this ability as well. Thanks for the workaround @bsfaxi :pray:

Workaround works great, thanks for the hint!

Thanks!!! This is a great workaround!

Thanks @bsfaxi !