My friends oh oh moment

I have a co-worker that I talked into buying a Hubitat over SmartThings about 2 months ago. He just stated getting into RM last week after getting 2 switches and 2 motion detectors, and a couple of outlets connected. He is a really smart guy when it comes to architecture and development and has been taking it slow with home automation.

Today he was so excited to shows me the work he has done with his dashboard and the controls he set up. He said he even set up for remote rebooting of his Hubitat. I asked how did he do that, web server sending a reboot URL or VPN into his network to get to the Hubtat web page? He said he did one better, he plugged his Hubitat into one of the smart outlets and then went on to demonstrate turning it off via the dashboard.

I asked him if he ever tested it out and he said no. I then asked him how he was going to power on the Hubitat , He said just toggle the outlet. Bam it hit him that he couldn't turn it back on again because the outlet was managed by the Hubitat and he turned it off. He then stormed out of my office. I couldn't stop laughing all day today.

I haven't dared to contact his this evening to see if he got it back up and running.

4 Likes

If he had a second hub set up, he could have used that for the outlet to power the first hub and then have an outlet controlled by the first hub to power the second hub. Even so, that is a dirty shutdown and it is not good to do since it can lead to database corruption (ask me how I know). It is best to power the hub(s) with an UPS so dirty shutdowns can be avoided, at least as long as the UPS still has battery life. My UPS ran short on battery power before I could get the Hubitat shut down properly. It did cause database corruption so I ended up (with guidance from tech support) doing a factory reset which meant resetting and re-pairing all of the devices I had previously connected to it. That was not fun.

1 Like

I ca remote boot my cameras, hubitat, PC, Alarm panel interface, etc. How?
Easy
Get a IP controlled relay. I use KMTronic. You can get as many relays you want and access them from anywhere. Then you can turn off anything easy peasy without losing connectivity.

I use a WiFi smart plug for my Hubitat power. Then I can use eWeLink app to toggle the plug power for a reboot if needed in an emergency. Bingo! I also have VNC connect set up (which is awesome & FREE!) on an rPi so I can log into that machine and do a soft reset from a browser direct to the Hubitat, which is less likely to screw the hub. BINGO!

2 Likes

And so so cheap...

THB 72.96 20%OFF | US UK EU Smart Plug,WiFi Remote Control with Alexa,Timing on/off The Power,Samrt Google Home Electric Mini Socket PK SONOFF
https://s.click.aliexpress.com/e/sAuUFbLS

I feel like I have to post this (especially for new users). Restarting your hub by using a smart outlet/switch is NOT recommended. In fact, it is HIGHLY discouraged as you can corrupt your database. This should only be done as an absolute last resort (hub completely hung and reboot/shutdown URL's fail to work).

Ok...parental rant over....please resume your regularly scheduled discussion.

8 Likes

What’s funnier is he will read this and then tell you off. :slight_smile:

2 Likes

Agreed. Hence my comment "if needed in an emergency". A soft reset should always be used where possible.

1 Like

Yes soft start is best. But when your HE crashes you have no choice. This has happened to me a few times while out of town.
First I will remote into my PC then use its browser to load my HE locally. If it does not load, I close out of remote and log into my server room cam and take a look at my HE. If I see a red light, I will use KMTronic to hard boot my HE.
Works everytime, anywhere.

I would like to commend @veeceeoh and @ogiewon for the method that I use.
Based on their work, I have a device, that when pushed, does a Hub reboot.
You can find details of the http momentary switch, and the reboot variant here:

I use a simple lighting routine to schedule it once a week. I'm not sure that it makes a difference, but it makes me feel better.

1 Like

The problem with a regular reboot like this is that some apps/drivers don't respond nicely and the connection with devices gets screwed without re-running the discovery in the app and then re-initializing the devices. This is the case for Sensibo, Chromecast beta etc. So I was setting up an automatic regular reboot but it's so much hassle afterwards to reset everything that I decided to just address the hub freeze if/when it happened instead. I did notice recently someone on the forums working on some code to automatically reconnect wifi devices that change their IP or drop their connection so that will certainly help in my case once it's proven and available.

I have node-red pulling in my ups status (from a rpi running nut), then shutting down the hubitat hubs gracefully when the UPS hits low battery. Seems to work, but I thankfully haven't had to test it much.

I also have wifi plugs for an emergency reboot. On a full lockup. Unfortunately, I have had to use that one before.

1 Like

Edit: I only use the driver...and not the monitor app.

Not sure if this will work with an rpi NUT server but I can say it works perfectly with my Qnap NUT. Might be worth a look if you want to integrate directly into HE.

I use this and RM to shutdown my hub when my ups drops below 30% AND mains power is down.

I do have nut integrated into Hubitat as well - using the published user driver. Works perfectly. So your right, it can be done either way.

I've just been increasingly moving logic to external places where possible. Makes it easier since I also use home assistant. Node red is a nice middle ground that can talk to both easily.

1 Like

Huge fan myself. I use it to fill any holes in HE or for external logging. It feels like you can accomplish almost anything with it if you think creatively.

I don't use node-red, but do something very similar. The UPS is monitored using apcupsd and the Hubitat is shutdown using curl using a script called from its shutdown script.

1 Like

I have done the same thing. I have apcupsd on a PI monitoring and then I can send commands from the PI to almost any device in my home that has a websocket and web service that links to their shutdown commands.

1 Like