Support !secret in Automations

Home Assistant currently doesn’t support using !secret in automations or scripts, which makes it difficult to securely manage sensitive data like Alarm code, API keys and tokens. I’m requesting that !secret be extended to automations for improved security and consistency.

Why This Is Important:

  1. Security:
    Automations often need sensitive data (Alarm code, API keys, tokens). Without !secret support, this information has to be stored in plaintext, increasing the risk of exposure.
  2. Consistency:
    !secret works in configuration.yaml, but not in automations.yaml. Supporting it in automations would create a uniform way to handle sensitive data across all configuration files.
  3. Easier Maintenance:
    Without !secret, updating sensitive data requires manual changes in multiple places. With !secret, users could manage all sensitive information centrally.

EDIT: Automation definitely does not support secrets in the portal. When you edit the YAML and add a secret, it throws an error and won’t let you save.
(Alamro) is a custom add-on, but I was referring to native automation. The mod should have checked first before closing the post or waited for a reply.

Who said they don’t work in automations?
I think they do.

They definitely do. e.g. one of my actions:

  - action: alarmo.arm
    data:
      entity_id: alarm_control_panel.alarmo
      code: !secret alarm_code
      mode: away
      skip_delay: false

I will close this as already implemented. If you are having trouble using !secret in your automation please post a new topic in the forum’s Configuration category.

Actually this only works for YAML, (it has nothing to do with the integration, Alarmo) not in the UI.

Staying closed as a duplicate as there is an existing FR open you can vote for here: Secrets in automations