Get data from wait_for_trigger

I want to get the data from my wait_for_trigger trigger but instead, it seems to get the data from the initial trigger that starts the automation because the last option returns Blabla {''platform'': None}'. And in the trace I see the error:

Error: In ‘template’ condition: UndefinedError: ‘dict object’ has no attribute ‘event’

This is my automation:

alias: Test
description: ""
trigger:
  - platform: tag
    tag_id: a32206c5-bdfa-4c42-aa72-aa4a0b4f68e9
    enabled: false
condition: []
action:
  - action: input_number.set_value
    data_template:
      entity_id: input_number.spulmaschine_timer
      value: "180"
  - action: notify.smartphones
    metadata: {}
    data:
      title: 💦 Spülmaschine Timer💦
      message: Timer einstellen
      data:
        actions:
          - action: 30_min
            title: 30 Min
          - action: 60_min
            title: 60 Min
          - action: 90_min
            title: 90 Min
  - wait_for_trigger:
      - platform: event
        event_type: mobile_app_notification_action
    continue_on_timeout: false
  - action: notify.smartphones
    metadata: {}
    data:
      title: |
        Test
      message: Blabla {{ trigger }}
  - choose:
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.action == '30_min' }}"
        sequence:
          - action: input_number.set_value
            data:
              entity_id: input_number.spulmaschine_timer
              value: 30
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.action == '60_min' }}"
        sequence:
          - action: input_number.set_value
            data:
              entity_id: input_number.spulmaschine_timer
              value: 60
      - conditions:
          - condition: template
            value_template: "{{ trigger.event.data.action == '90_min' }}"
        sequence:
          - action: input_number.set_value
            data:
              entity_id: input_number.spulmaschine_timer
              value: 90

If you want data from the wait variable you need to start with wait.

value_template: "{{ wait.trigger.event.data.action == '30_min' }}"

Be aware that your wait trigger will fire with any mobile app notification action because its configuration is very general. If you start using actionable notification regularly you may find this causes your automations to become unreliable. That is why the example in the docs includes the use of context.id and multiple triggers in the Wait action.

1 Like

Haven’t found it in any example of the community and also not ChatGPT… yeah I forgot about official docs as always

I have to say this is oddly hilarious!!!