Hi, after some debugging it is clear the delay in casting a notification is caused by the call to pychromecast.get_chromecasts(). I forked your repo and added a commit which now has an MP3 cache, as well as it gets all chromecasts on the network once at startup rather than for every request.
These changes reduce the notification time from 8-10 seconds to around 3 seconds, which is good enough for me. Thanks a lot for this script, if you add me as a collaborator to your original repo I can create a pull request there. Until then, anyone interested can download the updated code from my forked repo:
Thank you for this,
I also did modified the original code to use local mp3ās. Although,I didnāt see any improvement on the time either. Making the google homes ip addresses static was the key for me.
I also added the possibility to choose which speaker you want to get the notification to within the url.
Yes. You can use the speak text function. Just give it a sentence and itāll throw it up to Amazon Polly, convert the text to speech, then speak it via chromecast.
Iām using thisā¦doesnāt use TTS so if using GH for music streaming it will pause and resume music after the announcement, unlike TTS approach that doesnāt resume music. Announces on all GHs on the network.
This is excellent. Response time is still 2-3 seconds, but definitely a perk not pausing the music (which would be a big problem for me).
I noticed the broadcast API canāt broadcast to specific cast receivers. I think this can be worked around by setting the cast receiver volume to 0 depending which ones you want to mute at what time of the day (ex mute the bedroom during sleeping hours).
And here is a SmartApp to work along side the Google Assistant Relay v2 to broadcast notifications to your Google Home when a SmartThings device is triggered.
If you need to make use of a device handler you can install this one for use with 3rd party tools like WebCoRE.