Alexa-Hue Bridge Plugin (old locked topic)

Posted on
Fri Jan 15, 2016 7:28 am
nathanw offline
Posts: 153
Joined: Sep 05, 2011
Location: Boston, MA

Timeout in Alexa's discovery cache?

There seems to be some kind of timeout in the Echo's cache of discovered devices, or it wants to revalidate. If I haven't done any lighting commands in a while (hours? days? not sure), and then tell Alexa to turn on some lights, it times out talking to the fake-Hue. Sniffing the network, it seems to be redoing discovery (UDP on multicast port 1900), and if I go to the plugin and enable discovery for a few minutes, then I can re-issue the voice command (just the voice command for the lights, not commanding it to rediscover) and have it work, albeit slowly.

I realize we're all somewhat in the dark of reverse-engineering this universe, but has anyone else tripped over this, or know of any obvious cache timeouts in the UPnP advertisements?

Posted on
Fri Jan 15, 2016 10:37 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa-Hue Bridge Plugin

nathanw wrote:
There seems to be some kind of timeout in the Echo's cache of discovered devices, or it wants to revalidate


Mine's been running for over a week without that happening, though I have noticed sometimes she says something like "there was a problem blah blah" - but when that happens I just say it again and it works. UPnP advertisements are either running or they're not AFAIK - that's what the discovery process is for.

I'll make sure I try doing control every day to see if I run across that. I'd be a bit surprised since I think you have to put the Hue Hub into some kind of discoverable mode before you can discover it's devices (though I'm just guessing based on the various messages you get from Alexa - I don't actually have a Hue Hub).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Jan 16, 2016 2:43 pm
gadgetnut offline
User avatar
Posts: 137
Joined: Nov 03, 2005
Location: San Juan Islands

Re: Alexa-Hue Bridge Plugin

I found that EyeConnect (Elgato media server application) was using port 1900 and after stopping that, discovery worked fine. Having a lot of fun with this. Thanks, everyone! Any suggestions for best work around to trigger an Indigo Action Group with Alexa? :D

Posted on
Sat Jan 16, 2016 8:01 pm
gadgetnut offline
User avatar
Posts: 137
Joined: Nov 03, 2005
Location: San Juan Islands

Re: Alexa-Hue Bridge Plugin

Just wanted to share that it seems the Simple Sync service (Mac OS X software companion to iOS Simple Control for universal remote control) uses port 1900. Earlier today I installed Simple Control Skill for Amazon Echo and I'm controlling home theater and entertainment throughout the house by voice, "Alexa, tell Simple Control to Play Apple TV in the Living Room," etc., and that's working great. But afterwards Discovery was failing while trying to add new Alexa-Hue Devices. I quit Simple Sync and Alexa-Hue Discovery completed immediately, then I re-started Simple Sync. FYI: Simple Control / Amazon Echo Integration Setup Guide

Posted on
Sun Jan 17, 2016 8:45 am
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa-Hue Bridge Plugin

gadgetnut wrote:
Any suggestions for best work around to trigger an Indigo Action Group with Alexa? :D


You can use Virtual On/Off Devices to trigger action groups - one for ON and one for OFF. Not perfect, but workable given Alexa's limited home automation vocabulary.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Mon Jan 18, 2016 8:38 pm
nathanw offline
Posts: 153
Joined: Sep 05, 2011
Location: Boston, MA

Re: Alexa-Hue Bridge Plugin

Okay, 30-40 minutes after a successful round of discovery my Alexa no longer can get in touch with my devices.

