Wait_for_trigger: Trigger ID field available but not functional - Bug or UI issue?

Title: wait_for_trigger: Trigger ID field available but not functional - Bug or UI issue?

Description:

I discovered an issue with wait_for_trigger in automations where the id field is available in the UI and YAML configuration, but the trigger IDs are not actually accessible/functional when the wait trigger fires.

Steps to reproduce:

  1. Create an automation with a wait_for_trigger block
  2. Add multiple triggers with different id values:
wait_for_trigger:
  - trigger: state
    entity_id: input_select.rollo_stand
    from: Geschlossen
    to: Offen
    id: zu-offen
  - trigger: state
    entity_id: input_select.rollo_stand
    from: Geschlossen
    to: Sonnenschutz
    id: zu-sonnenschutz
  1. Try to use the trigger ID in subsequent actions (e.g., {{ wait.trigger.id }})

Expected behavior:

Since the id field is available in the UI and accepts values in YAML, I expected to be able to:

  • Access the trigger ID that fired via wait.trigger.id
  • Use different IDs to determine which trigger condition was met

Actual behavior:

The trigger IDs set in wait_for_trigger are not accessible or functional. The id field appears to have no effect, unlike the id field in regular automation triggers where it works as expected.

Question:

Is this a bug, or is the id field intentionally non-functional in wait_for_trigger? If it’s intentionally not supported, should the UI field be removed to avoid confusion?

Environment:

  • Home Assistant Version: 2025.10.1
  • Installation type: Home Assistant OS

Thank you for clarifying!

1 Like

According to the documentation, yes wait_for_trigger should have a valid variable for {{wait.trigger.id}} as long as the wait did not time out.

1 Like

So it is a bug? Because the trigger id is not available in conditions after the wait trigger

Maybe. Share your actual config that shows how you discovered this “bug”.

Here the automation where I saw the problem

alias: Button Kinderzimmer Steuerung - Bug Example
description: Example showing non-functional trigger IDs in wait_for_trigger
triggers:
  - domain: mqtt
    device_id: cc1589c400498b3bb7b6643fddfbbcb1
    type: action
    subtype: double
    trigger: device
    id: Rollo-hoch
conditions: []
actions:
  - choose:
      - conditions:
          - condition: trigger
            id:
              - Rollo-hoch
          - condition: state
            entity_id: input_select.rollo_stand
            state: Geschlossen
        sequence:
          - parallel:
              - action: homeassistant.turn_off
                metadata: {}
                data: {}
                target:
                  entity_id: group.sleepmode_all
              - action: input_boolean.turn_off
                metadata: {}
                data: {}
                target:
                  entity_id: input_boolean.kinderzimmer_zahlen
          # This wait_for_trigger has trigger IDs that are NOT functional
          - wait_for_trigger:
              - trigger: state
                entity_id: input_select.rollo_stand
                from: Geschlossen
                to: Offen
                id: zu-offen
              - trigger: state
                entity_id: input_select.rollo_stand
                from: Geschlossen
                to: Sonnenschutz
                id: zu-sonnenschutz
              - trigger: state
                entity_id: input_select.rollo_stand
                from: Geschlossen
                to: Sonnenschutz Seite
                id: zu-sonnenschutz-seite
              - trigger: state
                entity_id: input_select.rollo_stand
                from: Geschlossen
                to: Sonnenschutz Vorne
                id: zu-sonnenschutz-vorne
            timeout:
              hours: 2
            continue_on_timeout: false
          # Trying to use the trigger IDs here DOES NOT WORK
          - choose:
              - conditions:
                  - condition: trigger
                    id: zu-offen
                sequence:
                  - action: cover.open_cover
                    metadata: {}
                    data: {}
                    target:
                      area_id: gastezimmer_1
              - conditions:
                  - condition: trigger
                    id: zu-sonnenschutz
                sequence:
                  - action: cover.set_cover_position
                    metadata: {}
                    data:
                      position: 25
                    target:
                      entity_id: cover.kind_rollo
              - conditions:
                  - condition: trigger
                    id: zu-sonnenschutz-seite
                sequence:
                  - action: cover.set_cover_position
                    metadata: {}
                    data:
                      position: 30
                    target:
                      entity_id: cover.kind_rollo
              - conditions:
                  - condition: trigger
                    id: zu-sonnenschutz-vorne
                sequence:
                  - action: cover.set_cover_position
                    metadata: {}
                    data:
                      position: 35
                    target:
                      entity_id: cover.kind_rollo
mode: restart

Depending on the trigger id I wanted to trigger different things after the wait_for_trigger

You can’t do this to test:

          - choose:
              - conditions:
                  - condition: trigger
                    id: zu-offen

That will check trigger.id not wait.trigger.id. i.e. you are checking the main automation triggers, not the wait triggers.

You need to use a template condition:

          - choose:
              - conditions:
                  - condition: template
                    value_template: "{{ wait.trigger.id ==  'zu-offen' }}"

Also this is a bad idea:

            timeout:
              hours: 2

You should not be waiting that long in an automation.

1 Like

Good to know it is possible, bad it is not available from the UI. But thanks for clarification.