I am successfully running a docker environment with both HA and Node-Red in containers.
HA is configured in Host networking mode whilst all the others are in bridged mode.
The HA instance shares the same IP as the host in my case 192.168.0.5, whilst all the other containers have their own 172.x.x.x IP addresses.
Node-red is configured to connect to 192.168.0.5.
The problem I face is that if my modem/router goes down the host looses it’s IP address as these are provided through DHCP (although that are statically assigned at the router) and HA cannot be access from Node-red through the IP address.
Is there a way the HA instance can be accessed through other means (127.0.0.1 or localhost don’t work) ?
The easiest solution would be to statically set the IP address on the host, but failing that, either try using a DNS name or increase the lease time on the DHCP Server?
The modem/router goes down probably twice a month on average, but needs power cycling and conveniently at the times when I’m physically not around. I intend to use a Z-wave power switch to restart the router through a Node-Red automation.
One possible option is to try and implement this particular automation in HA, but would like it to be a little more complex than simply pining some website and restarting if a response is not received. I want to use counters and some rate limiting to ensure the router is not unnecessarily restarted.
Static IP seems to be the best option. However, can static IP’s be used alongside DHCP if the addresses fall outside of the address pool ?.. e.g. DHCP address pool is between 192.168.0.100 to 192.168.0.254. Anything below .100 can static ?