Playing around with Amazon Echo (technical interface discussion)

@schettj ah, that was the part I was missing, thanks! By the way, I’ve been using your instructions/code for creating the Echo “app” for SmartThings, so thanks for that too! It works well, I just want to get rid of the “open SmartThings…” or “tell SmartThings to …” preamble.

@Ron a raspberry pi would definitely be easier, I just wanted to play with what I have :slight_smile: with the Wink being added to the Echo, and the page here being worded in a very cloud-hub-generic way, I’m optimistic that SmartThings will get native integration soon… maybe I’ll just wait.

Anyone think they can port the hue Bridge Emulator to Android OS?

Troy:
How do you use this? The EchoCommand page is asking for a code from Echo. What is that and how do you get it?
Chris

Java version or the Node.js version?

Java version is working fine for me on a Beagle Bone; but Node.js is most certainly lighter weight.
I still feel odd about using Android as a “server”, but that’s just because its “not quite Linux”.

Well – you can start by looking for a Node run time environment for your Android. I presume there are a few. Googling resulted in confusing results.

Yeah, that’s the problem, there aren’t any of those I could find. A small Linux stick is probably easier to use.

1 Like

So just as a heads up… I have been playing with the Alexa Skills Kit (ASK) and learning how to do proper integration with the Amazon Echo… I am a fan of python - Those of you who have seen my SmartThings PyDash know this…

I have been working on making a python based API for the ASK and finished up my first one… I decided to start off basic and do a simple Nest Control App… It will require a computer to run it off of with port 443 exposed to the internet - A RaspberryPi will work. - So far I have gotten good results with controlling my Nest…

Now that I have my Proof of Concept done with the Nest… I am going to start working on my SmartThings control. Since I have made my code very modular with the intent of doing this… I feel like it shouldn’t be too long before I have my SmartThings Control done…

For those of you interested in my Nest Control… It is posted on my GitHub at : https://github.com/zpriddy/ZP_EchoNestPy

More details and a video at:
https://zpriddy.com/posts/echonestpy-alexa-meet-nest-via-python/

I am very excited to see what I can do with the echo! And anyone who would be interested in helping me develop the code for this… Please feel free to contact me!

4 Likes

Great work !!! I configured Alexa using your code last night. Awesome … works so great. Now I don’t need to keep my phone next to bed to switch off lights…

2 Likes

Thx @zpriddy your worked help me figure out a few things! I setup my own server with PHP an started some work.

1 Like

I thought that I would reply back with a little teaser video… But things are coming along well… And I hope to have it out onto github later this week.

I will keep posting updates on my blog: https://zpriddy.com

3 Likes

Other than Mode Changes, are you able to directly control lights ?

BTW really looking forward to this !

Mode changes are the first things I have implemented for SmartThings. I did a lot more backend code than i thought I was going to do to support multiple users and api functions.

I am hoping to have light controls done today.

Hey @zpriddy what are you planning for the final solution? Because It seems like the only solution is to create a “website” where a user (Smartthings or Nest user) would login and linked there account, and associate them with an amazon user id.
Then you could ask Alex to do stuff… The thing is all commands would then go to that server… Also that would mean that the server would have access to accounts of everybody who logged in.
I already feel uncomfortable with my data being out there, I don’t know if I’d like to do the same for other people. I think it would be safer for SmartThings and Nest to do those integration :confused: even if it won’t happen for a while.

Now if anybody has an idea for an Alexa app that just return simple data like Horoscope… that I can build safely.

@zzarbi That is the idea I am going after. Right now it is tied to the Echo ID and uses oauth with SmartThings and Nest. This allows a user to not have to give a username and password to my server but rather have Nest and SmartThings give my server a auth token that can be revoked at any time. This is the standard way to integrate 3rd party apps into each other… For example if you are using a Nest with SmartThings you are probably already doing it this way.

It really becomes an issue of who do you trust with your data?

However I am releasing the code to allow people to deploy their own server on something as small as a raspberry pi that they could host at their house and now have to share with other users. The catch is that you will need to forward port 443… I do work in Cyber Security and I try to make anything I develop as secure as possible…

I wont lie, at this point in time there is one vulnerability that I see… But it would require the ‘Attacker’ to brute force Amazon Echo ID’s (At lets say 10 Echo ID’s a second - about 59306661759 years…) They would also need to know how to craft the proper packet including a timing check and a Session ID that hasn’t been used yet… But with any system there is always a weakness and that is usually your username and password - In this case that your Echo ID and Session ID…

5 Likes

really looking forward to this integration

Just as a heads up to everyone… I am moving my progress updates over to

2 Likes

So yesterday I got my echo talking to ST with the ASK. It works well and it’s fast, however I didn’t enjoy saying alexia tell smartthings turn sunroom light on. So I happened to have a RPi sitting around and figured I would try and run @Ron code on its a hue emulator. It works great and often the light or virtual switch turns on or off before Alexa response back with “ok” only thing I would like todo now is dim the light. Also it’s time for me to get some of the cooper zwave switches to add into some of my rooms. Thank you @Ron for your hard work and sharing it.

1 Like

@Tomforti - Reading this reminded me of something that I was intending to do and forgot about… I believe that I was able to drastically improve the response time of the ASK commands. You should give it a shot and tell me! :slight_smile:

On point of distinction: use of the Philips-created hue emulator for this purpose is a violation of the Philips’ Terms of Service.

I know that most people here got the Philips-provided code from someone who got it from someone who got it from someone, and they themselves never agreed to a Philips TOS.

Just be aware that it’s likely that that method will be shut down sometime in the future, perhaps as early as the fall. So don’t get too invested in it.

That caution doesn’t apply to the ASK method, of course–that’s the official integration method provided by Amazon.

1 Like

I just installed some code someone gave me, never looked at and don’t even know how to open a .jar file. I know nothing :wink:

Main reason I’m using @zpriddy code as well I have both running on my echo, I just had to try out @Ron code to see the difference between the two. I honestly must say it’s nice to not have to have the echo load up a skill before giving a command.
@zpriddy that remindes me of a questions I wanted to ask you. I have tried to run a command by said Alexa tell smartthings to turn sunroom on. When I do it doesn’t go into the skill. I have to say Alexa tell smartthings…(welcome to smarthings control, please say a command)…turn sunroom on. Any ways to improve this on my end?

Have you watched the movie “Midnight Express”?

“Honestly, officer, I was just carrying this bag someone gave me. I never looked inside it and don’t even know how to open a jar. I know nothing!”

Cue sound of jail door slamming shut…

:wink: