APC Pending Shutdown Broadcast - command hub shutdown, autostart on powerfail?

Hub and key electronics protected by large APC UPS.

USE CASE #1 -
There is the ability for devices to subscribe to broadcast messages to command a shutdown.

USE CASE #2 -
And it would be great if the hub would reboot on restoration of power.

Are either of these use cases supported? via existing apps? feasible to implement? (is there a graceful shutdown api? is there a way to have the hub restart on power restoration (assuming a graceful shutdown)?

Remote site -- need the hub to play nice with Mother Nature.

1 Like

This would be a good feature to have so the hub shuts down correctly. My UPS is hooked up to my NAS which can broadcast shutdown via Network UPS Tools. I have a WinNUT client on a PC that listens for this and it shuts down. It would be awesome if HE could include the network UPS client as well.

The hub does automatically boot when it's powered on. Does it not boot for you if it's not shut down properly? I've only had to just pull the plug once, and when I plugged it back in, it booted just fine, all by its lonesome.

I would also love an external graceful shutdown command.
Most of my other kit shuts down via the UPS commands (in my case APC)

Even something like http://hubitat/shutdown

The ability to remotely reboot or shutdown would be really useful

Andy

1 Like

I have two HE's in transit, due to arrive tomorrow. Good to see it boots on power.

You can do this now:

http://<ip address>/hub/shutdown

and

http://<ip address>/hub/reboot

The hub does start up on power on. Takes a couple of minutes.

7 Likes

Insane -- awesome. thanks.

Anybody know how to execute, say, the reboot command, via RM and WebCore? Would like to know both...

Couldn't figure RM out at all, and keep getting a "connection refused" with WC

Thanks
J

In my previous testing...if you are sending this url where it originates from the hub itself (eg through a smartapp) you need to use port 8080.

I have used a personal version of @ogiewon's http driver and do a http get to the following:
uri: "http://youhubip:8080",
path: "/hub/reboot"

Works for me

2 Likes

Here's the driver.

1 Like

I'll try next, but issuing the reboot command works just fine "as is" via a web browser...; no 8080 required. Just tested via a browser & you're right, 8080 is also accepted & the bub reboots...

Thanks
J

Edit: Adding 8080 to the WC piston also works!

Yes.. via the web browser would work either way because it originates externally from the hub. If you use a smartapp, it originates from the hub itself and doesn't seem to work with port 80.

1 Like

I'm sure I'm in a severe minority here, but just in case anyone else also likes PowerShell, this command works nicely ...

Invoke-WebRequest  -Uri "http://[hub-IP]/hub/shutdown" -Method Get
2 Likes

Awesome. There are so many ways to approach this..it's one of the great benefits of Hubitat using a web interface for device management. We could probably open a separate "Post your Hubitat URL Hacks Here" thread.

We also have to keep in mind that if/when the Hubitat team ever implements the much requested https/password protected interface, some of these approaches may not work or will at least need to be modified.

1 Like

I hope there's an option for non-secure on a local network. Just today, I learned about the non-secure port on Sonos to check ifconfig and turn off the WiFi. So even though connection is secure, there's still non-secure access for admin.

Quite true, the PS cmdlets support passing credentials so hopefully would be straightforward to adapt.

If the hub is been powered off because imminent power failure but then the power is not actually cut off, is there any way to turn it on? i.e. via UDP Wake On Lan?

As far as I know, there is no WOL option for this hub. The only way to turn it on after it has been shutdown is to remove power and reapply power. If you have a wifi smartplug you could turn it off and on again. The hub should boot up.

1 Like

Just a heads up, if anyone is using the paths /hub/reboot or /hub/shutdown these routes will be going away in the next release as GET requests.

You will need to change your request to a POST. This will mean that you will not be able to directly call /hub/reboot or /hub/shutdown directly from a browser url.

2 Likes

So what is the new syntax to accomplish this now?