jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
196 stars 48 forks source link

Event IP address updated to internal IP when running hassio in docker swarm #124

Closed FredeEB closed 3 years ago

FredeEB commented 3 years ago

https://github.com/jason0x43/hacs-hubitat/blob/0bc1e646863ea7c3ee25deec502aa7fe716d16ac/custom_components/hubitat/device.py#L247-L254

The above is causing me a lot of trouble keeping the event server at a fixed IP address. The reason is that my hassio instance is running in a docker swarm, and as such i would assume it gets its internal interface and matching IP address and pushes that to the hubitat. This is undesirable as that IP is unreachable outside of the swarm, making the update invalidate the correct IP address.

jason0x43 commented 3 years ago

The code above should, ideally, be setting the server URL to the value set in the integration options rather than the IP of the internal interface (which is the default). Is this not happening?

FredeEB commented 3 years ago

The issue might be from somewhere else, but I've observed it everytime i reload the plugin in Hassio. Upon reloading, it resets the POST address in Hubitat, to the local IP of the docker container (172.19.0.something) but that address is not reachable from the outside, which means that Hassio of course doesn't get the state change from the hubitat.

To be fair, this is only a minor inconvenience, as it only happens on reload, and once you update the IP to the physical address of the Docker Host it works like a charm

jason0x43 commented 3 years ago

Have you set the IP and port to a known value in the configuration options? For example,

Screen Shot 2021-07-24 at 11 25 21 AM

The integration will always update the endpoint in Hubitat, either to the IP of local interface or to the manually specified value in the integration config.

FredeEB commented 3 years ago

I have no idea how I missed that.... That's on me