Reboot after running out of power

Hi,
every time I go out of power, I’m no more able to log in into home assistant, and I need to restart it manually. I assume the cause (but I might be wrong) is that HA instance probably loads before the router.
Is there a way to set a delay in some config to wait a couple of minutes every time the HA gets an unexpected shut down?
Thanks.