""hub that has not come back after power outage""...we hear it time and time again!

The above topic is "in the HE news" again thanks to storms & hurricanes.

OK, we all know we're suppose to have HE boxes plugged in to a UPS of some sort. We know it would be even better not to depend on a UPS to last for extended hours/days and to set up some combination of the devices, drivers, apps, and rules (some community) necessary to tell when power is lost so a graceful shutdown may be achieved to avert problems (database corruption).

But...
excuse me for feeling a little bit of pre-2000 (let's be generous, say, 2015) nostalgia when I say... WASN'T THIS OUR BANE OF YESTERYEAR in computing & technology? Certainly when it comes to hardware marketed for Home where mass marketers realized the unmitigated risk & support burden from corrupted systems after power loss.

It seems there are at least three means of storing just enough power within a "next generation HE" box that wouldn't take that much real estate. I'm not talkin 5 more minutes of run time. I'm talkin... ignore EVERY POWER GULPING THING THAT CAN SAFELY BE IGNORED and shut the thing down safely. I'm guessing here... are we talking about a worst case scenario requirement of 15 seconds of power to safely suspend DB operations ???

if the #1 Priority is SHUTDOWN, quickly shutting down radios, Ethernet, and other high power consumers ought to leave enough room to get things done even within a pretty modest power budget, no?

Anyway...I'm just thinkin more and more that "runtime continuity" after power loss is in the realm of a UPS, but a safe shutdown after power loss ought to be in the realm of a consumer targeted Home Automation hub. This issue has caused problems for people since WAY back in HE time and I'm not believing that it has to anymore given the possible onboard solutions.

5 Likes

I have a lot of Linux boxes at home and at work, that supposedly maintain their data in some kind of embedded databases.

HE boxes are the only ones that I am afraid to power off from the mains supply.

4 Likes

Wasn't the underlying DB Engine replaced a few Platform releases ago? I thought one benefit of making the change was to be less power cycle sensitive.. or is my memory worse that I think it is?

2 Likes

You may be right… now I remember there was something mentioned briefly in the release notes.

But, some more light on the automatic data recovery will be appreciated.

2 Likes

Nope, not this time. Your recollection is correct.
But we likely need more bases covered in this area.

2 Likes

Well, I did some power cycling without graceful shutdowns, related to an outage I believe, and DB corruption on the C8 is still a real thing.

1 Like

The good news is you can easily backup and restore it.

1 Like

And I did.
I believe I used a cloud backup. :slight_smile:

I think there are a few aspect of this people are missing. When we think of typical x86 computers many of them have disks that have storage that is backed with capacitors to provide power for the exact thing we are talking about. I dont think this hub has anything like that for thr storage. I worked on a IBM I midrange sever for a few decades and even now they have capacitor power to protect data in cache if a power loss occurs. Even then if you do have a power pulled out from underneath it a 20 min reboot becomes a hour for cleanup and re indexing files.

Also this problem with databases is far from a last decade or last year issue. I have seen it recently with DB's being impacted by improper shutdown . I hear you all, but it isnt as simple as you might think. The easiest solution really would be a externally connected device that functions like a ups. I really wish someone made a small ups that was zwave or zigbee to talk to the hub and had the ability to restart it.

1 Like

Yeah, OK, but... look around your house, car, cell tower, highway, workplace, city, airport, etc. Things would function a whole lot less efficiently if "restoring from backup" was still the most common mode of recovery to get things operational again.

EDIT ADD: For humor sake, do note I did leave out "your broadband connection" cause obviously Xfinity/Comcast must still be reachin for those backups. LOLOL

1 Like

OK, you are talking a totally different scale of transactional database there but let's go ahead and ply that idea a bit. So yes, those disk writes have long been tidied up as you mention. Maybe we don't have the same "storage" but I would argue it's smaller and cheaper than ever....and maybe if we can't wrap up the DB transactions and close things neatly...maybe we capture the state of things such that they can be closed neatly when power returns.

I donno which is easier in this case, but I certainly wouldn't compare this to a mid-range server and transactional DB situation. I think there are LOTS of things in a hub environment that could safely just flat be IGNORED upon sensing a power problem.

And if commercial DBs are still getting corrupted by improper shutdowns in 2024 it makes me wonder if this is a sign of how sloppy the whole industry has become pumping out unfinished just-in-time solutions.

All this is anecdotal, but we have had quite a few power outages and brownouts in the past year, and specifically in the past couple months due to thunderstorms, wind storms, downed trees, and so on. The power events ranged from a flicker to hours of outages.

In my case, neither of my two hubs seem to have any ill effects from these power events. They have come right back up once the power returned time after time. The GE/Jasco light switches on the other hand have finally all died from these events.

I wonder how widespread or random this database issue really is? I am not sure there is sufficient data to draw a conclusion as to whether this is truly a significant issue from my experience, or from what others have self reported.

I wasn't trying to compare HE to the IBM I i worked on, but using it as a reference. The closer comparison is my reference to desktop SSD/NVME drives with a capacitor.

My point was it isn't a DB thing but a design and cleanup thing. I have seen many systems get the power pulled unfortunately and have almost never seen a actuall failure from it even years ago. But i know it can happen.

No matter how you look at it the solution is creative design to ensure work all work is done before power is lost. My real point was a UPS was probably the best/cheapest way to accomplish this. The problem is how much is some willing to really spend on a dedicated HE Hub UPS vs just buying the cheapest one on amazon or their local brick and morter store. That is where the idea falls flat.

2 Likes

Truth serum accepted - I have not experienced anything that I can tag to DB corruption due to power outages on two C5s. A lockup or two or three yes...but I have no way of knowing the cause for sure.

I did some accidental testing myself a few weeks back...

I read here somewhere about a battery available on Amazon that provided power WHILE charging.. which is one critical element of a UPS. I bought one and my initial testing showed it worked well. I bought two more and then found, after someone else commented, that the newer ones bobbled the output power when the input was added or removed. This causes an undesired power cycle to the Hub. Maybe my hubs just "do stuff" at some reduced rate, but I encountered no DB problem.

My setup for this battery test was to use a POE splitter that charges the battery and the battery powered the Hub. Pulling the POE cable should have 1) left the Hub powered (green led) and 2) allowed Z-Radio operations while Ethernet functions would fail. My result, for the two newest batteries was that the hubs lost power for a moment and rebooted (blue LED). I have not used the two newer batteries for anything since... but I did test all 3 batteries and that original one does not bobble the output. Doing that test put one of my production hubs at risk of a DB corruption. Testing the other two batteries put my development hubs at risk. None had a DB problem after, but I repeat, the DBs were probably not getting writes very often normally and the power cycle could have hit when the DB was "safe enough".

