HomeGenie Forum

Development => Feature request => Topic started by: kevin1 on September 08, 2015, 05:35:32 PM

Title: Amazon Echo / Alexa
Post by: kevin1 on September 08, 2015, 05:35:32 PM
Anyone using an Amazon Echo (http://amzn.com/B00X4WHP5E)?  We have one coming later this week.  Plan to use it in our kitchen/dining area; and it's near our main entry, so it would be awesome to integrate with HG :-)  Ideas.... "Alexa, turn on all the lights"  "Alexa, turn on the alarm" "Alexa, are all the doors closed"

Developer info here:  https://developer.amazon.com/public/solutions/alexa (https://developer.amazon.com/public/solutions/alexa)

Could HG be the web server for adding skills to the Amazon Echo?  There is a .net example here...
http://forums.developer.amazon.com/forums/thread.jspa?threadID=5895&tstart=0 (http://forums.developer.amazon.com/forums/thread.jspa?threadID=5895&tstart=0)
Title: Re: Amazon Echo / Alexa
Post by: Fmstrat on November 28, 2015, 08:06:18 PM
I have considered playing with this as well, especially with them on sale for $150 right now. It's looking like you would need to run your own localized server that had direct access to your HG system for this to work well.

Theoretically, the HG team "could" host a server that was used by the community, but it's not really the model for HG since it's a self-hosted open source project. A more likely scenario would be you set up your own Echo dev api and host your own server, and a guide is posted on the HG site/forum. That's similar to when I added in SSL support to the Android app and a guide for Nginx.

If I do pick up an Echo, I will be going down this road and will document things. However, it's highly unlikely I'll be doing it now, despite the sale, just due to time constraints.
Title: Re: Amazon Echo / Alexa
Post by: Fmstrat on November 28, 2015, 08:12:39 PM
As a note, when investigating Echo, I also investigated Jasper: http://jasperproject.github.io/ (http://jasperproject.github.io/)

Jasper seems like a more HG friendly method, since it's OS like HG.
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on November 29, 2015, 12:08:48 AM
if you are in US, you can get echo for around $120 and 'bad bath and beyond' with their regular store wide coupons.
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on December 11, 2015, 08:51:32 PM
I haven't tried this yet, but ifttt.com has these two channels which might combine to get some functionality
1- Alexa (https://ifttt.com/amazon_alexa (https://ifttt.com/amazon_alexa)): Say a specific phrase
2- Maker (https://ifttt.com/maker (https://ifttt.com/maker)): Make a web request

So, "Alexa, trigger lights on" could call http://<IP>/api/HomeAutomation.X10/A1/Control.On

Not sure of latency, I've seen comments say 5 seconds to 15 minutes  :o
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on December 12, 2015, 05:12:47 PM
This works!  It takes only a couple seconds in my testing so far.  I haven't gotten elaborate with various names for lights yet so I don't know how well "she" will do with multiple light names 
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on January 03, 2016, 05:18:44 PM
update.... I now have several lights and an electric fireplace all running through HG and Alexa. it works great parsing the similar verbal commands I speak.   I sometimes get a 5-15 second delay on the fireplace for some reason, others seem to react in 0-5 seconds.  also can arm the alarm and disarm by speaking a 4 digit number to Alexa(like "Alexa trigger alarm 1234"), then she calls the webapi to disarm.

only downside so far is that I have to create a new ifttt recipe for each command.... one for on, one for off, for each device.  ifttt is relatively easy to create each and paste in the webapi url, then tweak it for each.
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on March 29, 2016, 02:41:59 PM
FYI, Amazon Alexa service for Rasberry Pi 2/3 is officially available from Amazon now... https://github.com/amzn/alexa-avs-raspberry-pi
Title: Re: Amazon Echo / Alexa
Post by: nolio on March 29, 2016, 09:22:25 PM
Hi,
Nice !
You use the opensource project or the real amazon echo ?

Bye
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on March 29, 2016, 10:09:50 PM
I have been using the real Amazon echo for about 6 months. Haven't tried the Alexa on pi
Title: Re: Amazon Echo / Alexa
Post by: nolio on March 29, 2016, 10:16:34 PM
Ok, and how did you use it ?
Interaction only with homegenie ? Or with other system ?
What did amazon echo control in homegenie ?

Install on raspberry seems to be very long...
Title: Re: Amazon Echo / Alexa
Post by: kevin1 on March 30, 2016, 01:32:24 PM
We use Echo mostly for various advertised/popular features: music (pandora), weather, sports scores, jokes (they are usually funny), random wikipedia fact checks during dinner.  Obviously all things that could be done with a mobile phone.  It just works great sitting between our kitchen and living room, never have to touch it like siri, ok google or other apps on phone.

For HomeGenie integration I am still using IFTTT.  The Echo-IFTTT-HG works great from what I observe.  I have been having serious zwave issues/delays that happen regardless of using Echo or HG app/website that has made the whole smart home frustrating for me and family though.  The IFTTT method requires setting up each phrase manually as noted earlier in thread.

Currently I have on/off commands for each of 3 zwave wall light switches, on/off for fake fireplace with a zwave plugin switch, security system arm/disarm (not really using this but it works).

Would like to do but either can't or haven't set up yet:
-"alexa trigger furnace off/on/up/down" - should be easy
-"alexa trigger dinner time" - toggle basement light three times at 1Hz to alert my son (based on my zwave delays there is no way this is gonna work)
-"alexa trigger movie time" - set basement dimmer, turn on tv/etc (currently have no way to turn on tv, though thought about another arduino with IR Tx)
-"alexa trigger bed time" and she responds "all doors secured" - there is no way to make her speak phrases
Title: Re: Amazon Echo / Alexa
Post by: leonowski on April 21, 2016, 01:25:06 AM
Hello,

I just wanted to chime in on how I use Echo with homegenie.  I use software called "ha-bridge" available here:

https://github.com/bwssytems/ha-bridge

HA bridge allows you to use Echo by emulating a Philips Hue Hub.  After you get the ha-server running, it is a simple matter of the Echo discovering the device.

To integrate it with homegenie, you simply configure the ha-bridge with the homegenie API endpoints.  A screenshot of that looks like this:

https://dl.dropboxusercontent.com/u/47573266/habridge.png

This way, you don't have to rely on an external service like IFTTT.  Also, it is very fast.
Title: Re: Amazon Echo / Alexa
Post by: HGexperimenter on July 02, 2016, 01:05:21 AM
I use FAUXMO that runs on the Raspberry Pi and it is small and works to interface the Amazon Echo to HomeGenie using API commands.

Here's the github link:
https://github.com/makermusings/fauxmo

It runs as a fake WeMo and calls an API for on/off.

Title: Re: Amazon Echo / Alexa
Post by: glitch007 on July 14, 2016, 04:05:36 PM
https://github.com/bwssytems/ha-bridge
A screenshot of that looks like this:

https://dl.dropboxusercontent.com/u/47573266/habridge.png
This way, you don't have to rely on an external service like IFTTT.  Also, it is very fast.

Thanks so much for this, I was able to get this working on my setup!
Title: Re: Amazon Echo / Alexa
Post by: chandan on July 17, 2016, 09:08:01 AM
Likewise. ha-bridge with Echo came up effortlessly. Thanks.
Title: Re: Amazon Echo / Alexa
Post by: Bitcraze on July 22, 2016, 12:52:28 PM
Hi, all

Same here: Using ha-bridge with Echo. Works great!
Title: Re: Amazon Echo / Alexa
Post by: [email protected]wallis2000.co.uk on October 07, 2016, 12:27:44 PM
To add a bit more to this I have taken the port of the C# HA bridge for the echo and converted it to work with homegenie..

It does away with deviceconfg.txt and dynamically gets the modules from the homegenie API..

it's currently a console app with some very crude code whilst I got it working, next step is to port to an interface and see if I can also lower the target framework version.

Its currently located here: https://github.com/davidwallis3101/HomegenieEchoBridge (https://github.com/davidwallis3101/HomegenieEchoBridge)

Hopefully I'll be allowed on the computer this weekend and able to do a little more.

Cheers

David
Title: Re: Amazon Echo / Alexa
Post by: [email protected] on October 11, 2016, 10:10:47 AM
Got this working as an interface yesterday. One limitation is that you need to disable UPNP currently as the existing service grabs port 1900..so the SSDP service can't bind to the port.

I did try adding another interface eth0:1 however the service seems to bind to all IP's so that was a no go..

You only need SSDP running to discover devices, so it might be possible to make it configurable so you can manually start ssdp whilst you discover, or make it stop once discovery is complete - at the moment I don't need UPNP on my homegenie box so I disabled it.

I cocked up the code on github when I was refactoring it, so I will re-push the working repo from home later and publish the .zip to the app contributions repo.

Cheers

David
Title: Re: Amazon Echo / Alexa
Post by: KaZe on October 12, 2016, 01:41:42 PM
Got this working as an interface yesterday. One limitation is that you need to disable UPNP currently as the existing service grabs port 1900..so the SSDP service can't bind to the port.

I did try adding another interface eth0:1 however the service seems to bind to all IP's so that was a no go..

You only need SSDP running to discover devices, so it might be possible to make it configurable so you can manually start ssdp whilst you discover, or make it stop once discovery is complete - at the moment I don't need UPNP on my homegenie box so I disabled it.

I cocked up the code on github when I was refactoring it, so I will re-push the working repo from home later and publish the .zip to the app contributions repo.

Cheers

David

Thanks for your work!
I preorder The amazon Echo Dot 2nd gen yesterday. If I get, I will try!
Title: Re: Amazon Echo / Alexa
Post by: mvdarend on October 12, 2016, 04:11:26 PM
Damn... now I want one too, but they don't ship the Echo to the Netherlands :(
Title: Re: Amazon Echo / Alexa
Post by: Bitcraze on October 12, 2016, 05:01:21 PM
Hi, mvdarend

If you really want to buy an Echo delivered to the Netherlands:

1) Create a free 3rd party delivery box at ShipTo, or Viabox, or USABox. I read some dodgy remarks about Viabox, but I used them and received my Amazon Echo in South Africa.
2) Create a free Amazon account, with the above address
3) Not sure, but Amazon had a free Amazon Prime trial for a Month. This gives you free delivery from Amazon to your American box address. You can cancel you Prime thereafter.


Note: The 2nd Gen Echo Dot is half price currently!
Title: Re: Amazon Echo / Alexa
Post by: [email protected] on October 13, 2016, 11:31:20 AM
http://www.homegenie.it/forum/index.php?topic=1715.0 (http://www.homegenie.it/forum/index.php?topic=1715.0)
Title: Re: Amazon Echo / Alexa
Post by: mvdarend on October 13, 2016, 11:39:20 AM
If you really want to buy an Echo delivered to the Netherlands:
Thanks Bitcraze, I've always been wary of those 3rd party delivery guys. I'm thinking of getting one via Ebay, there's a few UK sellers shipping them to the mainland. But, I'm also curious as to how good the new Google Home will be...