Power Failure Recovery

Hi,

I run Openhab 2 on a Raspberry 3 and Homematic on a CCU2 hardware. Both are tied together via the Homematic 2.0 binding. All runs well.
However, after a general power failure was resolved, both devices booted at the same time. The homematic binding wasn’t restored properly, just showing communication errors on the Openhab side, which of course might well be with both devices just coming back to live. So I restarted CCU again, after which the homematic binding in Openhab seemed to be back online properly. However it still didn’t run well, and it turned out that all the Homematic things didn’t show any channels, leaving the according items dangling and dead. Only an additional reboot of the Raspberry brought everything back to order.
So if that whole setup can’t recover itself from a powerfailure, it’ll fail to do the magic it should when we are away from home.
Is there a way to have the homematic binding more cleverly retry to regain operability after it failed on the first try? It seems like it surrenders to the initial communication errors w/o ever trying again.

Maybe not a direct answer to your question:
I have added a USP to my raspberry which both runs OPENHAB and the CCU2 in a LXC container (YAHM).
The USP is made of power battery module that can be charged and simultaneously provide power to USB ports (24 Euro).

Power failure is detected by network binding that is “pinging” my main router.

In case of power failure at least the battery power devices are still working including the homematic alarm which also contains a battery.

By the way today I had to remove the power from this setup and the CCU (emulation) and the openhab server booted correctly.

While I would still like to understand the underlying issues of CCU2 and Openhab not synchronizing properly after a common reboot, you USB solution also sounds interesting. Do you have a link to that product?

Well not really a product but also a community project.
Here is the link

The language is German but since you are using Homematic you probably have no problem with this.

Sorry, just realized you are referring to the USP.