PowerOutage, All Settings Lost

We had some extreme high winds pass thru the area yesterday that caused some power outages. And when the power did return and OH2 restarted I found that all settings/Things were missing.

I need to repair to the Hue hub to find all devices. And also re-add my ZWave controller as well. All bindings showed as installed, but all Things were missing.

I probably should get UPS some day, but just wanted to share if anyone else experiences a similar issue.

That is not expected behavior. Are you running on a board computer off of an SD card (e.g. Raspberry Pi)? Sudden power failures are known to cause problems with SD cards. A failing SD can also exhibit this losing of saved files behavior.

All those settings are persisted to the file system so something happened during the power failure to either corrupt or remove those files. FYI, they are located in userdata (/var/lib/openhab2 for apt-get installs).

I agree, not expected behavior and was very surprised by it. We lost power a few times on and off over a period of few hours due to the high winds.

But I run OH2 as a VM on Ubuntu inside an ESXi environment. So no SD card other to worry about.

And the bindings all stayed installed. Just seemed to lose all Things. And I had tried a shutdown and restart, but no luck. It was strange but not to hard to recover from. All rules, item files, etc were there. So really just need to setup Zwave controller and Hue link and most was back to normal.

All of your things are saved in /var/lib/openhab2/userdata/jsondb/org.eclipse.smarthome.core.thing.Thing.json. Automatic backups of this file are kept in /var/lib/openhab2/userdata/jsondb/backup.

I suppose it is possible that the file got corrupted during one of those power outages and since OH couldn’t read it started a new one from scratch.

If it ever happens again you should be able to recover most everything by copying the latest backup of the JSON db out of backup. You probably should do that while OH is not running, though that may not make a difference.

Note there are other JSON DB files in that folder to store other PaperUI created things (e.g. Items, automatically discovered items, etc).

Also, if you want to configuration control your UI created configs, that folder plus userdata/etc and /etc/openhab2 are the ones you want to grab.

This weekend I had half a dozen of power outages resulting in couple of Fibaro Switch 2 nodes losing the configuration. I was about to return them as I understand it is not the intended behavior and parameters should have been kept in node NVM. Then I found this thread and checked that effectively there are node configurations in the RasPi filesystem and now I am in doubt… Aren’t they completely autonomous? Doesn’t they store the configuration on themselves? Or is the controller setting them on every reconnection?