Schedule hub reboot at a specific time

You forgot the port 8080

2 Likes

As part of the Action of a rule, the following command executes a reboot (after a 5 minute delay):
image

Happy new year all! I don't see any resolution to the OP's underlying problem, so just wanted to note that I have the same issue - on occasion, automations respond to triggers super slow or not at all until a reboot, and then all's normal for a while...I've tried looking through logs for problems, disabling 3rd party apps, etc. but can't figure it out, so I'll be doing the regular reboot now as well :frowning:

I attempted to create a rule with the following action: (json) http://192.168.0.60:8080/hub/reboot
I left out the delay for now while testing.
I get the following error message: Error 404 ### The Page requested could not be found
What am I doing wrong? What goes in the Enter body for POST field?

Hmm... looks OK to me ...
Do you have security turned off for your hub?
(i.e. is it possible to sign into your hub without a username/password)?

I seem to remember that one recent version had a problem with POST.
Which version are you running?

This simple app handles auto reboots and security easily! it works like a charm

4 Likes

Security is enabled.

Hubitat Elevation® Platform Version
2.1.8.115

or you can reboot using curl from another computer - like an RPi.

Negative

Not sure what you're saying? That @dman2306's app doesn't work for you? Or something else?

If his app doesn't work for you, you should report the outcome/logs etc. on the thread for that app so he'll be sure to see your post and help you figure out a solution.

If that doesn't work, I'll be happy to share shell scripts that work under Linux (and maybe cygwin) to reboot the Hubitat at a specific time.

@davidgeo63

Here's a shell script you can use to reboot your Hubitat. Edit it to add your HE's IP address, login name and password. The reboot script can be scheduled via cron.

#!/bin/bash
#
he_login=hubitat_login
he_passwd=hubitat_password
he_ipaddr=hubitat_ip_address
cookiefile=`/bin/mktemp`
#
curl -k -c $cookiefile -d username=$he_login -d password=$he_passwd https://$he_ipaddr/login
curl -k -sb $cookiefile -X POST https://$he_ipaddr/hub/reboot
rm $cookiefile
2 Likes

I tried installing the rebooter app. Sure wish I could get it to work as it is very simple to use. It does not work either.

Post the log output from the app on the main thread for that app (linked above), There's no reason it shouldn't have worked. When you load the app, do you see this screen:

42%20PM

The username and password that you use should be the ones used locally for your Hubitat, and not the username/password for the Hubitat portal.

Outside of that, there isn't much to configure.

1 Like

As Aaiyar stated , the username and password are the ones you used when you you set up the Hub security under the settings tab. ALSO just as important, the username and password are CASE SENSITIVE. So watch out for capital letters. Once you set up hub security, then use that username and password and make sure in the app, you click on the option stating "security on" . Hope that helps

1 Like

@davidgeo63 I use the Hubitat Rebooter and it works. I never had a issue and you can set it for a certain day and time.

Does the IP in the code have to be modified to the IP of my hub or is that done automatically?

It uses the localhost ip 127.0.0.1, so it does not have to be modified.

1 Like

Can you think of a way to shutdown the Hub on low UPS power? I use your script to reboot my (password protected) hub's nightly from a synology NAS. But dont really know how to trigger these scripts apart from "time based".

Previously, I had a Rule Machine Rule that shutdown my hubs on <30% UPS battery remaining AND power = battery.

Can you run apcupsd on your Synology NAS (and is it connected by USB to your UPS)?

apcupsd creates a file called /etc/apcupsd/doshutdown, which is basically a shell script. You can use it to shutdown your Hubitat remotely when apcupsd says there's 10% or 15% (or whatever) battery left in the UPS.

http://www.apcupsd.org

1 Like

Would it be possible to run in a docker container?