[Release] Google Home Assistant Relay Driver (v1 and v2)- text to speech on Google Home devices

You would have to use something like Cast-Web-API which exposes each GH device as a "castable" device. You can't broadcast to it but you can speak text to it to get an announcement. It uses the cast capability of the GH though, so any music you have playing will stop and not restart after the announcement. This applies only to announcements to single devices. Group broadcast is different.

The alternative in assistant-relay is to create other google accounts and link those only to some speakers. Then when you issue the broadcast command under that user, the broadcast would only play on some speakers. But you would have to have another google account and set up another google console project and get another oauth file. Very cumbersome.

Guess I have some work to do LOL
Is there a troubleshooting guide for assistant relay?

Usually you just watch the console debug on the RPi to look for errors.

I'm not too familiar with RPi, but I have tried to run "npm run start" which I believe should start the service, but I get errors

I start mine with node /[directory]/assistant-relay-master/index.js

[directory] of course being whatever path you have in the RPi before the Assistant Relay directory.

I just had this same issue CJ, coudn't get Relay to actually spit out voice commands. I could use the rPi terminal to send a cURL post command and things would fire, but no love with the device.

I ended up moving to cast-web-api with a lot of help from Ryan780 in this threat:

Take a look, it is actually pretty easy to get things set up if you have already gone through the process of enabling the Google developer API and creating credentials.

Cheers!

There was a problem with Assistant Relay when you had IPv6 enabled on my router. For the longest time I couldn't figure out why Assistant Relay would start but I wouldn't get any sound from my speakers. Google implemented a check within the Assistant SDK to only broadcast to local devices. They didn't want someone accidentally broadcasting personal information on a Google Home speaker they had at work for example. So, the way they did this was through IP checking. If everyone is on the same subnet, then they are all local to each other. The problem is, my netgear router's schema for IPv6 address assignments didn't mesh well with Google's algorithm for checking if devices were local. So, as soon as i disabled IPv6 on my router...bingo...worked again. Google was supposed to fix this at some point in the SDK but I have no idea if it has and if so if it's been implemented in Relay yet. Here's a link to the thread on GitHub for the assistant SDK about it.

It was really dumb luck that I found this problem in the first place.

1 Like

@ogiewon Dan - Thanks for getting this to Hubitat - I have missed this from Smartthings it adds that additional flare to the home automation. Welcome home and those various other personalized pieces.

Great Job!

2 Likes

So I have the device driver setup and working - I can enter text and talk through google home on the DEVICE page.

But how do I incorporate it into Rule Manager as an action item? (I thought that would be the easy part) I may be missing something.

In your rule under "Actions for True" (or false)
Under the "Send or Speak a message" Choose your Device your setup
image

THEN:
image

1 Like

Brilliant - got it thanks!

1 Like

@ogiewon or @Ryan780 looks like Google added a feature to "broadcast" where it announces the "user" that sent the command so that it can be "replied" to. This is causing broadcasts from the relay to start with "tone/broadcast from user/actual message".

Is there any chance the driver could be modified to add the user variable to the suffix so that it announces "hubitat" as the user as opposed to the user default set up by the assistant relay? Or would one just have to change the assistant relay config file? I am still running V1 of the relay.

Thanks

I just ran a test and I do not have a user being announced before the text. Did you change anything recently? How can I reproduce this?

Nope, just started happening this afternoon, maybe it's a roll-out?

From the device page just type a notification and hit send, it announces with the new "broadcast from USER" that wasn't there before.

I had this happen to me this morning as well. It said "Broadcast from Smart Home, the washer is finished." But then a few minutes later it announced again (because of my wacky washer current readings) and the second time, it was NOT prepended by "Broadcast from Smart Home". Just did the normal announcement. Maybe an error the second time?

Anyway, just tried triggering it manually right now, and yes, it does the "Broadcast from Smart Home" bit before every announcement. Please let me know if you figure out how to turn it off.

Okay, so it appears my Google Home is also now prefixing “Broadcast from xxxxx” before each announcement... I wonder if Greg Hesp has a fix for this yet? The assistant-relay is his code, not mine...

If you type a Broadcast Command into the Google Assistant on your phone, it also adds the new prefix as well.

Yes, I believe this is a deliberate change to allow for responses to the broadcast, this was announced as coming soon a week or two ago in the google assistant community

I think he does, it's the v2 of this assistant relay, there's an option to mute the prefix message. So.... it may be "that time" as far as forcing a change to this driver.

2 Likes

:rat::rat:!

Well, the good thing is, this has not affected the ability to control devices with the [CC] prefix.

I don’t have that many announcements. Maybe it’s time I just moved them all to Alexa.

"Broadcast from Chris: The garage door is open"

Blah.

1 Like