I have a KASA HS-105 wifi plug that Hubitat is plugged into. My Node-RED flow that monitors power (pinging a fixed IP device, not on a UPS), restarts HE by turning the KASA plug off and then back on. There is a KASA/TP-Link node that I use. The same flow that restarts HE also shuts down HE when power goes out.
If the UPS battery runs out, then HE will restart when power comes back on in any case.
EDIT: I don't shut down RPi, modem etc. in this process, just HE
EDIT2: The Node-RED solutions is documented here - Shutdown and restart Hub in case of power outage (Node-red solution) - LONG READ