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

Thanks Mark! I have made your changes to the version in my GitHub Repo and modified it slightly to handle the case where a username is not provided a little more elegantly. I also credited you with this change.

Thank you for the contribution!

1 Like

Just to follow-up, I setup a 2nd dummy account linked only to the home devices I want to broadcast to (I have too many "homes" per sq/ft so the broadcasts are difficult to understand on my main floor due to the timing variances) and it works as expected. Also, I left my original account setup for handling the [CC] and [CCC] commands since the relay has to be a member of the home in order to send those.

Thanks for the "credit" although I don't think it is deserved since all I did was use the Wiki for assistant relay and compared it to your code to add the extra entries.

1 Like

I don't know how you manage to support all the great apps that you have shared @ogiewon...but I can tell you that your time and effort are TRULY appreciated. I just got this setup last night following your step by step Word document (this Linux newbie would not have gotten through it otherwise). I think I have so many drivers and apps in the ogiewon namespace that a rename of my hub is in order.

How's OGhub
or HubiWon

@SmartHomePrimer, I'm with you...I think I'll use this primarily as a way to execute silent commands to device the hub does not support. The added broadcast message is too much for TTS...I'll keep my echo's in place for that (using guess what...AlexaWon TTS).

The moment either Alexa or GH allow custom wake commands...mine is going to be named Dan :wink:. That way I know it'll get done.

4 Likes

So I am trying to get this going and it appears to be an issue with installing the required google-assistant npm. When I try to install relay v2 on my ras pi I get the following error

BlockquoteTried to download(403): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.0/node-v67-linux-arm-glibc.tar.gz

what version of node do you have installed?

Hey @ogiewon. You'll see a pull request in GitHub for your driver. I was playing around with getting the last 4 WebCoRE pistons out of HE and moved back over to ST and I ran into a bit of trouble. I was trying to use the maker API to issue commands to my AR device for a broadcast and was getting. "Driveway percent twenty alerts percent twenty now.....". When the device was interpreting the string from the maker api it was taking it literally. So, "%20" that replaced the spaces was spoken as "percent twenty". All I did was add a bunch of replaceAll's to swap them back to spaces before the string is passed to AR. I tested with my cast-web device but the same should apply here. Also, there are probably a couple extra (at least one) that isn't necessary but I figured, better safe than sorry. Let me know if you think I've got it right. This was the first time I tried to use that particular command (yes I know, I'm barely a youngling when it comes to coding). I'm dying to hear what you think. Thanks!!! :smiley:

I updated both the original and v2 Drivers with your change. Please give it a try and let know if it works. In my limited testing, it seems to work fine.

Thank you for your contribution!

It's the least I could do. I might not be able to create something of my own from scratch but I've learned enough to help make things better. That's better than nothing, right? :wink:

2 Likes

I just wanted to take this opportunity to shout out "THANK YOU" very much for your clear and precise instructions on how to install this.
I'm just a novice RPI guy, but I can follow instructions.
I made 3 attempts to do this on the ST side, and was unsuccessful each time.
I followed your Word document, and it was a snap - no problem.
(My only deviation was that instead of using the nano built in editor, since I had WinSCP open anyway, it has a simple text editor that I used.)
Great - Thanks again!

1 Like

I got time to set this up today wow thank you!!!

I have one simple question is there anyway to issue multiple commands at once? IE using the rule machine it only lets me send one command per rule. Was hoping there was some syntax for multiple? If not I can work around it

1 Like

Currently there is no way to send multiple commands using the driver as-is. You could modify the driver for your needs.

Thank no worries. I may do that for now I just setup dummy routines in GA and I can just call that one routine to trigger all the googly stuff I need. Thanks again for this!

1 Like

Does anyone know if there's a way to get the json responses back out of a command? It'd be neat in some instances to be able to send a command to poll a devices status.

It could be useful to be able to send a command like "Is the accent light on" and perform an action (like set a variable) based on the text response.

Why would you have to do that with Assistant Relay? You an do that with Rule Machine now.

Well it could give me options to poll devices that only connect through Google assistant like wifi plugs and it would allow me poll the status of my shield tv.

Over the past few days, I have been unsuccessfully attempting to get assistant-relay working on my new Raspberry PI 3 B+. Although I am a retired computer programmer/network administrator, I am new to the PI/Raspbian world. I have tried ogiewon's, greg hesp's and ryan casler's well-written instructions (several times!), but when I get to the end, I consistently receive a "cannot find module 'google-assistant'" message.

I am hoping one of the experts in the community will be able to say the "magic words": "You need to . . . " that will solve the problem and have me smacking my forehead.

I can provide the error log and the screen shot, if those would be helpful.

Thanks!

Not really sure what to tell you. My instructions are as detailed as I could make them. They’ve been successfully used by many users. All I can suggest is to start over with a clean install of Raspian, and follow each and every step one more time.

I am not really a RPi expert. I wrote those instructions for myself to allow me to retrace my steps in the event I someday needed to reinstall the assistant-relay.

Thank you for your suggestion. I now have my side working, but continue to throw 100% errors on the Google side, as shown on the Google Cloud console. Right now, I'm wrestling with how to figure out how/where to read what those errors are. I'll keep digging until I get it. I figure I missed a setting somewhere.

At any rate, I wanted to express my appreciation for your help.

1 Like

You will always see 100% error in the Google Console but I am still able to get announcements. Do you have the devices you are trying to broadcast to on the same network? Did you use the same google account on both Relay and the GH devices? Do you have IP v6 disabled on your router? These have all been issues getting broadcasts to work in the past.

1 Like

Ryan780, I have been hoping that the solution would be something like you suggested, but I double-checked the following:

  1. My Google Home Mini and the Raspberry PI are on the same network.

  2. I used the same Google account on both the Relay and the Google Home Mini.

  3. IP v6 is enabled on my router.

Once more, I tested a rule in Hubitat that would send a spoken message to the Google Home Mini when the front door was opened. In the Raspberry PI terminal, I get the message:

Received command broadcast The Front Door has been opened.

No user specified, using tfjackson

Conversation Complete

In the Google Cloud Console, after a few minutes, the Google Assistant API request count increases by 1 (and the error % remains at 100, like you indicated).

Still no message from the Google Home Mini.

FYI, I am using v2 of the Google Home Assistant Relay, along with v2 of the Assistant-Relay on the Raspberry PI.

I'm guessing that when I find out what is causing the issue, I'm going to feel like an idiot, but at least it will be fixed and maybe it will be helpful to someone else.

Thank you for your insights.