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

I have been trying to figure out how to do that within an app for a while now. There are plenty of examples out there of the hub sending a GET request and dealing with the response but so far i haven't been able to find out how to build an endpoint that will simple wait for an HTTP call to be received, except for the maker API. What I'm trying to figure out how to do is parse JSON information sent in an HTTP call. It's the last piston i have running on webCoRE cause I just can't seem to figure out how to do it in HE. So, if you get this working I'd be very interested to see how! :slight_smile:

I have managed to get the assistant relay node server to send the last response to hubitat and set a global variable. If anyone is interested in testing please let me know.

Moving beyond this there seems to be nway too many responses to be able to do a one size fits all solution. I am going to try and figure out what makes sense for me and my purposes to build a device that will display my camry information on a dashboard.

1 Like

Hello.
I just added a google home mini, and I'm having some difficulty in getting it to work.

  1. The test command for assistant relay seems to be working:
    curl -d '{"command":"hello world", "user":"ogiewon", "broadcast":"true"}' -H "Content-Type: application/json" -X POST http://192.168.1.139:3001/assistant
    (That command from the instructions, {with the correct customizations} works, and sends a "hello world" to my mini, and to my google home).
  2. However, I can't seem to send even a test message from Hubitat to the mini. Here is how my mini looks in HE:
  3. Shouldn't I be able to enter a text under speak, and it should come out? I have it defined as a "Chromecast Audio" device. Is that correct?

Did you go through the rest of the setup to download your oauth credentials? Did you set up the correct username in Assistant Relay? Your curl uses the username ogiewon and I don't think that is your username. :slight_smile:

As I said in my note I tested with the correct customizations. That is, my id, my ip address, my port, etc. I did go through the entire procedure in the written document from @ogiewon (which was great).

Okay, then you need to not use "ogiewon" as the username but use your username instead. And if you followed the document you would have loaded his assistant relay driver and that is the driver you should choose. NOT Chromecast Audio. So, I would go through the document again. You missed some steps.

Any other suggestions:

(I also tried "Office speaker" as the username for that device).

Is jtmpush18 the username on the .json file you downloaded to Assistant Relay? Is port 3001 the one you set up for Assistant Relay?

The IP address you had for AR in the first post (192.168.1.139) is different than the IP address you have entered here. It should be the IP of AR.

Again, I would go through the setup document again, all of these things are laid out in that doc.

Also, I don't know if the Network ID is correct. You might need to delete the device and start again with that part of the setup if the above doesn't fix the problem.

The username on the .json file is indeed jtmpush18.
The port is indeed 3001.
The ip address for my RPI is 192.168.1.54
(customizations).
Yes, this device is on the same Lan as my HE. IPv6 is disabled.

Okay...in your first post you must have listed the incorrect IP address then. Have you tried issuing a command to AR through Curl to see if you get a broadcast?

I'd be curious to see what you've built if you don't mind sharing. I might be able to adapt it for my purposes as well.

That was my first post, point #1:

  1. The test command for assistant relay seems to be working:
    curl -d '{"command":"hello world", "user":"ogiewon", "broadcast":"true"}' -H "Content-Type: application/json" -X POST http://192.168.1.139:3001/assistant
    (That command from the instructions, {with the correct customizations} works, and sends a "hello world" to my mini, and to my google home).

okay...but the command from the driver in HE does not? What command are you using to send the message to AR from the driver? Which version of AR did you install and which version of the driver did you install?

can you confirm that the curl command you used was:
curl -d '{"command":"hello world", "user":"jtmpush18", "broadcast":"true"}' -H "Content-Type: application/json" -X POST http://192.168.1.54:3001/assistant

First of all, yes I can confirm that was the curl command I used.
Second, I installed and used V2.
Third, I'm not using a command. I'm just using the "Speak" button on the device itself.

Speak is the command then. is there any response on the console of Assistant Relay?

How do I look at the console of Assistant Relay?

@Ryan780 will be able to better help here, since he's very familiar with v2 and I still use v1. However, if the IP address of the RPi is 192.168.1.54, but your test command is x.139 as you wrote

Then I'm confused how the test command is working. Maybe this is something about the v2 setup I don't understand?

He actually said:

and then confirmed he used.
curl -d '{"command":"hello world", "user":"jtmpush18", "broadcast":"true"}' -H "Content-Type: application/json" -X POST http://192.168.1.54:3001/assistant

I was confused at first too.

1 Like

Well, that depends on how you are running Assistant Relay. Are you using pm2? If so, log into your pi. Then use the command: more /home/pi/.pm2/logs/index-out.log

Or you can simply stop pm2 by issuing this command: pm2 stop assistant-relay

And then going to your assistant-relay folder and typing: npm run start

This will start your assistant relay in your console so that you can watch it as your issue the command from HE.

Then issue your "Speak" command from HE and see what is displayed in the console.

Are these instructions still working? Getting a lot of errors when doing NPM Install. then NPM run start causes the good ole "ERR LIFECYCLE" and fails completely.

did this:
npm cache clean --force
delete node_modules folder
delete package-lock.json file
npm install

still fails :frowning:

debugging, curious if anyone else run into problems installing this on a Raspberry Pi 3