Template use to set entity_id

Thanks!! Thats great! I added a second part to the question while you were answering already.

What I rather mean is somethign like this, but my YAML skills are basically nonexistant:

entity_id: input_boolean.fluppflupp_+"{{ sometranslationfunction(trigger.to_state.state) }}"

where trigger.to_state.state may contain whitespaces, “/” and “+”
These need to be replaced with “_”

If the automation is triggered by the input_select then trigger.to_state.name is the friendly_name of the input_select (and has nothing to do with whichever option was selected).

In this case, the automation’s template will have to convert the option’s value to make it match the input_boolean’s name.

For example, let’s say input_select’s state is set to Blibb Blubb. To make it match input_boolean.blibb_blubb the template can do this:

- service: input_boolean.turn_on
  data_template:
    entity_id: input_boolean.{{ trigger.to_state.name.replace(' ', '_') | lower }}

awesome. if I need to replace more characters than whitespaces, how to go?

trigger.to_state.name.replace(' ', '_').replace('-', '_')

Alternately, if possible, avoid using characters that require replacement.

Dude you made my day, it works like a charm! Actually what now works is that I exposed those booleans to homekit bridge and can now switch between my media setups using Siri. That already worked before, but now it is so much more compact and elegantly coded.