Ok, you asked, here is my voting rule for my 6 Ring Range Extender V2 devices.
Comments:
- You need to use the driver written by Denny Page (@dennypage). At some point within the past year, the Refresh command broke for the built-in driver. The reason Refresh is needed is that, when the hub comes back up after a power fail, the “switch to mains” event from the Ring Extender will be missed because it comes back online before the hub has booted. The workaround is to have a Refresh action in your startup rule (triggered on systemStart location event). However, as noted, the Refresh command for the built-in driver broke within the past year. I sent a couple of PMs to Bryan Copeland, he said he would check on it, but he’s been busy. Switched to Denny Page’s driver, which works. Denny Page subsequently updated his driver to schedule a Refresh when the hub calls the driver’s initialize method on reboot, so the Refresh is no longer needed if you use Denny Page’s driver (installable by HPM). I believe that Jean May’s (@thebearmay’s) Hubitat Information driver has a shutdown command as well. EDIT: It does now, just added.
-
The design of these rules is subtle. They handle the “flapping” of power up/down on power fail and power recovery as the utility tries to heal the grid, and the rules are retriggered, causing concurrent triggering and execution. If you only have a single Ring Extender, it can be done much more simply. If you want more details of this subtlety, just ask.
-
There is a voting by the Ring Extenders to handle the cases of internal backup battery failure in one or more of the devices, and to handle the case of someone, accidentally or on purpose, unplugging a Ring Extender from the receptacle (to vacuum, for example, as my wife has been known to do) so that the hub only shuts down when a whole house power fail occurs.
-
You will need to install and call one of the various shutdown drivers. I use Dominick Meglio’s (@dman2306’s) Hubitat Hub Controller driver (installable by HPM).
Here are the Rules:
First, create a Hub Variable for each Ring Extender to tally whether it is on battery:
Then, create a pair of rules for each Ring Extender to monitor the mains/battery status of each Ring Extender. All Rules are the same, only the device changes.
Then, here is the Rule that does the voting and which triggers the graceful shutdown:
Finally, here is the portion of your SystemStart Rule that initializes everything:
Of course, your hub needs to be on a UPS, and the shutdown timeout in the voting rule needs to be shorter than the UPS uptime.