Having read up on UPnP, I think the issue is that the plugin is only doing the SSDP broadcast during the discovery interval, but both that broadcast and the replies to the search have a "CACHE-CONTROL: max-age=100" header that says that the advertisement is only guaranteed valid for that long (The UPnP spec suggests a value of 1800 seconds here; I'm guessing that the Echo is substituting that value for the 100 before expiring its cache).

The real mystery is why other people don't seem to have this problem.

Other things I spotted that don't seem right:
* Every instance of this plugin is using the same UUID, which was the same one in the hueAndMe.py script. I think this is supposed to be generated by the hub/plugin, not constant across the universe.
* The whole business of not being able to listen for UDP multicast at the same time as another process feels wrong; it's *multi*cast, after all. Some application of the socket option SO_REUSEPORT might be in order, although that requires that the competing UPnP daemons also are using it - but there's a reasonable chance that they did.

I'm going to check in with my employer if I can contribute patches directly, otherwise, should I just raise issues on the github page?

Posted on
Mon Jan 18, 2016 9:09 pm
nathanw offline
Posts: 153
Joined: Sep 05, 2011
Location: Boston, MA

Re: Alexa-Hue Bridge Plugin

Following up on myself, a friend of mine with an actual Hue hub got me a packet dump, with the following salient details:
* The Hue hub does transmit its NOTIFY messages about every 50 seconds - half of the CACHE-CONTROL: max-age: 100 value, roughly as recommended by the UPnP spec (section 1.2.2).
* There are three different flavors, with different NT headers: "upnp:rootdevice", "uuid:<some uuid>", "urn:schemas-upnp-org:device:basic:1". This is also according to the spec (also section 1.2.2), I think it relates to different versions of UPnP. I'm not sure what the practical consequence of only having one of these in the plugin is.
* The UUID is in fact different from the "borrowed" one that the plugin and hueAndMe.py are using.

Posted on
Tue Jan 19, 2016 2:33 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa-Hue Bridge Plugin

nathanw wrote:
Having read up on UPnP, I think the issue is that the plugin is only doing the SSDP broadcast during the discovery interval, but both that broadcast and the replies to the search have a "CACHE-CONTROL: max-age=100" header that says that the advertisement is only guaranteed valid for that long (The UPnP spec suggests a value of 1800 seconds here; I'm guessing that the Echo is substituting that value for the 100 before expiring its cache).

The real mystery is why other people don't seem to have this problem.


I'm by no means an expert on UPnP, so you might be right.

nathanw wrote:
* Every instance of this plugin is using the same UUID, which was the same one in the hueAndMe.py script. I think this is supposed to be generated by the hub/plugin, not constant across the universe.


I briefly tried to generate a unique UUID via the uuid Python module, but it didn't seem to work. I didn't spend much time trying to figure it out though so I may have been doing something stupid.

nathanw wrote:
* The whole business of not being able to listen for UDP multicast at the same time as another process feels wrong; it's *multi*cast, after all. Some application of the socket option SO_REUSEPORT might be in order, although that requires that the competing UPnP daemons also are using it - but there's a reasonable chance that they did.


Again, not an expert, so that may solve the issue.

nathanw wrote:
I'm going to check in with my employer if I can contribute patches directly, otherwise, should I just raise issues on the github page?


I'm not going to guarantee that issues raised anywhere get addressed, at least by me. I do think adding specific coding/technical issues on Github is the best place for them. We've got our hands full with Indigo 7 so I'm not going to have a lot of time to work on it. I will accept pretty much any pull request as long as it passes a cursory glance. If someone wants to take over managing the repo that's also fine with me! To answer your question from Github, I intentionally didn't add any license or any copyrights, primarily because it's a derivative work from other sources that also don't include any license. We'll look into the appropriate action WRT licenses.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jan 31, 2016 9:10 pm
lmh@cox.net offline
Posts: 30
Joined: Mar 28, 2012

Re: Alexa-Hue Bridge Plugin--a really stupid newbie question

I'd like to download the Amazon Echo plugin, but when I go to GitHub, all I find are the individual component files, but nothing that ends in .IndigoPlugIn. I'm obviously missing something important here that is obvious to everyone else, but I didn't find any clues in the general instructions either. Any guidance would be most appreciated. Larry

Posted on
Sun Jan 31, 2016 9:23 pm
JustJack offline
Posts: 53
Joined: Feb 16, 2013
Location: Ca

Re: Alexa-Hue Bridge Plugin


Posted on
Sun Jan 31, 2016 9:46 pm
lmh@cox.net offline
Posts: 30
Joined: Mar 28, 2012

Re: Alexa-Hue Bridge Plugin

many thanks!

Posted on
Mon Feb 01, 2016 7:16 am
lmh@cox.net offline
Posts: 30
Joined: Mar 28, 2012

Re: Alexa-Hue Bridge Plugin

Sweet! Works like a charm! :D

Posted on
Wed Feb 10, 2016 8:40 pm
calamo7 offline
Posts: 4
Joined: Feb 10, 2016

Re: Alexa-Hue Bridge Plugin

HI all, let me start by saying this is one of the best additions to the server so far, is not complete but it looks very promising. I had been using the plugin successfully for the last 3 weeks without any issues for setup or discovery. Yesterday the bridge stopped working, all the devices appear offline in the Alexa app and the discovery process does't work either, all I get when asking Alexa to turn on/off any device is "That command doesn't work with that device".

I tried rebooting the mac, and the echo without luck. I'm using the latest version and as I said I never had any problems with the plugin.

Any help is appreciated. Thanks,

Posted on
Wed Feb 10, 2016 9:52 pm
gadgetnut offline
User avatar
Posts: 137
Joined: Nov 03, 2005
Location: San Juan Islands

Re: Alexa-Hue Bridge Plugin

Hi, all. Same with me. All had been working perfectly but today all devices are greyed out in the Alexa app. At the Echo, for every command Alexa responds, "That command doesn't work with that device." Boy, have I gotten lazy in the last three weeks!? Just like Jane Jetson, all of a sudden, pushing a button to control the house is just too much! :D

Posted on
Wed Feb 10, 2016 10:16 pm
jay (support) offline
Site Admin
User avatar
Posts: 18220
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Alexa-Hue Bridge Plugin

Same here. Apparently, an update to the Echo has broken the plugin. :roll:

This is the main reason we don't like to use reverse-engineered solutions. For anyone out there that has a Hue and an Echo - can you reset your device list in the Alexa app then rediscover your Hue devices? I'm trying to figure out if the Echo's Hue integration is broken in general or if something changed in the Echo's firmware that's breaking workalikes like the plugin.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 4 of 27 1, 2, 3, 4, 5, 6, 7 ... 27

Who is online

Users browsing this forum: No registered users and 8 guests