Using 'trigger.id' to set an 'option' for an 'input_select'

I am trying to save myself the extra steps with the ‘choose’ for the automation action and instead labeled the triggers with IDs.
The automation action is basically setting the ID of the trigger as the current option in the input select:

automation:
  - alias: scene switcher
    trigger:
      - platform: time
        at: input_datetime.morning
        id: Morning scene
      - platform: time
        at: input_datetime.evening
        id: Evening scene
    condition: []
    action:
      - service: input_select.select_option
        target:
          entity_id: input_select.scene
          data:
            option: "{{trigger.id}}"

The issue with this is the automation becomes unavailable with the message:

Actions: extra keys not allowed @ data[0][‘target’][‘data’]

Thanks for the help!

Your indentation is not correct. Should be:

    action:
      - service: input_select.select_option
        target:
          entity_id: input_select.scene
        data:
          option: "{{trigger.id}}"
1 Like

Its been staring me in the face all along.
sighs I am starting to hate YAML with a passion.

Thank you!

Note to future self: can’t solve something? its likely wrong indentation.