Amazon Echo/Alexa

1,426 views
Skip to first unread message

Dan van Kley

unread,
Jul 7, 2015, 8:26:53 PM7/7/15
to ope...@googlegroups.com

Has anyone looked at putting together an Amazon Echo integration for openHAB? Seems like it would make a very cool interface for a home automation system.


Here's a quick intro if anyone's interested: https://developer.amazon.com/public/solutions/alexa/alexa-skills-kit/getting-started-guide


If not, I think I'll give it a shot. Considering design, my first instinct was to build an Echo app that was configured to pass intents directly to the openHAB API, so all the custom logic could be configured on the openHAB end. The dealbreakers here are that Amazon only allows Alexa apps to hit a single URL per app, and that it has to have an Amazon-approved SSL certificate. So the next idea is to set up a multi-tenant cloud service that's basically a translation layer for the Alexa intents to be parsed into openHAB commands and passed to the REST API on a user's openHAB server. That wouldn't require much more configuration for the Echo app than auth, but only allow access to items (and sitemaps, which wouldn't be useful for this interface) because that's all the REST API interacts with. This is definitely doable, but load might eventually become an issue with a single service.


Any design thoughts from those of you who have real experience with openHAB? Is this a bad idea?

dan cunningham

unread,
Jul 7, 2015, 10:14:22 PM7/7/15
to ope...@googlegroups.com
Yes, actually I had started a binding that is about 1/4 done, but someone yesterday pointed me to this project https://github.com/armzilla/amazon-echo-ha-bridge  I'm planning on using this and contributing to it instead.  I was going to post something soon about it.  

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
To view this discussion on the web visit https://groups.google.com/d/msgid/openhab/889e820d-62d2-4a13-9137-b09cc0c458b7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dan van Kley

unread,
Jul 9, 2015, 7:41:02 PM7/9/15
to ope...@googlegroups.com
That is interesting. I like cutting the cloud server requirement out of it, but I'm not a big fan of being dependent on a third-party app through a third-party closed source protocol. Echo's still in very active development, maybe the the pieces aren't quite there yet.

dan cunningham

unread,
Jul 9, 2015, 11:35:54 PM7/9/15
to ope...@googlegroups.com
Hmm, well couple things to note.

The amazon SDK is very limited, applications require a "app" name to execute, so you would say something like "Tell openhab to turn office lights off",  I really just want to say "turn office lights off"

Unless every user is willing to setup a dev account and publish an app just for them, we would need to publish a echo service through  something like my.openhab,org and link users echo accounts to their openhab account, thats not a small effort.

I'm not sure what you mean by closed source protocol, the project emulates the phillips hue protocol which is imho a very nicely documented and well written protocol, II believe their "conditions of use" requires developers to "have fun".  So I'm not really concerned about the ip around the protocol..

The project mentioned above also has a few interesting pull requests by other devs, including working with other hue compatible systems like the Logitech Harmony hub.  I like how it is enabling more then just vera or openhab users.    

It took me only a few minutes to setup 30+ devices on my openhab instance, I'm sitting here right now controlling everything from my lights, pool/spa, as well as music using my echo, its kinda awesome ;-)    
 

Dan van Kley

unread,
Jul 9, 2015, 11:42:52 PM7/9/15
to ope...@googlegroups.com
Ha! Well, fair enough. Correcting my ignorance is exactly why I asked the question here. I think I'll give it a shot. :)

dan cunningham

unread,
Jul 10, 2015, 1:02:35 AM7/10/15
to ope...@googlegroups.com
Well I decided to re-read the Hue API conditions, and they do have this clause:

"We want all your apps to work with our API to form a rich ecosystem of interoperable applications, so it is a condition of access to our API documentation that you do not use it to develop or distribute any bridges or devices which interpret the hue API in order to control physical devices. Emulators are allowed provided they only control virtual bulbs"

So your right in that it is not a truly open API, but I think I can live with it ;-) 

The amazon-echo-ha-bridge project is a bit rough to get going, make sure you have java 1.8 installed and that maven can see it, I have it running on a mac and odroid without problems.  Its not in the documentation, but once you have it running point your browser to "/configurator.html"  to add the openhab rest endpoints.  Here's an example of turning my office lights on/off, including passing in a username and password:

Now if Amazon would only change the wake work from "Alexa" to "Computer" (like Star Trek TNG), things would be perfect ;-)

Nolan Garrett

unread,
Jul 12, 2015, 6:13:13 PM7/12/15
to ope...@googlegroups.com
Is there a plan to get the HA bridge to detect OpenHAB items, and thus avoid the need to manually maintain items in two places?

dan cunningham

unread,
Jul 12, 2015, 6:36:40 PM7/12/15
to ope...@googlegroups.com
I actually don't mind entering each thing. In order to be useful you need to enter a voice friendly name for each device , before I was thinking about a special site map where the label values would be names. It wouldn't t be to hard to write some thing to do this and import it in. But right now It's a nice short term solution to see if the echo teams expands the Sdk to do something that would integrate better. I can post a compiled jar to run with Logitech support if anyone wants.

Dan van Kley

unread,
Jul 13, 2015, 10:44:44 PM7/13/15
to ope...@googlegroups.com
I was able to set the bridge up with a minimum of fuss and it works great. This is exactly what I wanted. Thanks for the tip! I'll be sure to keep my eye on this in case I can contribute anything.

