Entity_id based on input selection

Good day everyone,

I’m trying to figure out an automation that sets an input_boolean to “on” but the entity_id of the boolean is dynamically based on an input_select field in my dashboard.
This is the input selectuion I have on my dashboard:

input_select:
  streaming:
    name: Streaming
    options:
      ['ziggo', 'netflix', 'disney', 'plex']
    initial: ziggo  
    icon: mdi:netflix

And my automation:

  - alias: select_streaming_service
    initial_state: true
    trigger:
      - platform: state
        entity_id: input_select.streaming
    action:
      - service: input_boolean.turn_on
        data:
          entity_id: >
            {{ input_boolean.states(trigger.entity_id) }}

But how can I create my entity_id to be outputted in the form e.g. input_boolean.netflix based on the input selection?

Can’t seem to get it properly fixed so any help would be much appreciated!

Try this:

entity_id: >
  input_boolean.{{ trigger.to_state.state }}
1 Like

So simple… Thanks