There’s a couple of ways to discover the IP address of your Hue bridge. The simplest may be to avoid discovery and to configure your router to allocate an IP to the bridge. The downside being that it requires configuration changes if you reset/upgrade your router.
To discover the bridge based on a non-fixed IP, you can use Hue’s broker server. This requires a call that egresses from your LAN, and is dependent on an external service run by Philips. The output looks like this:
While convenient, this seems unnecessary, since there’s a perfectly decent way to discover the bridge’s IP address without exiting your network or depending on an external service.
netdis = NetworkDiscovery() netdis.scan() for dev in netdis.discover(): if (dev == 'philips_hue'):
The record for the Hue bridge looks like this:
('philips_hue', [('Philips hue (192.168.0.102)', 'http://192.168.0.102:80/')])
The base url of the bridge is present as the second element in the tuple in the device’s description, and you can concatenate any of the Hue API’s call to it safely.