[SOLVED] Reboot Switch (Button) on the UI?


I’m running OH2 on my Raspberry Pi3 and would like to know if it is possible to have a “Reboot” switch or button on the User Interface (UI). Currently I have an "Up Time"clock on my UI and would like to have the reboot button next to it to be able to do manual RPi reboots if the system is getting slow or none responsive.

So question is can you execute a command such as ‘Sudo Reboot Now’ from the default.Items file?

Thanx for any guidance

This was solved in:

You can, but it’s the completely wrong approach if you have problems.
Any properly setup OH Pi isn’t getting neither slow nor unresponsive.
Find your’s cause, fix it, and you won’t need to reboot any more.
Most likely and first thing I’d look at is SD corruption, there’s many threads on the forum.


Thank you mark for your response, Let me explain the issue a little further. I have had the RPi running for over 32 days with out issues while I was away on vacation and was able to check-in on the OH interface while away. However I rebooted 5 days ago and all was fine, but 2 days ago I tried to SSH in to the system to make some remote updates to the items and sitemaps but after entering the username the connection is terminated by the RPi/OH so that’s why I wondered if it is possible to have an “emergency” reboot switch on the UI for such cases where the system OH system is working but the RPi maybe has an issue and a reboot is required. Currently I’m unable to reboot remotely and not able to pull the power supply to restart the system either.

It is highly UNlikely that in case of a Pi (operating system related) problem like yours the UI (and reboot button) would have been unaffected, i.e. you would not have been able to access the UI or the reboot button would not have worked anyway. Don’t waste your efforts on this, you’ll just get disappointed.
Go debug your Pi, probably easiest is to reinstall right away with a focus on minimizing writes to SD, see here for tips.


You were correct that the UI was “Up” however no commands or system feed back was possible…I had to wait for 4 days and much asking before my other half would unplug nd re-power the Raspberry PI (she is anti home automation) :frowning:

I have to wait until monday to see if it is a problem with the CRON reboot setting that I had previously applied in the /etc/crontab:

0  2    * * 1   root    reboot

Otherwise as per your other useful thread about system stability…it could be that I have been making lots of changes to the sitemap and items defaults remotely and did not do a reboot directly afterwards to “settle” the system again.

I will know on Monday morning if the weekly reboot CRON is working.

Nothing wrong with frequent changes to items,sitemap and rules.
Certainly you needn’t reboot (you mustn’t even) after such changes.

Again, go find the reason for those hangups or better yet install from scratch.
A home automation server should be running 24/7 and if yours is properly setup, there is no need ever to reboot.

1 Like

Actually after 2.4 MQTT this reboot switch makes perfect sense. Did anyone ever create one? I’m interested, logging into putty everytime i need a remote reboot is a bit much.

No, it’s at most a sign of a bad setup of either your server or your config/rules. If it’s the server, it makes most sense to reinstall. If your system misbehaves/locks up because of your rules then the only correct answer is to fix your code. Rebooting is like fighting symptoms of an illness instead of looking for the cure.

Hi there, I kind of disagree, in the perfect world you are probably 100% correct. But this isn’t a perfect world, my OpenHab server can run for months without any issues then there might be a power spike or thunderstormy weather and the system locks up. The only solution is a reboot… Being a second home I’m more often away than at the house so I used two options, a reboot switch command and also an independent smart socket that is not integrated in to the OpenHab as well as making the pi server powered from a UPS. This works well for me and if a software reboot doesn’t clear the problem then I use the “kill switch” and power off the smart socket. It hasn’t let me down so far and my system has always been operable.

Correct, because in a perfect world, I’d ssh into it and issue a reboot manually. Takes less than 30 seconds. If you think a reboot button is a solution, I think you should focus more on why a reboot is needed. Doing a reboot, for me, is an easy-way-out technique without properly troubleshooting the actual cause. The only time I reboot my OH hardware is when I update the kernel. Otherwise, it’s up for 300+ days.

Be cautious of a “kill switch.” It’s one of the big no-no’s in any OS. That’s basically the same as having a blank try-catch

After Mqtt 2 4 anytime thing file is updated a reboot is required. Do why doesn’t this make sense?

Also discussed in [SOLVED] Feature request for paperui. (Reboot from paperui) with a possible easy(?) solution

It’s almost a year since I was talking in this thread about needing to restart (reboot) my remotely located openhabian server. In October I was over at the residence and updated OH to the latest build. Then after 3 months I was again unable to connect to SSH via putty or connect with the OH interface.

I had always thought this was OH “crashing” as it was always resolved by rebooting. Since my initial complaint above I had installed a UPS and also smart sockets that ran independently to OH so that I might be able to reboot using a third party control app. The residency suffers from frequent power glitches and these seem to cause havoc on even these smart sockets which are plugged in to the UPS and become unresponsive.

So unable to SSH into the installation (I get disconnected after entering the user name) and with no access to the OH webserver I took a look at MQTT.fx and found that I can still monitor the system and also control the OH server via MQTT. Today I set up an android MQTT dashboard to both monitor and control (publish) commands.

So it is most definitely the Linux SSH interface that is crashing and not the OH installation. Has anyone else faced this problem and is there any solution with a remote server and no SSH access to reset it?

Use node red and subscribe to a MQTT topic then use an exec node to issue a reboot command to the system

1 Like