Integration with Amazon Echo

If you have a feature you'd like to see in Indigo, post it here. Others can refine the idea if they like. Please keep each topic to one feature or a closely related set of features and don't add other unrelated requests to an existing topic. Use the Hardware Support Requests forum below to request support for some bit of hardware - but be sure to check the 3rd Party Plugins Forum first though to make sure there isn't already a plugin for it.
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Integration with Amazon Echo

Post by RogueProeliator »

You know, I wonder if it would be even better to emulate the INSTEON Hub's integration - I assume, maybe wrongly, that it would have more options and device types for control. Anyone have both a Hub and Echo that feels like Wireshark-ing the communication and seeing if it is possible? ;-)
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Integration with Amazon Echo

Post by jay (support) »

The Echo's Lighting API is what's missing device type definitions - it only knows on/off/dim at the moment. It may not have the same device count limit though.

I suspect (just an educated guess) the problem is that that the Insteon integration uses the Lighting API (the Hue and WeMo integrations don't) so when you configure the connection to the Hub it requires an OAuth login to Insteon's hosted systems, which is how it's configured (see my blog post for more details on that). So there isn't a way that you can redirect the OAuth login to one of your own making in order to "fake" the eventual connection to the hub. The other downside would be that the Echo would be talking to the Hub through Insteon's hosted system (rather than locally with the Hue) so it will react somewhat slower (which is the case for all new Lighting API skills). That last part is another educated guess given my understanding of the API.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
RogueProeliator
Posts: 2538
Joined: Tue Nov 13, 2012 3:54 pm
Location: Baton Rouge, LA

Re: Integration with Amazon Echo

Post by RogueProeliator »

Thanks for the explanation - I just kind of assumed they were talking straight with the Hub as well... bummer, but not a deal breaker. Just means more action group definitions required instead of direct device access (example: "Water the Yard" type command). Even if a fake hub integration was possible (discounting OAuth), keeping it simple and faster would be preferable to yet-another-cloud-call.
howartp
Posts: 4559
Joined: Thu Jan 09, 2014 4:43 pm
Location: West Yorkshire, UK

Re: Integration with Amazon Echo

Post by howartp »

RogueProeliator wrote:Anyone have both a Hub and Echo that feels like Wireshark-ing the communication and seeing if it is possible? ;-)
Off-topic, but I envy anyone who can interpret Wireshark plots sufficiently to reverse engineer protocols like this. I can trace communication between IPs and ports but not reassemble the conversation :-(

Back on topic...


Sent from my iPhone using Tapatalk
Redrocker
Posts: 81
Joined: Wed Jan 20, 2010 5:33 pm

Re: Integration with Amazon Echo

Post by Redrocker »

Got my echo delivered today, very cool "toy" for us automation types.

So here is my question: I'm not a coder and don't think I have the guts to try what is being discussed in this thread. That being said, can I buy an Insteon hub, and have it coexist with Indigo? I don't see why I can't use Alexa to do basic on/off/dimming until an official plugin or integration to Indigo comes to fruition.

Most of my devices are Insteon, minus plugin types such as iTunes, Pioneer and IR devices. I have an ugly script that runs status requests regularly on devices controlled by wireless wall switches. So Indigo knows "what's going on" most of the time anyways.

Is this a feasible approach to Echo integration for the time being?

Thanks,
Mark
~Mark
Indigo 2021.2
rehafer
Posts: 285
Joined: Fri Feb 08, 2013 2:50 pm

Re: Integration with Amazon Echo

Post by rehafer »

The main problem with using the Insteon Hub and Indigo is that one controller doesn't know what the other is doing. You schedule Indigo to poll devises periodically, but I've never found that a satisfactory solution.



Sent from my iPhone using Tapatalk
jfeger
Posts: 84
Joined: Wed Jan 02, 2013 12:51 am

Re: Integration with Amazon Echo

Post by jfeger »

hdfreak wrote:
jay (support) wrote:I just noticed that it's not the server port that's the problem, but there's some other process that's opening the UPNP port (1900). If you don't have multiple copies of the script running accidentally, then there's some other application on your Mac that's got that port open.
Thanks, Jay. Ended up finding Sonos desktop app that was tying up port 1900. Once I killed that and ran the script again it worked perfectly.

And thank you, John, for taking the time to write this. Amazingly simple, once I cleared port 1900.

I did try on another machine with no luck, and when I looked at port 1900 I got back this:

COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
IndigoPlu 34483 HTPC 24u IPv4 0x2d8fbecf06162865 0t0 UDP *:ssdp

And idea what plugin it is?
First, to Jay... the 1900 port conflict was my issue, thank you.

hdfreak,
My exact issue was that same process. I discovered it to be the Sonos plugin. I disabled the Sonos plugin and the script loaded perfectly. Now to see if they can coexist. :)
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Integration with Amazon Echo

Post by jay (support) »

Redrocker wrote:So here is my question: I'm not a coder and don't think I have the guts to try what is being discussed in this thread.
The hueAndMe script listed above is a very simple way of getting there - just make a few edits to the config file and start up the script.

