Referencing secrets using substitutions

I have a large number of Sonoff smart plugs and I’m looking to templatize my configuration YAML using variables. It’s generally working, but the compile-time substitution seems to be failing for secret variables. For example, this fails:

substitutions:
  plug_id: "20"                         
  ha_api_key: !secret api_key_sonoff_s${plug_id}

Is there a different syntax needed for this, or is this not possible?

This seems to speak to the topic.

1 Like