Hue component disconnects if hue bridge gets a new IP

I have noticed that if my router restarts and my hue bridge gets a new IP then Home Asisstant will not connect to it until I re-run the setup process.

In the log I see:

WARNING:homeassistant.components.light.hue:Connected to Hue at 192.168.1.3 but not registered.

But in phue.conf I see

{"192.168.1.5": {"username": "some long token here"}}

Does anybody know if it is really necessary to reauthorize with hue if only the IP address of the bridge has changed? It seems very brittle to lose access to all hue bulbs due to a simple dhcp renewal. I could assign my bridge a static IP but given that we have an automatic discovery and configuration process I think that it should be a little more robust if it can be.

How would it know it’s the same bridge?

Best way would be to check the “bridgeid” which is available on the Hue API under /config since version 1.8. This ID is also available through the webbased discovery (called “id” in the response) which is useful if local discovery does not work properly (although I am not sure if this is used by HA).

For older API versions the “mac” attribute could be used which is also available under /config from Hue API version 1.0 onwards. But this is not available on the webbased discovery.

More detailed info see Hue API http://www.developers.meethue.com/documentation/configuration-api (registration required)

Imagio,

Give the Hue a static IPadres, not a dhcp ip adres.
If you don’t know how to give the hue a static ip adres, you can do it in your router.
Give the Mac adres from your hue, IPadres reservation.