Version 3 has now been released: [Release] Assistant Relay V3 - Google Home Audio Notifications!
I’ve wanted to get audio notifications on my Google Home for a long time as have a number of people. There are quite a few implementations of this, however they all use the cast feature to cast TTS audio to your speaker.
Back in Autumn/Fall last year, Google announced their broadcast feature for Google Home which lets you send audio notifications to all Google Home devices.
Until recently, there hasn’t been a way to do this, until one of the Node modules I follow was updated to use the new text input feature of the Google Assistant Service API
What is this?
- This isn’t an extension of your Google Home
- This isn’t some fancy local API that connects directly to your Google Home
- This is a Node.js server that uses the Assistant SDK
- This is basically another Google Home device, but without a microphone and speaker
What can I do with this?
Assistant Relay is a Node.js server that will accept requests, and then process them. These might be broadcast requests, predefined statuses or routines. It accepts text entry and then does something with it.
As an example, open up Google Assistant on your phone and then type
broadcast hello world. Your Google Home devices will now announce “hello world”.
There are lots of things you can do such as:
- Send broadcasts, useful if you want to announce that the back door has been opened
- Trigger routines through Google Home, useful if you don’t want to setup your Google Home routines again in SmartThings, WebCore, IFTTT or whatever other platform you might use
You can also hook this up to anything you want, it doesn’t have to be SmartThings:
- Send broadcasts from your phone to Google Home if your phone rings using Tasker
- Send a predefined movie announcement using WebHooks from Plex
Assistant Relay relies on the Google Assistant SDK, therefore it only currently supports x64_64 or ARMv7 processors. It should work on the latest Raspberry Pi’s with an ARMv7 chip. Check the below pages for more information
What you need
- A device capable of being always on
- Node.js running on this device
- A copy of Assistant Relay
I’m not going to run you through how to get Node.js running on your device as there are hundreds of guides out there on how to do this. http://thisdavej.com/beginners-guide-to-installing-node-js-on-a-raspberry-pi/
You then need to configure your Assistant Relay so that it works with your Google Account. I’ve put the configuration guide on my Github Repo. Follow that and run the relay. If the relay is running successfully, your Google Home should make an announcement to tell you its running
How To Use
You can now make a call from WebCore, Tasker, IFTTT or anything else. I’ll share some of my Postman examples below:
Above is an example of how to call Assistant Relay and pass data to it using variables.
If you want to test the commands out in Postman first, I’ve updated the collection below:
There is a new way to send requests. Please see the Github documentation or the screenshots above
V2 now responds with a JSON object that includes information about your request
If you use something like cast-api, Sonos or any other network connect speaker, you can now send your Google Assistant audio responses to specific devices. It’s not the same as a broadcast, so it will interrupt whatever is happening but its the best we have at the moment.
In the below example, I am making a request to Assistant to tell me about my day. Assistant Relay saves the audio file and sends a URL to listen to it back in the response.
What you can then do is tell a speaker to play that URL from the response, and it will play the Google Assistant response.
Upgrading from V1
There is no upgrade path as it’s not really somethign required. Just keep your auth files safe, trash your existing install and then start fresh with V2.
Bugs and Requests
Could you use the Github repo to add any bugs or feature requests please. It’s too difficult to track them here:
– V2 released
– V2.1.1 released