How to use SmartThings to have Alexa do something without speaking to it
As of November 2018, you can now use smartthings to automate Echo events without having to speak to an echo device. So you can use this to integrate with devices that echo can control but that are not available to smartthings and do not have an IFTTT channel. You can also use this to have echo speaker specific phrases when certain events happened, like the door opening or the laundry finishing.
It’s simple. 😎
To Control Devices
Anything which can be turned on/off in an echo routine (not a smartthings routine) Can now be controlled from smartthings.
That’s because an echo routine can now be initiated by a contact sensor opening or closing.
And smartthings allows you to create a virtual contact sensor which looks just like a real contact sensor to Alexa.
Even better, smartthings allows you to create a virtual device which looks like both a contact sensor and a switch to both smartthings and echo. When you turn the switch on, it makes the contact sensor look like it is open. When you turn the switch off, it makes the contact sensor look like it is closed.
So now you can turn that virtual switch on and off with any smartthings automation, including the official smart lights feature, that will make the virtual contact sensor look like it is open or closed, and that can trigger an echo routine.
SmartThings control of anything which can be turned on/off in an echo routine. 😎 which now includes an Xbox.
Code for a Virtual Device which will Show Up as Both a Contact Sensor and a Switch
The following post includes the code for a virtual contact sensor which is also a switch, so you can use that one. forum post including the code for a virtual sensor/switch
If you have never used custom code before, see the article on how to install custom code to your account.
To Make Echo Speak a Custom Phrase
You can use the same virtual device method to trigger an echo routine that will make echo speak a custom phrase. If you only need it to happen on one device, choose the “ Alexa says” action under the echo routine when you add a new routine. But if you want it to happen on multiple devices, choose the “messaging“ action under the echo routine when you add a new routine, and then choose the “announcement“ option. You will then be able to choose specific echo devices or all echo devices to speak the announcement that you are going to trigger.
Activating Your Virtual Device
To activate your virtual device so Alexa can use it, do the following steps:
1) create virtual device in the IDE
2) use the smartthings app to approve Echo access to that device if you don’t have “all devices” approved.
3) use the Alexa app to disable the smartthings skill.
4) log out of the Alexa app.
5) log back into the Alexa app.
6) re-enable the SmartThings skill.
7) ask Alexa to discover new devices
Your virtual device should now be available to trigger an echo routine.
Official Amazon Help Page for Echo Routines
Triggering an Echo Routine with an Echo Button
We should also mention that as of November 10, 2018, Amazon echo buttons (two for $20, about the size of a deck of cards) can also trigger an echo routine. So you can press the button and have the echo routine turn on a virtual switch which then triggers pretty much anything you want in SmartThings. The button won’t be visible to smartthings, but it’s a nice alternative means of control if you already have an echo in that room.