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

I took a stab at updating the relay driver to allow anyone who has upgraded to the relay V2 to add the /assistant directory to the POST function and the raw code is here

https://raw.githubusercontent.com/nrmoles/Hubitat/master/V2.X%20Driver

It's late so I can't test it without making my wife want to stab me, but it was pretty straight forward so I am hopeful

I got Google Home Relay Driver v1 working on a RPi3 with node.js version 9.9

2 Likes

Hey cool. Never heard back from you about that. Was wondering. Nice!

[Edit] Oops, sorry John. Wrong person. But I'm glad you got your's going as well! :smiley:

Holiday Craziness and All! The Relay is pretty cool man! I have a motion sensor near the Christmas tree(Yeah...it's up already...Wifey just hadddddd to have it up). Anyway...now when the cats are over there Google starts screaming.."THE CATS ARE IN THE FRICKEN TREE"!!

6 Likes

:rofl:

My Wife is gonna KILL me by the time I am done "Hubitatting" our Habitat. Haaaa!

2 Likes

I want to see the video about the cats in the tree :rofl::rofl:

I have installed node.js on a RPi and went through the assistant relay setup with "ryancasler/assistant-relay/wiki/Install-Instructions". I installed google home assistant driver and created a virtual device.
How do I tell the relay assistant which google device to announce through

You cannot select a specific device, as the assistant-relay uses the Broadcast capability to send to all google home devices on your account.

I must have missed something because I'm getting no announcement when I type hello into the Speak box in the device

When you run the assistant-relay on your RPi, does your Google Home device say “Assistant Relay Is Running” (or something similar to that) ?

If not, you’ve got work to do on your RPi before Hubitat can make it talk.

1 Like

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.