Probably this:
https://www.home-assistant.io/integrations/shell_command/
This might help:
https://community.home-assistant.io/t/sshing-from-a-command-line-sensor-or-shell-command/258731