Integration with Amazon Echo
- RogueProeliator
- Posts: 2538
- Joined: Tue Nov 13, 2012 3:54 pm
- Location: Baton Rouge, LA
Re: Integration with Amazon Echo
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? 
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Integration with Amazon Echo
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.
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.
- RogueProeliator
- Posts: 2538
- Joined: Tue Nov 13, 2012 3:54 pm
- Location: Baton Rouge, LA
Re: Integration with Amazon Echo
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.
Re: Integration with Amazon Echo
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 conversationRogueProeliator wrote:Anyone have both a Hub and Echo that feels like Wireshark-ing the communication and seeing if it is possible?
Back on topic...
Sent from my iPhone using Tapatalk
Re: Integration with Amazon Echo
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
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
Indigo 2021.2
Re: Integration with Amazon Echo
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
Sent from my iPhone using Tapatalk
Re: Integration with Amazon Echo
First, to Jay... the 1900 port conflict was my issue, thank you.hdfreak wrote: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.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.
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?
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.
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Integration with Amazon Echo
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.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.
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 (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Integration with Amazon Echo
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).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.
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.
Re: Integration with Amazon Echo
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
Next, is figure out how to make this startup order automatic.
Tad
Re: Integration with Amazon Echo
Glad to hear that works, as that was my next idea. IP's inside the home are plentiful.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
Re: Integration with Amazon Echo
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: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
1. Jay produces the plugin.
2. make a simple shell script to call the python script and add it to your login items
Re: Integration with Amazon Echo
jfeger wrote:Glad to hear that works, as that was my next idea. IP's inside the home are plentiful.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
I spoke too soon. Second IP interface and address didnt help my issue
- jay (support)
- Site Admin
- Posts: 19232
- Joined: Wed Mar 19, 2008 11:52 am
- Location: Austin, Texas
- Contact:
Re: Integration with Amazon Echo
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).
Re: Integration with Amazon Echo
@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.
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.