Trying to get TTS to speak to work on a Google Home mini

Exactly, but [CCC] will give you a verbal response from it. [CC] will just do the action, no response. I believe there's more of a restriction with routines than this way. It's essentially anything you would say to the machine, but it is written instead. Not everything works, such as setting the volume on a specific device, but cast web can do that or could do that. I'm not able to get it to do that lately. I'm therefor also still running the Chromecast Integration (beta), since it has no problem with that task.

My hub is running fine, no lockups or slowdowns since 2.1.1.122. These are three very valuable tools working together, without issue, significantly increasing the number of devices my hub can control, even if it is dependent on google's cloud and internet access.

1 Like

Here's a typical example. This controls my August Smart Lock with their bridge.

1 Like

which task you mean ?? to set the volume of a specific device ?? I though that the Chromecast integration (beta) is only to speak texts, is not it ??

I am reading the original post for the google relay and I noticed that they mentioned the google voice when speaking will be always prefixed with the "broadcast from %username%" is this happening to you ?? (I had the cast-web-api in an android phone and when google speaks with this app this words as prefix will not be spoken)

Yes setting volume. In Rule Machine, you can do custom actions or custom commands. When you select actuator on the Chromecast Integration, you'll see attributes for set volume, stop, play, etc.

Prefixing is a thing now unfortunately. It wasn't always that way, but yes it will say "Broadcast [username]". I believe you can change the config.json file to be empty and it then just says, "Broadcast", and there's a slight pause. Cast web just says "Broadcast" when you choose the parent device for the message. If you choose the individual devices, there is nothing. You can apparently group them together, or something to that effect, and the result is a group broadcast, without the "Broadcast" prefix.

great, I did not see that before as I was always using only the option to speak a message, thanks a lot!!

yes I was using the cast-web-api and I do not remember ever hearing the "broadcast" when google was speaking, So I guess if I can quickly summarize pros and cons would be as next:

Google relay :
Pro: can trigger google to do actions based on a text as if I were speaking to google
con: when google is speaking it will always say "broadcast" as a prefix

cast-web-api :
Pro: can do TTS notifications without saying the words "broadcast"
con: cannot trigger google to do something based on a text as if I were speaking to google

Chromecast Integration (beta)
con : it will sometimes not speak the text messages as is in Beta phase

You agree with above??

Other question is can all of the 3 work together at the same time? I guess you mention that yes in your previous post but then if I want to do TTS a message how will rule machine know if it has to be through the cast-web-api or through the Chromecast Integration (beta) in case I have both installed and running ???

I don't use it much for that. I like Alexa's voice, so I do TTS differently using Google Assistant Relay and Samsung's cloud. However, of the times I've tried, it worked. YMMV on running the three together, but I'm not have a problem doing it. However, I don't ask much of the Chromecast Integration. It plays a door chime and tells cast web to shut up. So maybe when you don't do much with it, it doesn't cause problems? :man_shrugging:

well I am doing only 1 rule for testing purposes which is that when I open a contact sensor then google should notify me with voice that the contact sensor was open. I found that will work 80% of the times but still looking for a 100% working solution that is why I was looking to the cast-web-api as an option originally but just found the google relay so now trying to see what is best for me.

Google Assistant Relay is for sure an excellent tool for controlling devices not supported by HE. Cast web API is a great tool for TTS, I'm using it to announce Time of Use rates before we start the dryer, and not finding that it skips a beat. I like that it takes the load off the hub. I grew tired of the "Broadcast" announcement, so this was a good solution. The original plan was to remove the Chromecast Integration (beta), but I need to be able to stop the cast quickly and it does that well. I also have a very long door chime, that usually gets cut short when we open the door using the stop() attribute. However, cast web was always cutting the mp3 short, so I'm still using the Chromecast Integration (beta) to play the door chime.

On my Alexa devices in the rest of the house, I use the Assistant relay as the trigger for SmartThings. That turns on a virtual switch, which behaves like a virtual motion sensor. The Alexa routines think it's a physical motion sensor that has triggered and you can the use the custom speech option in Alexa routines to make it say whatever you want when a specified motion sensor is triggered.

