The contents of the secrets file are used by the YAML processor and not by the Jinja2 interpreter.
When you do this in configuration.yaml
sender: !secret smtp_email_address
The !secret smtp_email_address is handled by the YAML processor on startup. It looks up smtp_email_address (in the secrets file) and supplies the associated value.
The Jinja2 interpreter has no access to the secrets file.
!secret in homeassistant just means ‘replace this with the corresponding entry from secrets.yaml’, so if you want to use something secret you have to replace the whole value.
@anon43302295 last question around of alarm automation for you
I think in this case I have no choice except create a template sensor and use it after iin my automation but I want enable it and disable it when I’m at home and I leave.
This is my automation but with a sensor that we can read into Lovelace
Is it a wa to avoid it ?
- alias: Enable Alarm Not At Home
id: dssssqsd34
trigger:
- platform: state
entity_id: person.me
to: "not_home"
action:
service: alarm_control_panel.alarm_arm_away
data_template:
entity_id: alarm_control_panel.alarm
code: "{{ sensor.pincode }}"
- alias: Disable Alarm At Home
id: dsssssscdgfddsqfsddddfsdfssdfdsdfds9880880989
trigger:
- platform: state
entity_id: person.me
to: "home"
action:
service: alarm_control_panel.alarm_disarm
data_template:
entity_id: alarm_control_panel.alarm
code: "{{ sensor.pincode }}" ============+> syntax is good ? with `"` ? Is there a differnt way to avoid to display the secret value ?