SmartThings are Groovy
One of the initial features I wanted was some way for the home and I to communicate. The Google Home seemed to allow bi-directional communication in the sense that I could speak commands and it could be a speaker to broadcast notifications or report other home metrics or SIRENS.
Toward the end of 2016 everyone was complaining about what a terrible year it was and as I reflected upon my own 2016 I thought it went well in the realm of technology. Google released the first generation pixel phone and along with it the Google Home. I had read some stories about Google Home being compatible with the SmartThings ecosystem for home automation and I had always dreamed of a smart home so naturally I bought the SmartThings kit and dove right in.
One of the initial features I wanted was a way for the home and I to communicate. The Google Home seemed to allow bi-directional communication in the sense that I could speak commands and it could be a speaker to broadcast notifications or report other home metrics or SIRENS. To my disappointment the Google Home has not been able to fill this role as I have dreamed and I have struggled over the years to make it a reality.
Initially I looked at some projects that use the casting features built into the Google Home and chromecast devices but the response time is pretty slow and if you are already casting media it is stopped and not resumed. Another solution was to purchase a speaker that was already fully compatible with SmartThings and there are a few that were tempting but I kept thinking I have multiple chromecast audios and multiple Google Homes and in the interest of saving money and space I don't want to add more hardware when the hardware I have is capable (or I felt it should be capable).
So here we are at the end of 2018 and wow has the SmartThings community expanded. A user on the forums has built a handy NodeJS app, Google Assistant Relay, that can broadcast to the Google Home using a recently added feature in the Google Assistant SDK called broadcasting. Not only that, Google recently announced they are expanding the broadcasting feature to support replies from the assistant. These improvements are phenomenal and after getting the Google Assistant Relay setup I was able to POST a JSON message to it which then broadcast whatever text I wanted to all of the Google Homes in my house.
This is what I had been looking for so I scoured around the SmartThings forum to find a smartapp to put the Google Assistant Relay to use and get my notifications broadcasting but I could not find one. So after a little research and development I put together a smartapp that allows you to select the SmartThings devices you want to receive notifications for.
Important: The smartapp and device handler will only work with a functioning Google Assistant Relay v2 server.
SmartApp: Used to broadcast SmartThings device state changes to your Google Home using the Google Assistant Relay v2. The smartapp listens for smartthings device events and POST's a JSON message to the Google Assistant Relay v2 server when a device event is triggered.
Device Handler: Can be used in conjunction with 3rd party tools (ie. WebCoRE) to send custom notifications to your Google Assistant Relay v2 server.
You do not need to install both the smartapp and device handler. If you only want device notifications the smartapp will do that autonomous from the device handler. The device handler is handy to have if you are integrating other smartapps or 3rd party applications that need a smartthings device to perform an action. Currently the device handler only supports the speech synthesis capability.
Install Instructions: Installing the SmartApp on the SmartThings hub and in the SmartThings App
STEP 1: Install the SmartApp on the Hub
Method 1
Login to your SmartThings API account
https://account.smartthings.com/
Click My SmartApps
Click Settings
Click Add new repository and fill in the fields with these exact values and click Save:
Owner: braytonstafford
Name: google-assistant-relay
Branch: master
Click Update from Repo and select google-assistant-relay (master)
In the right side panel under New (only in GitHub) check the box next to smartapps/braytonstafford/google-assistant-relay-notifications.src/google-assistant-relay-notifications.groovy
Check the box for Publish
Click Execute update
Method 2
Login to your SmartThings API account
https://account.smartthings.com/
Click My SmartApps
Click New SmartApp
Click From Code
Copy and Paste the code from here into the code editor
Click Create
Click Publish -> For Me
STEP 2: Setup the SmartThings Mobile App
Open the SmartThings App
Go to the Marketplace
Click SmartApps
Click My Apps
Click Google Assistant Relay
Choose the devices you want to receive notifications when their state changes.
Fill in the Google Assistant Relay Hostname or IP Address
Fill in the Google Assistant Relay Port
Click Save
You should now hear broadcasts to your Google Home when the selected devices' state changes.
Install Instructions: Installing the Device Handler on the SmartThings hub
STEP 1: Install the Device Handler on the Hub
Method 1
Login to your SmartThings API account
https://account.smartthings.com/
Click My My Device Handlers
Click Settings
Click Add new repository and fill in the fields with these exact values and click Save:
Owner: braytonstafford
Name: google-assistant-relay
Branch: master
Click Update from Repo and select google-assistant-relay (master)
In the right side panel under New (only in GitHub) check the box next to smartapps/braytonstafford/google-assistant-relay-speech.src/google-assistant-relay-speech.groovy
Check the box for Publish
Click Execute update
Method 2
Login to your SmartThings API account
https://account.smartthings.com/
Click My Device Handlers
Click Create New Device Handler
Click From Code
Copy and Paste the code from here into the code editor
Click Create
Click Publish -> For Me
STEP 2: Create the Device on the Hub
Login to your SmartThings API account
https://account.smartthings.com/
Click My Devices
Click New Device
Enter these values in the fields and click Create:
- Name: Google Assistant Relay Speech
- Label: Google Assistant Relay Speech
- Device Network Id: GoogleAssistantRelaySpeech1
- Type: Google Assistant Relay Speech
- Version: Published
- Location: [YOUR LOCATION]
- Hub: [YOUR HUB]
- Group: Location: [YOUR GROUP] (if applicable)
STEP 3: Setup the Device in the SmartThings app
Open the SmartThings App
Go to My Home
Under the Things tab click the Google Assistant Relay Speech device
Click the settings wheel in the top right
Enter the Google Assistant Relay Hostname/IP Address and Port
Click Save
If you give it a try and run into any problems feel free to open an issue in the github repo and I'll check it out. I hope you are as excited as I am to get started broadcasting my SmartThings events throughout my house via broadcast messages on Google Home.
Head over to the SmartThings forum post to engage with the community.