`wait_for_trigger` not working

I’m using the HASS-S3 component to upload files to S3, generate pre-signed URLs, and then want to use the URL. The wait_for_trigger step always times out. I’ve tried adding delays between steps. What am I missing?

When I make a new automation that is triggered by the s3_signed_url event, it works, however, I need a way to get some context data from the other automation? Is there a way to do this?

Anyone have any thoughts on this on either why this isn’t working (docs seem to suggest it should - is it an issue with the S3 component?) or any workarounds for passing context to another automation?

      - service: camera.snapshot
        target:
          entity_id: camera.backyard
        data:
          filename: /tmp/backyard-person.jpeg

      - service: s3.put
        data:
          bucket: my-bucket
          file_path: /tmp/backyard-person.jpeg
          key: img.jpeg
          
      - service: s3.signurl
        data:
          bucket: my-bucket
          key: img.jpeg
          duration: 600

	  - wait_for_trigger:
          - platform: event
            event_type: s3_signed_url
        continue_on_timeout: false
        timeout:
          hours: 0
          minutes: 0
          seconds: 30
          milliseconds: 0
     
	  - service: notify.mobile_app_johns_iphone
        data:
          message: {{ trigger.payload_json["after"]["label"] }}
          data:
            image: "{{ wait.trigger.event.data.URL }}"
            content-type: "image/jpeg"

Hi John Ritsema,

Has it timed out even though you know for certain one of those events have happened in the time frame, or are the events not happening?

If the event fires before the wait action runs it won’t receive the event.

I’d put in some log message with precise timestamps to see when the event actually happens.

1 Like

Yes. Like i said, if i listen for this event in another automation, it works.

That’s what I’m wondering. Is there some sort of race condition, where if the event is fired within milliseconds, before the next wait_for_trigger, it never receives it? I mean, it’s the next line of the automation script, so i would think it would be able to subscribe/receive in time. seems odd.

the code that fires the event is here. i would guess that HASS’ bus is robust enough to handle this. but i don’t yet know enough about the hass internals.