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

Iā€™m not trying anything new. I have installed a few things in the past where the dev said to use -i instead of -g, so I thought it was the same. Apparently it isnā€™t.

Iā€™m good. All my stuff is installed and working fine.

That's my point. You have to use -g AND --unsafe-perm. Not just one or the other.

@ryan780 Now that I came back home first of all I formatted my SD card that just for in case whatever thing I had done before would not affect now so no garbage in my card.
First of all I tried to install the node as per you suggested following the GitHub steps from the link you provided. So the instructions in that link are:

So I copied that and past it in the terminal but at the end it says "Cannot write to '-' (broken pipe)." As per below screen shot

just to verify I put in the terminal the command "node -v" and it returned that I have v8.11.1 so was it installed from the instruction I given or was this pre-installed in my raspberry ??

Then I tried some other commands from the same link that you shared and looks like they are not working:

any idea?

Take off the second line. node - v is used to check your current version of node.

Do you know how to use Linux at all? You don't copy 2 lines and put them together like that.

But if you have 8.11 then you are fine. What operating system are you running? Raspbian? That's what it would have been installed with. It's on your SD card. Not on your pi.

Sorry about my mistakes but yes this is the very first time I use Linux, not familiar at all.

I bought a blank SD and yes I installed raspian on it.

So the 8.11 came pre-installed with the raspian? The only stuff I had done is what you see in my screen shots, nothing else

Will give more trys tomorrow. Thanks

Are below 2 links for the same purpose of getting google TTS but just different methods??

Cast web allows you to send TTS via broadcast (all your Google Home and Chromecast devices at once), or to individual Google Home devices. It also allows you to play music files.

Google Assistant Relay only allows TTS via broadcast, but has the advantage of being able to send TTS text to Google Assistant, and have it execute that text by prefixing it with [CC]. So for example, if I have a WiFi enabled dimmer switch that Google Assistant supports, but Hubitat does not. I can turn the device On/Off or set the dim level from a Rule Machine rule, by adding the action Speak with the message "[CC] set the dimmer to 50%" and it will do it as if the device was directly connected to Hubitat Elevation. There will be no outgoing sound, and there will be no return response. There's a second option that allows you to do the same thing, but get a response back. So if I had Speak "[CCC] set the dimmer to 50%" the same action would happen, but Google Assistant or a Google Home device would respond verbally, "OK, setting the dimmer to 50%"

2 Likes

Oh ok so the google assistant relay will work in a similar way of the -routines- that are found in the mobile google home app ?? for example in the routines I can set one that I would say to google only "hello" but it will actually capture if I had said "turn on dinning room light".

I assume that with Hubitat the trigger will not be my voice but instead it will be for example a motion sensor that has detected motion and the action to execute would be to speak a message and the message would be as "[CCC] turn on dinning room light" and it would be the same as if I had directly said to google with my voice "hello" (as in the routine that I set in the google) right??

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