Text to speech as an announcement. Is this possible?

I am using OH 4.2 and thought I would try out the TTS options.

I have installed picotts binding and I have made it work and I can send text to voice to a google nest (chromecast binding) and it works BUT the annoying thing is I cannot find anywhere that I can make the voice as an announcement. I.E lower the music volume and play the announcement then continue playing the music.

If I ask google to play music and then send the text to speech it works but the music doesn’t continue.
Is there a way to do this or do I have to use some other text to speech binding?
I didn’t really want a cloud based option if possible.
I have searched and found things that say set announcement = true but tahts is about the extent of what I have found.
Has anyone done similar to what I am trying to do and got it to work? If so, how?
Thanks

This is what I was testing with and it send the voice OK:

actions.Voice.say("The gate is open", "picotts:enGB", "chromecast:chromecast:e660a1e177d0856616bbe9e2411fa9b3")

I got a google nest mini dedicated to do announcements and chimes. Its mic is turned off.

I have 4 nest mini but they all do internal broadcasts as wife is in her shed and I am in mine so we use it as an intercom and they stream music. The broadcast works as an announcement but I cannot get the announcements to work with openHab TTS.

So the problem is that it works, but it stops your music, right? AFAIK nobody’s managed to solve this problem and make the music resume.

Hence my solution of just adding a nest mini dedicated for TTS / notifications, in addition to the one you’re using for music playing. But this is a different scenario to “Hey google, broadcast message XXXX”

1 Like

Support of music resuming has to be implemented by bindings when doable.
As an example, it is possible with Sonos devices.

Correct.

Maybe I will have to use the google text to speech. You would think that would work? I didn’t want to go down that path but maybe have to but I wanted to know if anyone else managed to get it to work.

I don’t have sonos. :frowning_face:

How was it done?

Yup… so use a dedicated nest mini. Wait for a cheap sale, I got mine for $19 I think.

In the beginning (3+ years ago) I used google TTS, but I’ve given up since about 1-2 years ago because I couldn’t get my authentication to work. I am now using Alexa TTS instead. Still cloud based, but far more reliable. Instead of using Voice.say, just send a command to the TTS item with the string to say. It also supports SSML so you can make it talk slowly, faster, lower/higher pitch, etc.

So I use Alexa for TTS, Google nest for playing sounds (mp3). Yup, I have one of each for each location :smiley:

If you’ve found a nice offline TTS, let me know. I have tried a few, but it has been quite some time (6 months+) since I last looked. What I found quite decent was coquitts but it still had some rough edges. In any case they mostly work in a similar fashion:

  • When you made a GET request with your text, e.g. http://your.server.ip/blah/blah/text="Please say this" and you’d get the raw mp3 sound in return.
  • This is PERFECT because basically you just send this URL to google chromecast telling it to play that url… voila, TTS!

Stop the source then play notification and finally resume the source.

There is a stop on the chromecast binding but no resume, so how can it be done?

I tried pausing the chromecast and then playing again after the text to speech played but that didn’t work either.

Yeah, that’s why it doesn’t work with Chromecast–a resume command doesn’t exist.

Here’s a possible workaround that I don’t put much faith in:

  1. Add an unbound switch item and expose it to Google Assistant as a light
  2. Add a command to turn the switch OFF whenever an announcement is made, then turn the switch ON
  3. Set up a routine in Google Home to resume playing when the switch turns ON

I believe it has to be a light in Google, because they restrict what devices can trigger routines. However, that may have changed, because they’re always changing things. That’s also why I don’t have much faith in this solution–there are reasonable odds that it will break it in the future.

I’m also not sure if there’s a voice command that will have Google resume whatever it was last playing before it was interrupted, or if it has to be a specific service (e.g. “Resume Spotify”). I suppose you could add a switch+routine for every music service you use, and then detect which one is playing before the announcement is sent.

EDIT: I just had a look at GA routines, and it seems that I can’t even use lights as triggers any more. I do, however, see that routines can be started when specific Nest/Cast devices change to specific volumes. So instead of using unbound items, you could just trigger a routine off of that.

Hi,
You can try this:

It’s a little complicated because it involves spinning up a Home Assistant instance, but if you follow it step by step it should work.
Regards.

you know I do recall people setting up somewhat elaborate rules trying to get this exact thing to work. I recall the length of the announcement being a problem because you don’t know how long it will take so timing the resuming of the music was tricky.
Seems like such a simple thing, should be easy but not

I think it is all too hard and maybe just do like @JimT said. Buy a dedicated device.

Thanks also @jjmeseguer I could do all of that but is it worth it? I haven’t had any voice stuff for the past 13 years so I guess I can live without it.

I was hoping it would be easier. The saying of the text worked and was easy but the resume is the show stopper.

Thanks again to everyone.