Integration with Amazon Echo

Posted on
Sat Jul 11, 2015 3:46 pm
ArthurD123 offline
Posts: 28
Joined: Jun 23, 2014

Re: Integration with Amazon Echo

I've got this all working -- except the query string parameters. Is there a way to:

A) Make Alexa be ok/happy with the 302 response?

B) Send the request as a POST so that Indigo will take appropriate action on the HTTP request?

And a bonus question, C) Way to make Alexa forget about all existing "connected home" devices? The "forget settings" only removes groups it seems, but not the [pseudo-]devices themselves...

FWIW, chances are I'm going to just write a real "ASK" plugin for Amazon Echo using their API instead of going this route. For now, though, I'm just looking to get something working and see how promising it is before I venture completely towards writing a real ASK plugin...

Posted on
Sat Jul 11, 2015 4:11 pm
ArthurD123 offline
Posts: 28
Joined: Jun 23, 2014

Re: Integration with Amazon Echo

Okay, you can ignore questions B and C. But question A remains, though I'm about to dive into the Java source now to see if it can be rectified there...

As far as how I figured out B --> I realized that the special "_method" query param is actually for Indigo, not for the Java web service. For Action Groups, you must use "_method=execute" (instead of 'put'). Changing this took care of it for me.

For C --> The second time I cleared all connected devices, it did remove the devices as expected... I also had to delete the data directory to "reset" what the Java server already 'knows about'.

Question A remains, however -- how can I make Alexa be OK with the 302 response (which is also slower for some of my larger action groups, seems to be crashing the Java thread most of the time).

Posted on
Sat Jul 11, 2015 4:56 pm
ArthurD123 offline
Posts: 28
Joined: Jun 23, 2014

Re: Integration with Amazon Echo

Well, I at least figured out how to make the Java app *always* respond with success so that Alexa likewise always sees success. Attached is a screenshot of the Java code changes that I made. I then re-compiled (cmd: mvn package) and used the resulting new JAR file.

Fairly successful for day #1 of Alexa/Indigo integration! :-)
Attachments
Screen Shot 2015-07-11 at 3.53.56 PM.png
Screen Shot 2015-07-11 at 3.53.56 PM.png (331.05 KiB) Viewed 2759 times

Posted on
Sat Jul 11, 2015 11:59 pm
discgolfer1138 offline
User avatar
Posts: 45
Joined: Jul 28, 2011
Location: Golden, CO

Re: Integration with Amazon Echo

fwiw, I found that having spaces in my device names was making the java app return error responses. The devices would still respond as expected, but the java app's console would show warnings regarding unexpected characters in the request url. For example, I had to change the name of my 'Living Room' lights to 'living-room', then everything was happy... Alexa now performs the command and, after a brief pause, says 'OK'.

Indigo 6.1.0 | Mac Mini | OS 10.10.3 (Yosemite)
Fork Me on GitHub!

Posted on
Sun Jul 12, 2015 3:27 pm
wideglidejrp offline
User avatar
Posts: 525
Joined: Jan 15, 2012
Location: Danbury, CT

Re: Integration with Amazon Echo

I have had the Amazon Echo for a few days now and can see great potential with it. The IFTTT recipes are great. I have great respect for what ArthurD123 did with Java. I suspect t most of us could not do that. Certainly, not me. We really need a new channel for Indigo on IFTTT. I assume Matt or Jay have filled out the channel partner inquiry form at https://docs.google.com/forms/d/1dlH6aA ... 8/viewform Looks to me like Amazon Echo can make Indigo home automation even greater than it already is.

John R Patrick
Author of
Home Attitude

Posted on
Mon Jul 13, 2015 10:01 am
jay (support) offline
Site Admin
User avatar
Posts: 16560
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Integration with Amazon Echo

wideglidejrp wrote:
We really need a new channel for Indigo on IFTTT.


viewtopic.php?p=95080#p95080

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jul 19, 2015 8:41 am
webdeck offline
Posts: 398
Joined: May 07, 2005

Re: Integration with Amazon Echo

I ran into the spaces problem as well. The issue is that URLEncoder changes spaces in a URL to plus signs, but the Indigo REST API doesn't handle the plus signs, and instead wants spaces encoded as %20. So what I do is after encoding the URL, I replace the plus signs with %20.

Code: Select all
URLEncoder.encode(loc).replace("+", "%20")

Posted on
Fri Jul 24, 2015 9:20 pm
mattmullen offline
Posts: 18
Joined: May 24, 2013

