Restart stream on Chromecast after sending voice to it

Most of the time my various Google / Nest Home devices are streaming music (GPM, YTM) or radio (TuneIn).
I started playing around with gtts and it’s really promising.

Currently I’m a bit stucked:
While streaming to a Google Home I want to use it as a audio sink to play some text. After that text I want to switch back to the stream. How can I achieve this? I did not find any “thing” which represents the previous stream it was playing.

Sonos (which I don’t own) seems to work better.

When sending a notification it stops the musicstream, plays the notification and continues the stream afterwards. The user McMacaber said it only works when stream music, not when stream radio via TuneIn.

1 Like

My understanding is that it is not possible to resume the original stream. I believe the TTS message is considered a new stream. I had to work around this by remembering the previous stream, estimate how long the TTS message will take, and then programmatically play the previous stream.

1 Like

That’s the workaround I was thinking of. How do you get the Info about the previous stream though?!

I programmatically play a stream. That’s the how I know which URL it was fed in the first place. Here’s the code that I use.

I start the streams via Google Assistant, not openHAB.
You start the streams via openHAB - is that right?

Yup. That’s the only way I can track the stream.

Does the Chromecast Add-on support broadcasts yet? Maybe that would be an approach :thinking:

I have the same problem. I think i’ll solve that for me a littlebit different. I have many Google Home devices which are notifying me about different events. I’ll use the “idling” channel, so that I can check if the chromecast device is idle, and if yes, it will play the sound on that device. If not, the rule will check if the next device is free and so on.

I know…it is not the best solution, but at least better then starting the stream everytime again and again after every notification.

1 Like

That’s my next approach/workaround.
Would you mind sharing your rule?

Sorry…it was just an idea for now. I haven’t even started to write that rule. I have some other issues which have to be fixed first. But I would love to see your work, if you have already started.

Hi

I can’t get the following to work if my Chromecast is playing a TuneIN station, becuase the URL is not TuneIN.

But this might be a starting point for further development

1 Like

I’ve found the feature request an github for it: https://github.com/openhab/openhab-addons/issues/2675

Any news on this? I’d also like to be able to resume my TuneIn streaming after sending notifications through a Chromecast speaker.

3 Likes