Hub shut down rule with Router down question, Hub will still have DC power temporarily

Im thinking of a way to shutdown hub if AC power goes out using rule machine. This will be a case where AC drops out and i have a few minutes of dc power running the hub. Network will be down when power goes out. This is to prevent hub hard shutdown with power outage

Will this RM Action require the router to be up to work?
Send POST to: http://192.168.xx.xxx:8080/hub/shutdown

And when the hub DC power is restored will it boot back up?

Need to figure an AC outage trigger, but not there yet.

Could you use localhost or 127.0.0.1 instead of the IP?

This works: [DRIVER] Zooz ZAC38 Range Extender (and Power Outage Monitor)

I looked at this some time ago. I have dashboards running Fully and noticed that if you enable mqtt in Fully, it reports whether the device is running on power:

Screenshot 2023-12-29 at 14.39.23

I was going to use that "isPlugged" = true to trigger a Hubitat Virtual switch using node-red. I never did work out how to extract that info from the payload and use it though...

I thought that might be easier than rigging up a device to do it (there's a post somewhere on the forum where someone has made up a small case with a 5V PSU, relay and z device with external input)

Send the POST action to http://127.0.0.1:8080/hub/shutdown

There are rare situations where using an assigned IP address will not work. But the loopback address (127.0.0.1) will always work.

@jtp10181 got you covered there ....

No, to restart after a shutdown command, power must be cut and reapplied, for this I use a Sonoff USB wifi switch, versus walking all the way to the basement(of course assumes WiFi is up)

KASA wifi switches are a good solution and what i use for this as they come back up to last state on power restore and can be used in their app outside of hubitat to remove and repower (reboot) your hubitat.