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

I'll assume you missed the second question.
In other words, are you doing this through remote desktop or VNC or are you using Putty?

@ogiewon So I got a different version of assitant-relay working on Hass.io as an add-on.
My main reason for wanting to get this up was to hopefully start white noise playing on our bedroom Google Home devices.
I've tried sending the command play white noise on with no luck.
Sending commands for presets and things like set living room lights to 20% work but not playing ambient sounds or music.
Have you or anyone else had luck with this?

Thanks!

How about using CastWeb API for that instead on Google Assistant Relay?

Keith, I am not currently using Google Assistant Relay for anything in my home. It was fun to get it running on Hubitat, and shared with the community. I don't think it'll do what you're requesting, though. (But, I am not sure! :wink: )

1 Like

Hmm I’m trying to use hass.io for anything other than zigbee/z-wave.
I tried to cast a white noise file to my kids google minis and over the course of an hour or so playback began to become corrupt.
Sometimes it would crash instead of make demonic noises that terrified my toddlers.

I’ve troubleshot the heck out of my network and the google minis. I think it’s their playback api that can’t handle long files. Maybe I’ll try it again when they’re not sleeping.

Thanks I’m thinking it was all for not as well. Cool new web ui though.

Maybe a dedicated white noise generator? I used one with both my kids. We would take it with us when we traveled too. The ocean sound was their favorite.

Today, I would just use an app. Before I had any kind of treatment for my tinnitus, I used to use rain sounds on my phone for a break from the ringing.

We used to have mechanical ones but they mechanically failed. I just hate plugging another thing in.

Thinking about making raspberry pi zero running Almond and hey Ada. I wonder if I could get Chromecast running on it too.

1 Like

@ogiewon - Is the version 2 install still valid since running " sudo apt-get install -y nodejs installs v10? What do I need to do to install version 8? Thanks.

The reason this won't work is because playing ambient noises is not supported with a device target. For example, there is no way to type into your phone's assistant "play white noise on [your speaker]" and have it work. The only way ambient noises works is if you give the command to the target speaker.

When you pass the command to Assistant Relay it may have a URL or the white noise in the JSON response that you can use to pass to another speaker but I doubt it. (Please check with just "Play white noise". I've never set this up or I would do it myself. You probably have to turn on some debugging to get the JSON responses out. They may not come back to Hubitat either. They might just be somewhere in Assistant Relay on the node server's logs.) I just don't think Google allows you to do this for some reason.

1 Like

I believe v3 can use NodeJS v10. Perhaps you would like to start with the current version of Assistant Relay instead of v2? I have not used v3 yet, but it sounds like some nice improvements. I believe my v2 Driver will still work with v3 of Assistant-Relay.


If not, here you go...

In order to install NodeJS v8 on Raspian Buster, you can try the following instructions. Not sure if these are 100% correct.

Note: This is designed for a true clean install of Raspian Buster, one that has never had NodeJS or NPM installed. If you have NodeJS installed, please run this command
sudo apt-get purge --auto-remove nodejs
before starting the process below.

How to install Node 8.x on Raspian Buster (from https://github.com/nodesource/distributions/issues/866#issuecomment-507759378)

-Open preference

sudo nano /etc/apt/preferences.d/nodesource 

-Paste this configuration, then save and exit nano

Package: *
Pin: origin deb.nodesource.com
Pin-Priority: 600

-Configure Node 8 source

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -

-Verify the change:

apt-cache policy nodejs

-Install Node 8 with NPM

sudo apt-get install -y nodejs

-Verify Node version

node -v

-Verify NPM version

npm -v

-Install PM2

sudo npm install pm2 -g install

pm2 startup

-then copy and run the following command as shown on the screen from previous command

sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u pi --hp /home/pi

Thank you @ogiewon. Much appreciated...

since few days ago I am receiving this message and the google relay just stop working. Is it something related to update the NPM ?

I am using the raspberry exclusively for the google relay and not touching it at all so I could not be causing the memory issue.. it worked well for few months until now..

The "no space left on device" is your problem.

But what could be consuming the space? My PI is only used for the google relay and working well for months and suddenly this message appeared. Not even touching if for anything different than starting the google relay.

No idea. Open up a terminal and run this to see amount of free disk space on each mount point:

df -h

Just a wild guess would be the logs directory. I'd check it with:

sudo du -h /var/log/

this is what both commands return. Any idea?

/dev/root is 100% used. No idea where. Change to the root directory and check disk usage for one level:

cd /
sudo du -h --max-depth=1

That should give you at least the top level folder to start looking into.

I was trying to do the same thing with white noise, and if you look at post 380, you can see how I did it. It has been working really well over the last month or so. I either use voice or pico to initiate it.
Hope that helps.

Thank you. I saw that post. I do the same. Quite a long time ago I reverse engineered the URLs that Google hosted its white noise and downloaded them all. I was just explaining to keithcroshaw why it didn't work.

In case anybody wants the Google sounds somebody else found them here as well:

There's also this stuff here:
https://developers.google.com/assistant/tools/sound-library