I've got a few hubs. Sometimes, during development, things go awry when I least expect it, and when that happens, I canāt have the household complaining that their lights didnāt fade up in the morning because a hub crashed
For normal users, you shouldnāt need to do anything like this. But, for power users, hereās a multi-hub setup I use to keep my hubs online and reset when 500 errors occur.
Hereās the summary of how it works:
(House hub) Sends an event to the other hub every minute to say that it can read its DB
(Backup hub) Reboots other hub if no response was received in the last 6 minutes
My backup hub has two switches:
- Is written to (via the maker API) every minute as a āhealth checkā.
- (Momentary: 5s) Is written to when the House Hub has rebooted.
My house hub has a Rule that sends an Off event every minute to the Health check switch, and an On event to the Momentary switch. This is all that needs to run on this hub
On the Backup hub, two rules exist:
- (Every 6 minutes) : If (Health Check is On >> Send reboot to other hub. Pause rule.) else( Turn health check on)
- (When Momentary switch is turned on) If (other rule is paused >> resume)
This keeps my hub alive, and I figured other people may find a good use for this
I have an idea of how this could be implemented in a 1-hub setup, but havenāt gotten around to testing that yet.