peter-murray / node-hue-api

Node.js Library for interacting with the Philips Hue Bridge and Lights
Apache License 2.0
1.18k stars 144 forks source link

mDNS Discovery #221

Closed drewterry closed 2 years ago

drewterry commented 2 years ago

According to Hue documentation%20used%20to%20be%20available%20as%20another%20discovery%20method%20but%20has%20been%20deprecated%20in%20favor%20of%20mDNS%20and%20will%20be%20disabled%20in%20Q2%202022) uPNP discovery will be discontinued Q2 2022 (now). Is there a way to do this with node-hue-api?

NOTE 1 – UPnP (or more specifically the UPnP subset Simple Service Discovery Protocol (SSDP)) used to be available as another discovery method but has been deprecated in favor of mDNS and will be disabled in Q2 2022

peter-murray commented 2 years ago

The library has supported the SSDP discovery along with the newer remote API discovery endpoint once it became available. I suspect that they will be removing this functionality from the actual bridges, and I have not successfully testing this discovery method for some time now, instead favouring the discovery endpoint myself for a while.

The existing SSDP discovery was exposed under the upnpSearch() function and the newer discovery endpoint based one was nupnpSearch()

I will look into adding support for mDNS discovery and see what is needed in that space.

peter-murray commented 2 years ago

Just an update, I have added mDNS locally to the library, but really not getting reliable of fast results inside my network when using it in practice. I will continue to work on this due to the problems with the rate limiting on the discovery endpoint as this is also impacting my test suites.

peter-murray commented 2 years ago

I have just released version 5.0.0-beta.14 to npm registry, it includes a new discovery.mdnsSearch(), which at long last appears to be reliable on my network, please check it out and report back any issues or problems.

pindab0ter commented 2 years ago

I tested it today and it works great! Thanks for the update!