Hub reboot URL doesn't seem to work

Can you create a second "admin" account and do the reboot with that account?

@GatVlieg

I don't think you can create a second account on the hub itself.

Would you use a remote URL at the same time as you are logged into the hub though?

My Mac desktop is logged in more or less all the time.

I had not turned on user authentication, but reading this thread I thought I'd try a test.

After setting up a user and turning on authentication, I plugged this into Chrome on my local Windows machine:

http://192.168.XXX.XXX:8080/hub/reboot

This redirected me to the user credentials login screen with this URL:

http://192.168.XXX.XXX:8080/login?loginRedirect=%2Fhub%2Freboot

After entering in my credentials the hub UI popped up with URL http://192.168.XXX.XXX:8080/hub/reboot, but I get a 404 Error.

I tried re-loading on http://192.168.XXX.XXX:8080/hub/reboot but I just keep getting the 404.

Interestingly, even with authentication enabled, I can access the Hub Diagnostic Tool (http://192.168.0.102:8081) without any need to login.

Anyhow, it appears (?) that turning on user authentication disables local use of the reboot URL without passing on credentials in a cookie as with @aaiyar's confirmed method.

For anyone not using hub user authentication, I use a no-middleman solution suggested elsewhere (sorry, can't find the post at the moment):

I use @ogiewon's HTTP Momentary Switch device and set it up as a "Reboot Button":

Then you can make a rule that pushes / switches it every XX days, giving you self-contained automated reboots, as well as externally /manually available if so desired.

If the momentary reset back to the off state isn't fast enough, just change line 44 from

runIn(1, toggleOff)

which resets in 1 second to something like

runInMillis(200, toggleOff)

which shortens it to 200 milliseconds. That worked for me. It doesn't really matter because switching on or off will both result in a push event that reboots the hub.

1 Like

I had issues trying to do the soft reboot and getting the 404 error. Bobby said it was because I was logged in. Once I logged out I could do it. Is your hub not rebooting from that page because you are logged in ?

Could we use @ogiewon app there to do a shutdown VS a reboot - I guess we just change the URL path ?

I wasn't trying to reboot from the web page.

I was writing a shell script to reboot the hub from my Odroid as a weekly cron job. The shell script (execute on my Odroid) would not reboot the hub if I was logged in via the web page. The solution was to make sure I was logged out before running the shell script.

2 Likes

To: @veeceeoh and @ogiewon:
I just wanted to say "thank you!"
I was having the same problem that others were having (hub slowdown), and I saw that a reboot seemed to alleviate the issue.
I searched for "scheduled shutdown", and found this approach of using the HTTP Momentary Switch approach under the control of a rule. (It's even a simple lighting rule: Every Sunday at 4 am, do a hub reboot!)
Works great! Thanks again!

1 Like

@jtmpush18 I basically want to do what you done with the reset? can you share how you set this up? Thanks

Create a new rule:

  1. Trigger β€” Switch (momentary) turns on
  2. Action: send HTTP POST (form encoded) http://Hub_IP:8080/hub/reboot

That’s all there is to it!

2 Likes

Also, pretty certain you have to disable any login/passwords on the hub too.

2 Likes

This is correct. If one needs to maintain a login/password, then it is possible to reboot the HE externally using a script that runs on an SBC (for eg. an RPi), such as the one pasted below:

#!/bin/bash
#
he_login=hubitat_login
he_passwd=hubitat_password
#
he_ipaddr=hubitat_ip_address
cookiefile=`/bin/mktemp`
backupdir=/opt/hubitat/hubitat-backup/hubitat
backupfile=$backupdir1/$(date +%Y%m%d-%H%M).lzf
#
find $backupdir/*.lzf -mtime +5 -exec rm {} \;
curl -k -c $cookiefile -d username=$he_login -d password=$he_passwd https://$he_ipaddr/login
curl -k -sb $cookiefile https://$he_ipaddr/hub/backupDB?fileName=latest -o $backupfile
rm $cookiefile

This looks like only a backup script?

1 Like

You are correct. I pasted the wrong script!

For reboot:

Replace:

curl -k -sb $cookiefile https://$he_ipaddr/hub/backupDB?fileName=latest -o $backupfile

with

curl -k -sb $cookiefile -X POST https://$he_ipaddr/hub/reboot

And delete

backupdir=/opt/hubitat/hubitat-backup/hubitat
backupfile=$backupdir1/$(date +%Y%m%d-%H%M).lzf
#
find $backupdir/*.lzf -mtime +5 -exec rm {} \;

Do you know how to reboot from RM using the url address? I have a friend with a c5 and wemo and I would like to set a rule to reboot the hub every X days....

Thanks

@vjv

See below. The pre-requisite is that hub login security has to be turned off (under Settings -> Hub Login Security). Replace hub.ip.addr with the actual address of the hub. I don't know this for a fact, but I would bet that 127.0.0.1 (loopback address) would work.

This is the rule to reboot at 4AM every day:

49%20PM

Note that the HTTP request has to be a POST request (not an HTTP GET):

33%20PM

1 Like

Thank you! Having the security off is not an option right now, but posible when I close the open port on his network. Thanks again.

1 Like

However, I would like to state for the record, that sometimes just rebooting isn't enough.
Sometimes, you have to remain off, for say 10 minutes, and then start up again.
(This does some clearing of the zwave radio).

I do not think that this can be done pro grammatically from Hubitat, so I recommend getting a $10 WiFi outlet, and scheduling a 10 minute downtime.
P.S. Don't forget to schedule a shutdown, BEFORE turning off the power!

3 Likes

Hello, I am trying to get the URL triggered reboot to work. I am getting the Error 404 message mentioned above.

I guess that means I need to "log out" of the hub? I can't actually find where to do that... :frowning:

two questions then:

  1. is the consensus that one must not be logged in for a reboot command to work?
  2. How the heck does one log out?

Thanks!!! :slight_smile:

Are you trying to log in from the :8081 screen?