Automated self check of HA?

This post in kind of in the same vein as my recent post on asking how I can check my routers for internet and wifi connectivity and then cut power to the outlets powering them if there is a problem.

Is there something similar for my the instance of HA running?

Heres the problem I am thinking could happen. I am away from the house, HA malfunctions and I am no longer able to access HA via the app on my phone. I still have internet to my house, my wifi is still up, but something happened in HA that caused it to have a hiccup.

Is there any sort of self check I can automate that if it fails, HA could restart itself?

Actually it all depends on your setup. If you are running HA OS then then the only way you to go would be to check if there is wifi connection with the router. This can be achieved by using the ping sensor and an automation which could periodically check if the router is available or not and accordingly restart the host or not.

But then again the limitation is that if the HA OS froze, this cannot be do anything.

Now if you are running supervised version of HA i,e using a docker in debian or so OS, you can write a script to check the connectivity again using ping and then restart host. see this Rebooting the Raspberry Pi when it loses wireless connection | We Work We Play . Now if only the HA crashes, the advantage is that since the debian system is independent from HA, even if HA freezes, you can log into your host remotely using VNC server or so and do the trouble shooting yourself.

The BEST method would be what you have said with the router i,e to use a smart plug running tasmota(my preference) or esphome to power your host. Both these firmwares can be programmed to ping the host device on a periodic basis and take actions if the host is unavailable. This is something that I do

What tasmota outlet would you recommend/do you use?

My outlet is something that I made myself. You could use any esp outlets that you feel comfortable with. The only difficulty is that you will have to compile tasmota firmware on yourself as the IF_conditional rule checking is not activated by default in precompiled tasmota versions but compilation can be done only with gitpod and its not a serious pain. You will also have to make rules suiting you.

If you are using esphome, except the coding part, the things are easier.