Accessing secrets from a template?

Has anyone accessed values from secrets.yaml in a template? I’ve recently moved away from using a environment file to secrets.yaml and I’m running into a couple of minor cosmetic annoyances (I would like to be able to concatenate values instead of defining new ones)

(pseudo-code):

ha_name: John
ha_device_battery_name: {{ secrets.ha_name }}'s Phone Battery
ha_ot_topic: owntracks/john/nexus6p
---
alias: Refresh Devices
sequence:
- service: mqtt.publish
  data:
    topic: "{{ secrets.ha_ot_topic }}/cmd"
    payload_template: '{"_type":"cmd","action":"reportLocation"}'
- service: mqtt.publish

Am I completely screwed up or is something like this even possible? Is anyone doing anything like this or have a different solution? Just curious.

1 Like

I don’t think this is possible. I just opened a feature request for this here: Make secrets available in templating engine

~Cheers

1 Like