So, I have a set of sonos speakers and I really just want to be able to make them say things using the tts.google_say functionality. Similar to the example found here:
service: tts.google_say
entity_id: media_player.sonos_speaker
data:
message: 'May the Force be with you.'
However, when I try to fire an event like this to my speaker:
it appears as though the tts function works, an mp3 file gets created in the tts folder with a long hash-code filename.
I have the Sonos application open when I do that and I can see the speaker’s playlist change to the long hash code string it sits like this for a few seconds trying to play, then it displays an “unable to play [filename.mp3], unable to connect to [my url]” message.
To my surprise, this works great! I can also use the /local/audio/stuff.mp3 link and it works. So, the question is now, why doesn’t the tts.google_say service call send the same kind of execution instruction as the media_player.play_media function? Clearly the Sonos speaker can play the tts stuff but it doesn’t do it natively. How can I get this to work more seamlessly?
Yes I have base url under HTTP in my configuration.yaml and haven’t had any issues. If you post your configuration.yaml I might be able to potentially see any difference.
I think I just figured it out! Unfortunately, I have not been able to find a way to look at the entire URL that is getting sent to the Sonos speaker when I fire off the say.google_tts event. The best I get is a short-lived popup message from the Sonos app about “unable to play” without a full URL, like this:
When I captured that screen shot I realized that it was trying to hit the server at port 8123! Probably because I’m using these things in configuration.yaml:
I didn’t have anything else under tts:. I added a new base_url: http://xxxx.duckdns.org without the port listing and that solved the problem of using say.google_tts!!
I haven’t seen that script yet, thanks for sharing it, it’s pretty awesome! Now, I need to template a bunch of stuff in my house with this. Any pointers or suggestions? I’ve recently added a bunch of door, window, moisture, motion sensors so I’m thinking I’ll probably template a bunch of those things to make the speaker tell me what’s going on.
Quick question, do you guys have any way to leave the playing queue undisturbed while making an announcement through the speakers? After running an event that causes an announcement through the speaker the playing queue has only that last announcement. I see from the Sonos component page that the snapshot/restore doesn’t handle the playing queue but is there any other way to do that?