Re: Integration with Amazon Echo

Hey Indigo gurus,
Some of the folks on the Homeseer forums have been able to get the Echo to talk to Homeseer via the Restful api. Could somebody who knows about this stuff take a look and see if it could bre adapted to Indigo?

http://board.homeseer.com/showthread.php?p=1189626

Thanks, Matt

Posted on
Fri Jul 31, 2015 10:45 am
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

I just got my Echo and I am planning to port my SiriProxy plugin from a couple years ago into the Alexa Skills Kit SDK. The only issue I am having right now is accessing Indigo from the internet. I have not made my Indigo accessible outside the LAN, and I don't really want to have to. BUT, I believe I will have to in order to get the SDK plugin to work, as it runs from Amazon Web Services. There are a few youtube videos of people having their Echo work with their insteon setups. I was planning to ask these folks if they have to open their LAN so AWS can see their HA system. I might bite the bullet and use Reflector or something of the like, if there is no better way...

Stay tuned.

Matt

Posted on
Sat Aug 01, 2015 10:07 am
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

Yeah, so... the Homeseer thread above makes it clear that we do have to make Indigo available to the interwebs in order for an ASK plugin to access it.

Question: Would people be ok with this/still want this plugin?

Matt

Posted on
Sat Aug 01, 2015 10:10 am
DVDDave offline
Posts: 382
Joined: Feb 26, 2006
Location: San Jose, CA

Re: Integration with Amazon Echo

Sure, Matt. A lot of us forward our router to Indigo rather than use a reflector. Thanks for looking into this.

--Dave

Posted on
Sat Aug 01, 2015 10:52 am
manoncloud9 offline
Posts: 75
Joined: Apr 27, 2014
Location: Minneapolis MN

Re: Integration with Amazon Echo

I am all for it. Would love to test if you need any testers.


Sent from my iPhone using Tapatalk

Posted on
Sat Aug 01, 2015 12:40 pm
colovin offline
Posts: 161
Joined: Oct 27, 2009

Re: Integration with Amazon Echo

You can add me to the yes list and would be happy to test if you are needing beta testers.

Indigo 7.1.1, OS 10.14.6, MacMini .3.2 GHz 6 Intel Core i7, 64 GB ram

Posted on
Sun Aug 02, 2015 3:43 pm
mreyn2005 offline
User avatar
Posts: 161
Joined: Oct 06, 2006

Re: Integration with Amazon Echo

Um, so yeah. It works. :D :shock: :D

R.I.P. SiriProxy... Helllo Amazon Echo! :o

https://github.com/msreynolds/askIndigo

This guy (Thrag) does a much better job of explaining the whole Alexa Skill Kit plugin and publish portion...
He is making unauthenticated calls to HomeSeer over the internet (yikes!), but the basics are there.
I used his lambda function as a starting point (thanks!):
http://board.homeseer.com/showthread.php?p=1189626

If you can chew through that, look at my github project for the lambda code and speech assets (you will make a zip file instead of pasting code inline on the lambda online editor):

I ended up using the Go Prism Reflector, mostly because A) its $29/year, and B) it is integrated with Indigo, and C) it's served over https on port 80. No router fuss, better security than NATing, etc. In conjunction with Digest authentication, I feel we're in the realm of reasonable security.

Currently tracking issue for dealing with upper and lower case device naming schemes that typically vary by user
https://github.com/msreynolds/askIndigo/issues/1

Currently tracking issue for building the zip file via shell script and zip utility
https://github.com/msreynolds/askIndigo/issues/2

As always, this is a work in progress. I haven't tested it very much yet, so be gentle. I am sure there are bugs. I plan to fix them as I plan to use this in my own home.

I am pretty stoked to have voice control for Indigo back! Let me know what you guys think! I am seeing ~3-5 second round trip from the time I complete my request to Alexa to the time the action has completed in Indigo! That is from Echo -> AWS Lambda -> GoPrism.com -> Indigo all over https using Digest Auth.

\m/ rock on
Matt

Posted on
Sun Aug 02, 2015 10:50 pm
HowmaNoid offline
User avatar
Posts: 67
Joined: Apr 14, 2012

Re: Integration with Amazon Echo

Looks like they've opened things up in both directions. Now you can pull info available to Echo from any of it's sources into Indigo.

http://www.engadget.com/2015/08/02/amaz ... d=rss_semi

This is starting to look very interesting..

Who is online

Users browsing this forum: No registered users and 1 guest