Kill power when device becomes unresponsive

How I would use this
I have some devices that should be always on, but from now and then they become unresponsive. Unfortulately they are in my vacationhouse, so i can’t just walk up and pull the plug when I’m not there (when I am, it’s okay to do the reset manually).
Once my Home Assistant got unresponsive → I had to call the keyholder to do the reset.

Way to solve?
I’m thinking about using an esphome powerplug that pings my device and when it’s not responding (for a certain amount of time) it switches it of, and on again.

I’m sure those Athom powerplugs should be able to do that, either running Tasmota of ESPHome. I just haven’t got the faintest idea where to start.

Any hints to help guide me in the right direction would be appreciated.

Is it your router you are restarting to regain connectivity?