How restart a sattelite raspberry pi from within HASS

Dear HA users,
I have several RPi’s with sensors and pass their results on to the broker (my HASS) with mqtt. Sometimes a satellite RPi loses the connection with the server. At that point I would like to reboot into this ‘remotely’. From the command line I can do this with `'ssh -i /home/pi/.ssh/ppk ‘[email protected]’ sudo reboot"
Now my question is: can I also do this from HASS (possibly in Python with appdaemon)?

My HASS is running in Docker on an RPi4

Can someone help me on my way?

This should work:

You’ll probably need to place your ssh keys somewhere in your config directory to make them available inside the container.

Example of something similar: Wake on LAN - suspending Linux.

Thank you very mutch. That was the solution !

You marked your own post as the solution but it was @ondras12345 post that provided the real solution.

you should fix that.