SmartThings + Amazon Echo Official Integration

When you’re using a virtual switch to do stuff via the Echo, you might find this mod handy. Load the On/Off Button Tile Device Type template into the editor, and replace on() and off() with this:

def on() {
    // whatever it is, make it the other
    def flip = ((device.currentValue("switch") == "on") ? "off" : "on")
    sendEvent(name: "switch", value: flip)

def off() {
    on() // flipping is the same for both off and on

This gives you a virtual toggle. Add a device with this Device Type, give Alexa access to it, and you can tell alexa to “turn on” or “turn off” the virtual switch as often as you want and it will always change state - so any actions you tie to it will fire, as long as you tie the same actions to both “turn on” and “turn off”.

Alexa turn on night mode - would work every night. Without having to “turn off night mode” - for example.


That’s a nice trick. I may switch to that. For now I setup the standard switch action “Turn off after” to one minute.

You guys done good on this one. It just works. I like it!

As I mentioned in another topic, I handle it a little differently–I have each new activity turn off the switches for the other activity, similar to what Harmony does natively.

So when I say “Turn on cable,” it also triggers turning off the Roku and DVD virtual switches.

When I say “Turn on DVD,” it also triggers turning off the DVD and the Cable virtual switches.

And turning off Power also triggers turning off all the device virtual switches.

So each event horizon turns off all the things it isn’t when it turns on the thing it is. :wink:

In the case of Good Night, I would have my good morning activity turn off the good night switch and vice versa.

edited to add there was a harmony change just today, and now it won’t let me end an activity that isn’t already started. Which sounds logical, but means I no longer can create a voice substitute for the “all off” button on the physical remote. Anyone interested in those details can see the harmony topic:

I have a Kwikset lock hooked up to my Smartthings hub. Its the only device that Echo didn’t detect.
I can see why Echo shouldnt unlock a door at voice command, but I guess I’d just like to make sure that it really, officially doesn’t.

It really officially doesn’t, at least at the present time. The only device classes that you can control with Echo are lights, switches, and dimmers.

However, because it’s a SmartThings integration, you can use a virtual switch and then tie a mode change or a hello home action or a smartapp to the virtual switch going on and voila! You can do pretty much anything you can do with smartthings. It’s very cool. So you can certainly set up lock controls that way if you choose to. :sunglasses:

So, if I set up a virtual switch to enter a night time HH action, and have an automatic (timed) HH in the AM, is there any reason to toggle the first action or no?

If the night time switch is a momentary switch, then you only deal with that once at night.

If the nighttime switch is a binary (on/off) switch, then you have to turn it off in the morning or you won’t be able to turn it on the next night.

So that comes down to a matter of style, do you get information from seeing that that nighttime switch is turned on, or are you getting that information from something else like mode.

Got it, makes sense. Thanks!

A few things holding me back:

  • Unless using more than one, no multi-room expansion capabilities (Echo acting as a source for speaker and destination for microphone). You can only interface Bluetooth speakers the other way around. It doesn’t look like it’s going to be possible to stream to a Sonos, just to control it but it lacks a microphone and it’s outrageously expensive anyway
  • API restricted to voice recognition (or appears to be). Sound recognition would be a cheap and easy way to retrofit many appliances into connected devices (sensor for doorbell, ready coffee/laundry/dishwasher, etc.)
  • Cloud based processing
  • Still US only

These days almost all voice processing is cloud-based, including Google Now, Siri, smart TVs, etc. it just requires a massive amounts of processing power to do it right.

My echo covers most of the first floor of the house, about eight rooms. That’s one device. It just doesn’t really compare with the Sonos because it’s not for the same purpose and it’s not engineered in the same way.

The amazing, amazing thing about echo, and I say this as someone who uses a lot of voice technology, is the far field voice recognition. Honestly I’ve never seen anything like it.

Sonos is about the quality of music that you hear. But Echo is about the quality of the voice recognition it can do in a room with a television playing while you’re 30 feet away.

You can leave the Echo’s remote control in another room. It has a microphone in it.

1 Like

The Echo remote is definitely good for some people: My housemate uses his late at night when he wants to use a quieter voice.

However, the problem is that like many smart TV controls, it’s not an “always listening” device – – you have to hold down a button while you use it. So it really changes the whole experience from the hands-free echo.

[quote=“vitamincm, post:36, topic:20902”]
Echo’s remote control in another room. It has a microphone in it.
[/quote] Thanks I wasn’t aware that there was a remote although it appears that only one remote can be paired[quote=“JDRoberts, post:35, topic:20902”]
These days almost all voice processing is cloud-based
[/quote] That doesn’t mean we have to like it. Of course it has to rely on the cloud up to a certain extend. I would simply like to see the voice recognition processing performed locally and rely on the cloud only when it needs to. Right now I feel that the thing it just one big speaker/level triggered microphone pair sold with a lifelong service

[quote=“JDRoberts, post:35, topic:20902”]
It just doesn’t really compare with the Sonos because it’s not for the same purpose and it’s not engineered in the same way[/quote][quote=“JDRoberts, post:35, topic:20902”]
Sonos is about the quality of music that you hear.
[/quote] I was referring to the lack to expansion capabilities of the Echo. As of now it appears that the only way to use another speaker is to hack the hardware.

Didn’t I read a blurb in the Echo app FAQ somewhere that you can also use your phone as a microphone to Alexa?

I had feeling the update was for the v2, super happy was for echo integration also. Figures 3 days after I write an endpoint to talk with Alexa it comes out. Still super happy it did then not using my amazon cloud time for usage. Also shows the popularity of SmartThings to be integrated!

Alexa discovered my two Sonos speakers and I checked the box to add them to the Convenience group, but when I give the command “Alexa, turn on Kitchen Sonos”, the response is the device is not responding. I can turn on the Sonos from the ST app without issue. Since Alexa discovered the device, assumed I could control?
I did go into the Alexa app and even though the Sonos devices were listed under “Connected Home”, they showed to be offline. Assume its just not a supported feature yet, but wonder if there is a work around.

Also, I have a Honeywell Z Wave thermostat I would like to set the temperature through Alexa? Any ideas?


This exact command is working for me. Does Alexa not recognize the command or does nothing happen when she does recognize the command?

I’m using a virtual switch to trigger a hello home phrase to set a specific thermostat state. There are several threads about creating virtual switches.

Someone could possibly write a virtual dimmer device type and SmartApp to create true thermostat control.

Looks like the thermostat thing already exists:
FAQ: Amazon Echo: The Official SmartThings Integration is here!


I use virtual switches to control Thermostat Setpoints via Echo/Alexa.

1 Like