Hub Mesh and Reboot following Power outage

First off, I want to say that I recognize the best fix would be UPS or other backup power solutions for the 2 hubs in question. This would both fix this problem and prevent other potential problems caused by not properly shutting down the hubs before powering off.

That said, I have found a problem that I am wondering if there is a solution to.

Scenario

  1. 2 hubs successfully connected to one and other using hub mesh.
  2. 1 of the 2 hubs has security turned on and so it requires the token from it to be entered into the other hub for it to connect. (This is done and works fine.)
  3. Both hubs are set up for DHCP with reserved addresses in the router.
  4. Power outage occurs, knocking out both Hubs and the WiFi
  5. (Speculative), hubs come online before the WIFI, they are not able to get a DHCP assignment from the router and thus assume a default IP address of 169...
  6. The router comes online and so I can access each router at their standard address 192...
  7. At this point, while I can access each of them via web browser, the hub mesh connection on the unprotected hub asks for me to enter the token for 169... which is the self-assigned IP address of the protected hub.
  8. The manual solution is to reboot the protected hub (maybe also the unprotected, but that seems irrelevant). The reboot then gets the assigned 192 address and all is well again.

Question
Is there some way to programmatically recognize this situation and then reboot the protected hub?

I could do this either with hubitat's built in tools or possibly using node-red and my maker interface to discern that this situation has occurred.

Rubber Ducking Solution
While describing this, I think the solution is likely just to change from DHCP to Static IP address in the hubs. I didn't think about this initially as the option of static IP is new since the time I started being largely hands off with my hubs.

One option (there are probably better ones…) would be to have a rule that runs on hub boot-up (Use Location -> System Start as the trigger) and have it check the IP using the Hub Information Driver (See below), and initiate a reboot if it is 169…
You could use the Hub Reboot App to trigger a reboot via a button (See link below for the app).

The following driver can be used to detect the IP:

Let me know if you decide to try this and get stuck.

2 Likes