Yes, so my theory is correct. The event is firing exactly the same time (or slightly before) the wait_template starts. This is because the service is not complete. So we need the 2 services (snapshot and wait_template) to run parallel to eachother. The only way to do this is to separate them. It seems that scripts now block movement forward where we want it to be non-blocking. The only way to do this is to fire it from another automation.
so, in ascii art:
In your automation:
|--- snapshot service ---> |
|--- wait_template 60 seconds ---> |
^
|
event happens here
In the separated automation:
|--- snapshot service ---> |
|--- wait_template 60 seconds ---> |
^
|
event happens here
Notice how the event is inside the duration of the wait_template, where as your’s its outside.
The difference is that the first one calls take_snapshot and waits for it to finish whereas the second one doesn’t wait and immediately returns to execute wait_for_trigger.
Nor did I until pnbrucker started developing the scripting changes that were implemented in 0.113. Apparently, while modifying the scripting code, he discovered that the difference has existed for awhile. It was properly documented when 0.113 was released.
I recall when I learned of it that I immediately reviewed how I called scripts in my system. I always leaned towards using the more compact service: script.whatever (i.e the version that waits for script completion). Fortunately, everywhere that I used it, my expectation was that it should behave like a function call (i.e. inline execution). So, purely by chance, I was using the correct one of the two ways to call a script (for my purposes).
EDIT
BTW, this thread has made me revisit the one automation I have where I used wait_for_trigger. I haven’t had the opportunity to exercise the automation yet but I suspect it will fail for the same reason the OP’s automation did: by the time wait_for_trigger begins listening for the event, the event has already occurred.