1 Like

@dJOS had a really good setup that had a limited run for a UPS he revised the designed for the Hubitat. I got two and they have worked really well. Thing runs the hub for like 13 hours with 2 18650 batteries the problem was cost as it was already fairly costly to produce. I dont think he made anything on it when you consider the time he put in. Thats even if there was anything after the BOM.

I wonder if someone could just take the pcb design and have a pcb company just assemble a few of them.

1 Like

I have a rule that hopefully extends the life of the TalentCell battery I've been using.
It's motive was that when I really needed it during an outage, it ran a paltry couple of hours or so.

I think full DB corruption is probably fairly rare. I have only seen it once and it was a buddies hub that i take care of for him. He was having work done on his house and ended up yanking power a few times. Finaly when he asked me to check it the hub was pretty much just stuck at the startup screen with a corrupt db message.

That said i have seen many occasions were a soft reset or now DB rebuild on reboot has fixed issues. Other the just some strange behavior nothing pointed to a issue much less a DB problem. Ultimately though the soft reset/rebuild atleast seemed to help the issue. Ofcourse that is anecdotal though.

I do think we probably make a bigger deal of it then it probably is.

2 Likes

Weird things can happen in a power outage.
Flickers from trees, voltage deviations, reclosers, etc.
The first time it happened to me on the C8 was when my power was yanked.
If I recall, no devices showed up.
I think I went right to the cloud restore, since I pay for it anyway.

The original design wasn’t mine and is open source.

I found an issue with the original release that required me to bodge on a capacity after the fact, but that appears to have been resolved for the newer version.

Yeah it’s a fairly expensive device to make, mainly because it’s really well designed with high quality components.

I think I might have broken even on the project, but TBH I don’t actually care if lost money on it. It was mostly a lot of fun and I was happy to help fill a need for the Hubitat community.

I did start working on a new version with @JohnRob but had to park it due to a run of health issues (getting older sucks!). I’m actually going into hospital tomorrow for eye surgery (strabismus surgery on my right eye). Fun! :weary:

3 Likes