Power breakdown with HA

Hi.
i have this problem when the there power breakdown with HA.
When the power comes back i cant get inside HA on my raspberry pi 3b.
nickrout suggested that my raspberry pi is staring before my dhcp server,
so i change the HA to static ip with How To: Set a Static IP on Hass.io/HassOS manuel,(before i had address reservation in my router) but still when i cut down the power to my house and pull it back again the problem stay.
i need to wait to the router to come up, pull the RP power off and then push it back in.
this is really some thing i need to fix.
any help on this?

Refael

Ideally you would have a UPS trigger your Pi to shutdown cleanly. You risk corrupting the data on your SD Card with a hard shutdown. Be sure you have good backups stored away from the card.

Unix style systems usually develop lost inodes in the filesystem when power is suddenly removed.

So, what can i do?
did anybody else have this problem, or is it just me?

Refael

You mean something like this?

Maybe you could install a small USB power bank in between the Pi and its power supply. This would keep the Pi on and hopefully make it store the network config? I would first try unplugging your router (leaving the Raspberry PI powered on) then plugging it back in and seeing if Home Assistant comes back up. If it does come back up then it may be worth installing a small power bank like I said.

how come i didnt think about doing that…?

Thanks, i’l try and report

Refael

Wouldn’t that just delay the hard shutdown? The Pi needs some indication the power has died in order to cleanly shutdown.

Also how are you then telling the Pi to power back on?
I have a small APC UPS which is great for short power outages (10-20mins) but havnt figures out a good solution for when the UPS will run out of battery…

Well if you use a big enough power bank then the Pi may just keep running throughout the power outage. I have my UPS linked into HA and usually (In Australia) the longest my power is out for is around 1 to 2 hours. Surly a Pi wouldn’t drain a power bank in that time. I may do some testing.

I have router and a few other things connected so only get 30mins max.

Crazy thing is everything is DC and the UPS is DC - the biggest power loss is conversion from UPS battery to AC then back to DC with each piece of equipments transformer.

What would be great is a DC based UPS but haven’t found anything on the market…The UPS could then last a hell of a lot longer

We have some networking gear that is connected to what they call a rectifier that acts as a UPS for the D.C. Powered equipment. Perhaps searching for a rectifier could turn up some promising results.

reporting back.
so, you right.
it’s only work with USB power bank.
question.
way cant the the pi store the network config?
i did config the pi IP as a static ip on the pi
with your How To: Set a Static IP on Hass.io/HassOS manuel
so, way cant it store it?

Thanks in advance
Refael

Any solution here?
i am thinking of two options:

  1. configure a minute delay on boot? Need to investigate how.
  2. Put a smart relay before my Pi , so after power is back, i can connect to the relay and reboot the Pi again.
    What do you think?
    br,
    Nedi