Problem with Wifi/Network on startup

If after a restart there is no immediate network connection many services fail in HA.

Especially HomeKit just doesn’t work (unavailable) until I restart HA. Pushover gives me errors as well. In fact ALL internet based things fail.

If I just restart the router while HA is running, only HomeKit stays offline.

I changed my network to a new one with Wifi, so it might be related to that.
Before it was fixing itself after some time. But now everything stays offline.

I can access the frontend using local network and cameras (HKSV) that are emulated on the same computer work (with scrypted). So this is not a general issue with network but is limited to HA.

You might be able to reproduce this by switching off the router when restarting. Even if it connects after HA started it will fail.

If I restart the router while HA runs, only HomeKit fails.

Please help…

This is ridiculous. After a fresh restart, Pushover, HomeKit all fails. Scrypted, running on the same computer works perfectly and shows the camera. Other network based software works as well. It is only software within HA that fails.

What is even worse, this seems so by design:

Should I delay the start of HA? But then how to catch a restart of the router?
Any ideas?

Also worth mentioning. The frontend is available at all times.

Which might be pointing to be an issue with internet rather than Ethernet.

hm… when this issue happens, can you check the status of the integration that are affected?
Does it help, when you reload the integration itself?

grafik

What I could imagine:
When rebooting, it will take some time before a connection has been established - but the Frontend and integrations might already be loaded.
So they cannot connect to the (not yet) established network connection.
Then, it might be, that they are not trying to reconnect automatically… after the first failure.

If reloading the integrations does work, it might be an idea to create some kind of automation that - a few seconds after the system has booted, a reload of the integrations will be triggered… This would be only a workaround, until the rootcause for this issue has been identified and maybe fixed.

Thanks, unfortunately restarting the integration is not enough.

I did find out that if I delay the start of HA by 30 seconds (15 were not enough) the issue is gone. It even works after a router restart. This is perfectly reproducible for me.

Which makes me think that there is an issue related to the network at startup. Maybe HA starts too fast and can’t handle the network properly.