WTH - add substitutions ability to automations / scripts

similar to capability in ESPHome, would love to see substitutions in Automations and Scripts for ease of reusability.

ESPHome substitution feature is great and really improves the re-usability of code. We can use a similar feature for HA, the secrets file is good but not near enough to work like substitution feature.

You can use YAML anchors, does this not achieve what you are looking for?

YAML anchors are really useful. Unfortunately, they only seem to work for discrete identifiers/values or lists. I could not find a way to do string concatenation of an anchor value plus another string to produce a new single identifier.

For example, combining a device ID in an anchor value plus a suffix string to create an entity ID or an MQTT topic.

I could not find a combination of quotes or other punctuation that would combine into a single result value.

What about blueprints?

They are basically automations with user defined inputs, very similar in concept to substitutions in esphome. It’s a little more disconnected than substitutions where everything is in yaml config, but it has good GUI at its current state. I’d recommend giving it a try.

You can also check out script fields.

Blueprints and script fields are great for creating actions and automations.

They don’t do anything to help creation of sensors-- devices or entities.

I have some MQTT devices that have a dozen entities for the device, doesn’t support HA Autodiscovery, and I have several of these devices. Manually duplicating all of that multiple times is a waste of effort and is error-prone.

We need blueprints for sensors, or “script fields” for packages.

Ah I see what you mean now, but OP did mention automations.

+1 for this feature request! Reason:
I have a few frontend cards which have a entity name in in. For example: plots graph where screek_human_sensor_2a_734e6c needs to be replaced with the actual name.
Substitutions would make it awesome instead of search and replace every time.