I am using TTS (Google Translate) on Sonos in several automations, e.g. to say “washing machine is finished”. As the Sonos could actually be playing music, I would like to
Turn the music down (this already happens automatically)
Adjust the volume to a standard value for TTS
Do the TTS announcement
Turn the volume back to what it was before
Resume the music
Further, as I do not want to repeat this in all automations, I would love to have some sort of reusable thing that I can parameterize with the actual text to announce and the devices it should say the text on.
as this sounds like a common feature to me, I wonder whether somebody has a good solution for this.
Take a look at the announce option. It’s documented in Sonos documentation.
I use an input text to feed announcements for speakers. In other words, the automation triggers off the input text, gets the values and announces it on the speaker. You could also use events which may be a cleaner option.
This announces it twice. It clears the text at the end. I think I was having problems with it announcing old messages on restarts.