SmartThings and Amazon Echo (Using ASK)

So there are a few other posts that I have been posting in… But I am going to start a new topic to keep track of the progress that I am making in this project and stop spamming the other topics.

I have been working on integrating the Echo with SmartThings and I have been making some good progress!

UPDATE:
For anyone who is interested in using it, Please go to: https://alexa.zpriddy.com
Please let me know of any problems you find while using it so I can fix it!

Quick Notes:
This code is designed to be run on a ‘server’ with port 443 available from the internet (This is a requirement from Amazon). The server can be as small as a RaspberryPi hosted at your house. You will probably need a decent understanding of linux and networking to set it up. [ I am also playing with the idea of allowing a few people to run off of one of my servers for better testing - Please feel free to message me ]

This code is written in Python and uses oauth to authorize to SmartThings

I started off by getting the Nest to work with the Echo. I figured that this was a good start because there was a lot less variables to deal with… I ended up having pretty good success with this and have the code available on my Github: https://github.com/zpriddy/ZP_EchoNestPy There is also some overview and videos on my website at: https://zpriddy.com/posts/echonestpy-alexa-meet-nest-via-python/

From this I got a pretty good understanding of how the Alexa Skills Kit works and was able to start working on my SmartThings control. I already had a decent python interface for SmartThings from my Python dashboard for SmartThings SmartThings PyDash and was able to use most of the code to start tying into the Echo interface.

EDIT: 2015-07-13 - I now have the echo working with switches. I have also added a feature to generate all possible sampleUtterances for ASK.

At the time of this first post I have gotten 'Alexa, tell SmartThings to set mode to ’ working. I am hoping to have more working by the end of this week! As of right now I have not made the code public on GitHub because it is still very early and need to work out a few more bugs. But if you are interested in contributing to the code or testing it please contact me and I will try to give you access and more details.

As I make progress on this project I will keep posting to this post and also to my website: https://zpriddy.com


Other Posts:


14 Likes

Just wanted to verify my understanding that your method is using the official Alexa Skills Kit, not the hack using the Philips Hue Bridge emulator.

My own expectation is that Philips is going to find a way to shut down the emulator method in a few months–it’s a clear violation of their developer TOS.

But anything based on ASK itself should continue to work longterm. :sunglasses:

Yes. This is using the official Alexa Skills Kit. :slight_smile:

3 Likes

Excellent! Thanks for updating us. :sunglasses:

1 Like

Very cool. Maybe I should have grabbed the Echo when I got an invite. I’m afraid my wife would have killed me though.

Haha… I almost got murdered for it… But now she likes it…

“Ugh. More wires!?” That would have been an exact quote.

1 Like

So… As of this morning I got switch commands to work!

So it has become:

-Alexa, tell SmartThings to tell switch bedroom fan to toggle
-Alexa, tell SmartThings to turn off bedroom fan
-Alexa, tell SmartThings to set switch bedroom fan on
-etc…

I will hopefully have another video later today.

6 Likes

Very Cool, I will be forking and playing with this.

Darn, another programming language I have to learn, Python…

Learning Groovy just for SmartThings now I must learn Python to play with your code LOL.

ST is driving this old dog to learn new tricks :dog:

1 Like

I’m betting Hue level integration by SmartThings (ie, “partner level”) will occur before the Hue emulation backdoor is locked.

That’s why I would like to get the real thing working with ASK but I do also agree with @tgauchat that the bridge will work long enough for the ST integration to happen or for one of us to create a really good ASK interface. Which might have happened already :smile:

ST has a tiny market share, people technical enough to get the emulator working is even smaller. I doubt hue will notice or care. Not worth the cost of shutting it down.

1 Like

I’m sure there will be many kinds of officially-sanctioned integrations available in a few months, including ASK skills like @zpriddy is working on.

If I had to guess (pure guess) a timeline on the emulator being shut down, I’m guessing about the time iOS 9 is released.

There is a lot of concern about the emulator hack being used for many different integrations, not specifically ST. Philips is making some security-oriented changes to prepare for HomeKit integration anyway. But who knows?

@Ron As soon as I get some of the bugs worked out I will be posting my code to GitHub publicly… As for having to learn python… there should be anything in the code that you have to change to get it working.

I want to reverse engineer to learn how to program for my Echo. I have a machine setup on digital ocean just for this purpose :smile: I like to tinker and this will be a good way to learn it…maybe…

I have the hello world demo in python that I will post on github later today. I feel like that is a good starting point.

I made the mistake of installing the new OS X beta… Last time it wasn’t too bad… so I’m in the process of downgrading. I also decided to rebuild my personal website… So that may appear to be down in a little bit…

But for good news I have a server dedicated for Alexa commands and currently running my SmartThings skills code. I am hoping to have down some documentation by the end of the day of how to tie SmartThinsg into ASK using this sever. For right now I want to keep the load down on it so please message me if you are interested.

Notes:

  • I learned that with each new ASK integration your Amazon EchoID changes… This is good news because it means that it is more secure
  • I also learned that if you have numeric digits in any of your device names you won’t be able to control it with ASK (at least the version I have made… so far…) It will always pass two instead of 2…
4 Likes

The jury is still out on SmartThings. The Amazon Echo was a different story. Prior to its arrival she was a skeptic. We are now both Echo fans. I think the SmartThings hub V2 has potential.

Replying so I can keep track of this thread. Looks interesting… curious how it would deal with my accent :smiley:

1 Like

Echo is quite good with many different accents, including slurred speech. I use a lot of voice technology, and Echo continually amazes me. I am quadriparetic and have home health aides, many of whom have English as a second or third language. So far it understands everyone. :blush:

3 Likes

I heard from an Echo engineer that the way to optimize for your accent is to use the “training” feature. It certainly does a good job out-of-the-box without training, but I wonder how much better it gets…

1 Like