I'm working now on turning it into a plugin that I will open source when it gets to that point. But given holiday time constraints that may not happen before the end of the year.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Integration with Amazon Echo

Post by jay (support) »

jfeger wrote:First, to Jay... the 1900 port conflict was my issue, thank you.

hdfreak,
My exact issue was that same process. I discovered it to be the Sonos plugin. I disabled the Sonos plugin and the script loaded perfectly. Now to see if they can coexist. :)
Right. UPNP requires the use of port 1900 to broadcast out available services. As with the hueAndMe script, apparently the Sonos plugin always keeps port 1900 open to broadcast it's services. Obviously, both of these can't be using the port at the same time. The approach I'm taking with the plugin is to only do the UPNP broadcast when explicitly told to do so (by selecting a menu item or executing an Action), and then only for some fixed period of time (maybe a couple of minutes or so). This is apparently what the Hue hub does as well since the Echo will tell you to press a button on the hub if it didn't find any Hue devices (that apparently puts the bridge into broadcast mode).

By limiting the amount of time spend using port 1900 to only the times when it needs to be automatically discovered, it'll make sharing the port easier. I'm not sure what the requirement for the Sonos integration is, but perhaps that's an option for that plugin as well. It doesn't appear that the UPNP discovery has to be running for the Echo integration to work once your devices have been discovered - it's only in the discovery step (when the Echo looks for Hue hubs and queries it for a list of devices) that the UPNP broadcast has to go out.
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
tadg
Posts: 29
Joined: Wed Feb 13, 2008 1:37 pm
Location: San Diego, CA

Re: Integration with Amazon Echo

Post by tadg »

I had the upnp port issue as well, but in my case it was caused by the Ubiquiti UniFi wifi management software. My solution was to add another IP address to the server, (in the network Control Panel, the little plus below the interface list). I then put this address in the hueAnMe config file so that it would only bind to this IP, started the script, then started the Unifi app, which then binds to the upnp address on all the remaining addresses.

Next, is figure out how to make this startup order automatic.

Tad
jfeger
Posts: 84
Joined: Wed Jan 02, 2013 12:51 am

Re: Integration with Amazon Echo

Post by jfeger »

tadg wrote:I had the upnp port issue as well, but in my case it was caused by the Ubiquiti UniFi wifi management software. My solution was to add another IP address to the server, (in the network Control Panel, the little plus below the interface list). I then put this address in the hueAnMe config file so that it would only bind to this IP, started the script, then started the Unifi app, which then binds to the upnp address on all the remaining addresses.

Next, is figure out how to make this startup order automatic.

Tad
Glad to hear that works, as that was my next idea. IP's inside the home are plentiful. :)
jfeger
Posts: 84
Joined: Wed Jan 02, 2013 12:51 am

Re: Integration with Amazon Echo

Post by jfeger »

tadg wrote:I had the upnp port issue as well, but in my case it was caused by the Ubiquiti UniFi wifi management software. My solution was to add another IP address to the server, (in the network Control Panel, the little plus below the interface list). I then put this address in the hueAnMe config file so that it would only bind to this IP, started the script, then started the Unifi app, which then binds to the upnp address on all the remaining addresses.

Next, is figure out how to make this startup order automatic.

Tad
When you mean make the startup order automatic, what do you mean? I assume you mean making the python script fire automatically? I see two options:

1. Jay produces the plugin. :)
2. make a simple shell script to call the python script and add it to your login items
jfeger
Posts: 84
Joined: Wed Jan 02, 2013 12:51 am

Re: Integration with Amazon Echo

Post by jfeger »

jfeger wrote:
tadg wrote:I had the upnp port issue as well, but in my case it was caused by the Ubiquiti UniFi wifi management software. My solution was to add another IP address to the server, (in the network Control Panel, the little plus below the interface list). I then put this address in the hueAnMe config file so that it would only bind to this IP, started the script, then started the Unifi app, which then binds to the upnp address on all the remaining addresses.

Next, is figure out how to make this startup order automatic.

Tad
Glad to hear that works, as that was my next idea. IP's inside the home are plentiful. :)

I spoke too soon. Second IP interface and address didnt help my issue
User avatar
jay (support)
Site Admin
Posts: 19232
Joined: Wed Mar 19, 2008 11:52 am
Location: Austin, Texas
Contact:

Re: Integration with Amazon Echo

Post by jay (support) »

I'd be quite surprised if that worked - the UPNP broadcast not only happens on a fixed port number, but also on a fixed multicast IP (which is NOT the IP you configure for the server).
Jay (Indigo Support)
Twitter | Facebook | LinkedIn
jfeger
Posts: 84
Joined: Wed Jan 02, 2013 12:51 am

Re: Integration with Amazon Echo

Post by jfeger »

@Jay,
I tend to agree. I think the quickest solution will be a solution which launches the python script in a container or slim virtual machine. I might fire up a minimalistic VM instance just to run the script. Do you think the Plugin version will have the same issue? I don't see how we get around this unless there is re-work with the SONOS plugin, as well as any other 3rd party plugin that leverages UPNP.
Post Reply

Return to “Feature Requests”