Power loss lost rules and lost devices etc

Yesterday started making som rules and dashboards.

Tested and worked.
Then I moved the hubitat c7 /an cut the power and unplug.
And after plugging it in again all but one dashboard is gone. Also no rules.
Also some device is gone
I can redo them.

But why are they lost?

What measures should I take not to loose crucial configurstion and data?

What happens if I get a power loss?

I had expected that everything such as rules etc would be saved and not lost after they are proven working

Did you just pull the power?
If so that is why you lost any work you had just done.
Did you do a backup?
If so you can restore it.
Every day a backup is done automatically at around 2.30 am.
A bit more information is needed to give a definitive answer.

Any time you are going to remove power from your hub, shut it down cleanly. Procedure is here.

Put your C-7 on an Uninterruptible Power Supply (UPS). There are several threads in the forum discussing this.

Download a backup of your C-7’s database (Settings, Backup and Restore), save external to your hub on your computer. Procedure is here.

As for moving forward and trying to see what can be restored, it’s possible that your Database is corrupted to the point that trying to redo might not produce a reliable system. Do the following to repair your Database:

(1) backup your database, download the backup. Procedure is here. The act of backing up cleans damaged things out of the Database. Procedure is here.

(2) Do a Soft Reset (NOT a full reset). Procedure is here.

(3) restore the backup you downloaded in step (1), above. Procedure is here.

Now you can see what was lost and move forward.

The documentation has a good discussion of Care and Maintenance of your hub here. Read it.

And welcome to the Hubitat community. Sorry you had this bad experience.

1 Like

Even on a UPS wouldn't it need human intervention to shut down gracefully? If I lose power, whether from the weather or tripping a breaker, I'm not worried about my laptop, the cable modem/router, thermostats, etc.

Respectfully, you quoted me out of context.

Here, fully, is what I said:

I didn’t want to write a treatise here, just point the OP in the right direction. There are many excellent posts in the forum telling how to handle power fail events before a UPS dies. Rules and code and hardware examples are provided. There was no need for me to repeat what others have posted.

1 Like

Sorry, I guess it got me to thinking about the issue. I'll have to pursue those threads.

Thanks for a very good answer with much information.
I will read and try to learn.

I am though a little bit surprised that a gadget as the hubitat can be broken just by a powercut which can happen anytime -to bad they have not designed it in more powercut safe way.

I guess I should apart from your links also try to find a powerbank which can be charged while used.

Would be good also when moving the c7 close to zwave devices to include them
(Still not sure where to get "movable" network from but maybe a long cable would be working :slight_smile: )

Personally in the early days I used to just pull the power after taking a backup and never had any issues. It is not good practice though as it could corrupt the database.
What I will say is in the early days when pairing devices, writing rules, I took backups maybe once an hour so all my changes were saved to the database and any power cut, or mess up by me would have no affect. I also had a reference point I could go back to should I mess up.
Now I only take a backup pre and post upgrades.

2 Likes

It would have been nice to have a built-in backup power supply, but that brings another set of issues (dead/leaking batteries, extra hardware for charging) and increases costs.

This problem isn't any different than yanking a USB drive out while it is reading/writing. That is just asking for data corruption. And not much different than losing power with a desktop computer, power losses can do some pretty bad thing to those too.

And Hubitat may or may not get corrupted depending upon what it is doing, sometimes you get lucky, and sometimes it messes up everything. I have been pretty lucky, I think I have only encountered a corrupted database once in the couple years I have used this. And I don't have a battery backup myself.

But what saved me, and many others in this circumstance, is to do regular offline (downloaded to your computer) backups. I always do one before every hub firmware update. I do one before I make a bunch of changes. And I make another backup after I have made large changes. The backup files are pretty small, so it doesn't hurt to do a ton of them.

3 Likes

Now that we're into the winter, and if 2020 has taught me anything, I'm expecting a power outage any day now (surprised it didn't happen today; the snowmageddon was disappointing).

I have a current backup saved on my computer, the hub is plugged into one of the battery powered UPS modules specified in another thread, and is also plugged into my computer's APC UPS.

If I have a current backup, will that save me if the power does go out and the battery backups fail to keep it running until the power comes back on? Is it a safe idea to always restore the latest backup (assuming it's current)? If something does get corrupted on the hub, are the location the hub backups are saved to safe, or should I always use an externally backed up copy?

1 Like

Yes good for me I was just getting started so not much loss.

My idea was that the C7 could save configuration data in files or in in another way so loss of power would not be of issue - the design do not need battery.

Other things such as router, charger for EV, and other stuff with configurable data can handle power loss and start to work again.

Anyway, now I know and will be more careful with backups and probably use a power bank or apc

The hub on power up will always load the last backup.
So if you take a backup now and pull the power, NOT recommended, then that is the backup loaded. No need to go to your externally saved backup.

1 Like

How do you do that? I thought backup to hub was default once a day at a specified time.

Settings. -> backup restore -> download.

That's local, not to hub.
image

It does a backup to the hub then downloads it.

3 Likes

When you create a manual backup, it also does a hub based backup. Try it, I just did and that is what happened.

1 Like

After you have done it do a page refresh. You will see the date/time as when you have just done it.

3 Likes

I didn't know that.