Here's what the attributes look like. You choose the google device name. In my case it's the Google Nest Hub (The hub formerly know as Google Home).

yeap I have tried with this and works but I will continue doing some tests.

Other problem I have found is that if I am listening to music in my google devices with spotify then after a TTS comes the music will not resume. Can any of those 3 options resume the music after a TTS notification ??

Other question is, I just found in the the web-cast-api an "extension" if I add to the link the words in my below red rectangle.

image

is this the same as the google relay ??

It accesses the same api, but works differently. The [CC] and [CCC] prefixes were added as part of the driver that @ogiewon wrote for the Assistant Relay port to hubitat. They take advantage of two aspects of the api. The cast web api is not designed with that in mind. It is good at casting to specific devices and I prefer the Google Assistant voice. I can't get that if I use Chromecast Integration for TTS.

The issue with music and announcements is foreign to me. Sorry. I prefer Alexa. I'm using the google mini because I have it, and it was free. I have two actually, but I'm not using one of them now that I have the Google Nest Hub. The Google TTS vis Cast web is also capable using variables such as %date% and %device%, but doing it in the official Google Assistant female voice. I cannot do that with my method of Alexa TTS. But when it comes to music, I prefer Amazon Music over Spotify and we had Alexa devices first, so the family is more comfortable with it day to day. It also does control my devices much better in general. And nobody around here likes saying "Hey Google", that's for sure.

So you use Alexa for music and google for TTS. Probably I have to do the same. I just want anything for TTS that would allow to resume music after voice notifications. I will try tomorrow the installations we discussed today. Thanks for your advises :slight_smile:

1 Like

To be clear the Google Home devices I do not use for listening to music, but I do use both for TTS. Alexa is my primary device for TTS, and it resumes the music after an announcement, or rather it never pauses it. Alexa just lowers the music volume to play the announcement and then raises it again when the announcement is over.

I have an Echo in the bathroom and listen to podcasts when Iā€™m showering and getting ready for the day. It would drive me nuts if I had to keep telling it to resume every time someone opened a door, or the washer or dryer had finished, etc

1 Like

I have 3 google home minis and 1 google home so I do not know what would I do with them if I had to switch to Alexa. I guess there should be a way to resume music automatically after TTS so I guess I would have to do some research on this. Is it possible when you have some time to try put any music in google home device and see if it resumes after a TTS notification?

Iā€™ve heard thatā€™s an issue and it doesnā€™t resume. But with custom actions, I would think you could just add your TTS message to the rule, then a delay for the length of the TTS message, then a play command.

I think thereā€™s a few apps written by community members that do just that. However, if you use the official Google TTS Voice with the Cast-Web API, I would guess you need to use the rule machine method I just suggested. Itā€™s all academic until you try, unless someone here can confirm one way or another what works and what doesnā€™t. Fairly certain thereā€™s already lots of threads that discussed this very subject.

Ok I will give a try since I do not want to spend more money buying Alexas when I already have google homes. Thanks

have you every tried to play music triggered by RM ?? I have put the option to play track but there is option to select the service provider (spotify, goole music etc) so it did not work. In below screen shot I show what I did and I was trying just to play "beautiful day" from U2

To use it in that way, the parameter would be the type ā€œstringā€ and the value would be either the local directory path to your music file, or a path on the internet.

What Iā€™m suggesting is, you try starting music by voice command to your Google Home, then send a TTS message via Cast Web API or whatever youā€™re deciding to use. Then if the music stops, send the play command right after, again the parameter is string, but the value is empty - i.e. play()

If that works, put that together in one rule after your TTS message. However, I believe the rule will execute everything at once, so you may need a delay after the TTS message to give Google Assistant enough time to deliver the message before the play command is sent.

I tried but did not work. Music was playing then after the TTS it did not resume. This is what I used:

thanks anyways for giving suggestions on possible options, is appreciated

1 Like

Bummer