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

That's the first step. Then you actually have to run the thing. Did you read the instructions on the page? I guarantee all your questions will be answered.

The 'broadcast from %username% completely ruines this for me

that together that if we have multiple devices the voice will not be fully sync between them, so one speaker will start and then after a second the others will so there is a terrible echo sound.. the only thing I like from it is that if I am playing music it will resume after the TTS

Yep, google need to sort their sh!t

The way around that is to use cast-web-api and create a speaker group in your GH system. You then cast the TTS to that speaker group and they are all synced. However, some speakers might have the first few syllables cut off as the speakers sync themselves up. No solution is perfect, everything has it's downsides. It just depends on what you are willing to live with.

I have both the google relay and cast-web-api and the problem with this second is that if I am playing music in Spotify and then comes a TTS the spotify music will not resume after the TTS. I am living with google-relay and the horrible echo created by devices not being synch when speaking

Just a note for anybody who got hung up on assistant-relay itself not working correctly:

There's apparently a bug on Google's end that stops one of one of its dependencies (google-assistant) from functioning properly. Broadcasting won't work on any network with IPv6 enabled. I wasn't actually hearing the output from any commands I sent the relay until I disabled IPv6 within my router. Now it works like a charm.

Spent a few hours on this, didn't see it here, and thought I might save someone some time.

1 Like

Hmmm... I do believe that tip is included in the very first post of this thread! :wink:

But it's a good reminder for everyone just getting started! Glad to hear you got it working!

Also interesting to see that they STILL haven't fixed that bug. I have to say, I reported that one on multiple forums, in multiple Assistant SDK github repos and to Google too. It's interesting that it still hasn't been fixed yet. It doesn't seem like it would be that hard to only use the IPv4 address to determine if the devices are in the same network.

Got a new one for you @ogiewon. I'll posted a pull-request in Github. It seems that this would be good to have in the AR driver as well. That way, if you get a request across the Maker API with [CC] in the message it will translate it correctly. In order to "urlerize" [CC] it would change it to %5BCC%5D.

1 Like

Thanks @Ryan780! I have merged your pull request.

1 Like

I have assistant relay V2 working on RPI, but I'm not having any luck with getting GH speakers play music. I can get [CC] and [CCC] to work for volume changes, etc.,
I specifically want to use a Pico remote to initiate a bedtime routine with white noise playing on Google home mini. What is the best way to do this?
Thanks

Assistant Relay can't do that. It's not supported by the Google Assistant SDK.

I figured that out. But I was wondering about any other way to do this.
Thanks

You can only do this by initiating the routine via voice to the speaker.

Thank you.
I was able to finally make this work with a different app through my NAS. If anyone is interested, pm me, and I'd be happy to provide the details.

What program is that? I'm curious how you were able to trigger routines from not on the GH speaker.

I am interested in this one if you can share details please

Me too. PM sent.

I was hesitant to post my non-professional solution here with all the amazing coders here, but here we go.
First, I did not initiate a routine to a specific google speaker. I merely got the same outcome with a work around.
I wanted to get my son's bedroom speaker to play white noise when I pressed my pico remote (+lights off, etc). I initially had this set with the goodnight routine that I could initiate with voice, but I could not do this remotely for the obvious limitations.
So I used rule machine for all the light automation with pico as trigger and downloaded an mp3 of the white noise I wanted.
I used Audacity to trim it and make the beginning and the end of the clip identical (so the repeat in loops would not be noticed), and copied it on a flash drive.
Then I used a NAS approach, and with my netgear router, I was able to just plug in my flash drive and set up local sharing (readyshare in my router). This gave me a local http link for my mp3 file.
Then on rule machine, I created a custom rule:

  1. Trigger: pico button push.
  2. Action: Used the google home mini as actuator
    a. Repeat every 1 hour (duration of my clip)
    b. Custom action: Play track with parameter type as string (the link to my mp3 file on NAS which was http://storage.routerlogin.net/shares/USB_Storage/etc/edits/Rain-small.mp3)
    c. Wait for events: mode becomes day
  3. End repeat

Now with the pico button push, the lights are off, nightlight is on and google home plays this white noise track until mode changes to day.
I know there is no elegance to this, but I was able to get the end result, and I can just initiate the routine without waking up my kiddo.

If you guys can have this done better, please let me know.
Z

3 Likes