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

From my notes:

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

#Paste this configuration block of 3 lines, 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

#remove the existing version of NodeJS
sudo apt-get purge --auto-remove nodejs

#Install Node 8 with NPM
sudo apt-get install -y nodejs

#Verify Node version
node -v
#mine showed v8.16.2

#Verify NPM version
npm -v
#mine showed 6.4.1

Hope this helps.

I have followed step by step:

1.- install node.js:

2.- when doing the 2nd step Install PM2 as a pre-requisite if not already installed `npm i pm2 -g
I am getting permissions error:

any idea how to allow write access?

you have to proceed every command in these instructions with "sudo". That includes the install of pm2 and the rest of the commands in the instructions.

ok I have done step 1 and 2 from the instructions and then downloaded the zip file from step 3 and extracted the files to the desktop:

but when doing the command sudo npm i I get this error (in red rectangle):

any idea?

I think the problem is you didn’t tell it what to install. sudo means you will run the command with temporary Root privileges. npm means you will install via npm. i means install. After that it doesn’t know what to install. If you’ve expanded the files at a particular directory and then cd to that directory, I think that can work, but I’m not clear if that’s what you have done there.

Is your install file at /home/pi ? Because that’s where you are right now. To see current directory, type pwd

I tried to copy the extracted files just to the home/pi/ folder and ran the command sudo npm i and looks like now it worked.

Now I am at the step to configure the OAuth2 JSON file. Remember that we have created a .json file when set up the relay version 2 ? Can I use that file or I have to create a new one?

I manage to make it work. after I click submit in this screen I can hear the sound "testing" in my google home speakers

Now, how to integrate it with Hubitat? is it by doingg a Json HTTP request? are below parameters correct? is just not working..

here the detail of the actions:

I have v1 and I believe it’s done the same way. The first post has info. It’s just a TTS message. Prepend with [CC] and google Assistant compatible devices will do what you type. Use [CCC] and it will do the thing you type, with a response.

If you add random to the end, you can randomize colors on lights when you press a button or a schedule.


I belive V3 works differently if not mistaken or for what I have read.
If I still can use the google-relay as a device then how to set it up? in V2 the Device type was as per my screen shot , then for V3 what should I select?

That’s the driver. If you can type something in the text box below speak, and it speaks the phrase when you click the button, then you should be able to select it as a notification device in a RM rule, per my example rule above.

That driver is for version v2. I tried using it along with my v3 set up and it does not speak in hubitat but if I go to a browser and type the ip in the dashboard I can make it speak with no problems. Have you used v3? Are you confident it can work in same way as v1 and v2?

Not at all. I thought you had version 2 loaded. Didn't notice v3 in the pic you posted before. Sorry, didn't know there was a version 3. Haven't been following this thread, since I have v1 loaded and it works fine. I have not found a compelling reason to upgrade. The title of the thread still says v1 and v2, so I assume @ogiewon 's driver doesn't support v3, but I cannot answer that.

I just upgraded because v2 stopped working for me due to some memory issues on my raspberry. When tried to reinstall it I found v3 available and I have completed installation for this one but just having some trouble to link / integrate it with Hubitat. let me continue trying. thanks

me too ...

v2 and v3 have the same JSON API and because of that it's been specified multiple times in this thread that the version 2 driver should work for version 3 of GAR (and it does). I'm using the latest GAR v3 with the v2 driver from this thread without any problems.

Double check your configuration even though your screenshots appear to match. Make sure the service is still running. Make sure you have port 3000 open on the machine that is running node so that HE is allowed to make a connection to it. From any device on your network you should be able to hit http://192.168.1.109:3000/ and chances are extremely high given that it's not working that they cannot.

2 Likes

Not sure if anyone is still into this, but I just installed Node.js v10+ on Pi3B+, then installed Google Assistant Relay 3.1.4, then installed @ogiewon V2 driver. and It works!

Some notes that were different from how installation was described above.

v10 of Node.js works with Google Assistant Relay v3+ So I just installed the latest version

DONT follow the earlier instructions on downloading source directly from github. FOLLOW the instructions on greghesp installation notes. all you have to do is download the current release, and install and run pm2 from the release folder

And for v3? Can it work with a virtual device? Or only by sending json http post?

I just installed it today, so that i could pass a command to a nestxyale lock that is proprietary.

virtual lock -> http post -> goggle assistant relay -> nest lock

I was looking to use v3 for TTS notifications. In v2 I managed to create a virtual device which is the google relay so I send my TTS to it but in v3 is possible?

I don’t see why not. But instead of virtual device I used generic device, and you have to have the v2 driver installed. Of course goes without saying to backup before you try it out in case it fails. That way you can revert to a working system