Hugo Donis

unread,
Jul 14, 2015, 12:10:19 PM7/14/15
to ope...@googlegroups.com
Would any of you guys know how to install this on a Raspberry Pi? Is there any prerequisite software needed to get this to work properly?

I looked at the developers github but there really isn't much there to go on. 

Any help you could provide would be greatly appreciated. 

Note: the Raspberry Pi I plan to use also hosts my OpenHAB/ZWave application so i may have to change the default port (8080) to something else so that it doesn't conflict with the Amazon Echo binding. 

Dan van Kley

unread,
Jul 14, 2015, 12:57:53 PM7/14/15
to ope...@googlegroups.com
Hugo, I stood this up on a Pi last night in the exact same way you describe (with openHAB and ZWave running on it) and it went pretty well. The only thing I ran into was the 8080 conflict as you predicted, which you can get around by modifying src/main/resources/application.properties and setting server.port=8081. Note that this is built into the .jar, so you'll have to rebuild the jar if you're running it that way. You can probably also override this with a command line arg, I didn't try. The rest should be pretty standard, just installing maven and the latest java and running it as described in the project's readme, then go to the configurator site in your browser and set up your URLs as Dan describes above. I can probably help you if you hit any snags.

We should probably submit a PR to update the readme for openHAB users.

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/nuqiEOcJbv4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

For more options, visit https://groups.google.com/d/optout.



--
Dan van Kley

Hugo Donis

unread,
Jul 15, 2015, 11:22:26 AM7/15/15
to ope...@googlegroups.com
Thanks for the reply Dan, 

I was able to install the binding and test (through the configurartor.html  page) some of the items and it worked. 

Unfortunately I cant get the Echo to actually detect the added devices. 

Both the Echo and the RaspberryPi that run the binding are on the same Wifi network so I'm at a loss as to how to get them to communicate with each other. 

Any suggestions?

Hugo

dan cunningham

unread,
Jul 15, 2015, 11:42:36 AM7/15/15
to ope...@googlegroups.com
Hi Hugo, when you run it are you passing in the right IP address (--upnp.config.address=xxx.xxx.xxx.xxx) ?  This is what is broadcasted to devices searching for it.  

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Victor Belov

unread,
Jul 15, 2015, 1:29:38 PM7/15/15
to ope...@googlegroups.com
Hi,

Well, I'm going to integrate my.openHAB as alexa skill anyway, my echo is arriving next week :-) I'm ok about saying 'Alexa, ask openhab what is the temperature outside' or 'Alexa, turn on office lights'.

Best regards,
Victor Belov

dan cunningham

unread,
Jul 15, 2015, 3:03:18 PM7/15/15
to ope...@googlegroups.com
That's awesome Victor, can't wait to test!

Hugo Donis

unread,
Jul 15, 2015, 8:57:52 PM7/15/15
to ope...@googlegroups.com

I'm using the IP address of the Raspberry Pi that is running 🏃 the Amazon binding.

Is that the right IP address to use?

You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/nuqiEOcJbv4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.

Hugo Donis

unread,
Jul 15, 2015, 9:47:36 PM7/15/15
to ope...@googlegroups.com

I turned on debugging for the amazon_bridge and can see that its receiving SSDP Discovery packets from the Echo but it doesn't appear to be responding back.


Any thoughts on how to resolve this?


I am using a Linksys e4200 (as router with WiFi) and ATT NVG589 (as modem in passthrough mode, WiFi disabled). Since the binding can see the SSDP Discovery package I assume my router and modem are configured correctly to allow uPnp/SSDP Multicasting. Would that be a reasonable assumption?



Reinhard Vornholt

unread,
Jul 31, 2015, 7:12:48 AM7/31/15
to openhab, bcq...@gmail.com
Did you ensure, that your UPD Port 1900 is open?

josep...@gmail.com

unread,
Aug 11, 2015, 7:56:22 PM8/11/15
to openhab
Victor, I can't wait to see this!  Please let me know if I can help in any way.  I have a pretty extensive setup, and the skills integration appears pretty limitless.  The amazon-echo-ha-bridge is neat and works great, but it really doesn't allow for the back and forth that would be so perfect for the openhab system. It only responds with "ok".  The skill will let openhab relay back what it is doing and what has happened.

Creating a dev account for each user/instance is not without precedent.  We do the same thing for Nest and it works great.

Bragging rights for openhab if it get's to this first! ;)

Nolan Garrett

unread,
Aug 31, 2015, 5:07:45 PM8/31/15
to openhab
How's this looking? I am excited to try it.

josep...@gmail.com

unread,
Sep 12, 2015, 12:10:55 PM9/12/15
to openhab
Is anyone making progress.  I'd love to help if I can.

Just opened up a topic on the new forum...

https://community.openhab.org/t/binding-request-amazon-echo/2518

Kevin Shih

unread,
Sep 14, 2015, 11:20:13 AM9/14/15
to openhab
I run this bridge on the same Pi as OH without having to modify the jar. It accepts a parameter to override the default port. My startup command looks like this:

java -jar amazon-echo-bridge-0.2.1.jar --upnp.config.address=XXX.XXX.XXX.XXX --server.port=8081

So this tells the bridge to run on port 8081. I also created a startup script as well as an init.d script that starts the bridge as a service if anyone is interested.

HTH,

Kev
Reply all
Reply to author
Forward
0 new messages