TTS on Sonos: Event when announcement is complete?

Hi, i want to set up a TTS announcement service on my sonos devices. This service should do the following:

  • Save the current state in a sonos snapshot
  • Play the TTS file
  • Restore the snapshot so that all devices continue their playback

The problem is: The TTS file can be of variable length, so, i do not know when to call the sonos restore service. If i call it too early, the announcement is cut off in the middle, if i call it too late, there is unneeded silence after the announcement.

Is there a way to get an event after the sonos players stop playing the TTS voice file?

Use a wait for trigger or wait template to wait until the media player returns to idle after playing the announcement, then do your restore.