here is one of my commands i use from my shell cmds
speak: /usr/bin/ssh -i /home/hass/.ssh/id_rsa [email protected] ‘/home/hass/speak.sh “”{{phrase}}""’
I have a PI in the kitchen that is connected to a speaker and it makes announcements as needed.
first step in troubleshooting would be to make sure you can execute the command from the CLI and verify it works without issue.
Your problems probably stem from the fact that the shell_command runs inside the Home Assistant container while you are testing your commands outside of it.
@ondras12345 not everyone runs HA in a container or supervised. I run mine on debian in a virtual environment.
@Presswerk65 if it works via cli then you are half way there. I would next confirm what user is starting/running home assistant. If you are indeed running in a container or supervised, you may have some other sort of issue. I can supervise my own system, so I don’t have any experience with that setup. my other thoughts are to check permissions on your .ssh directory and key files.
I run HA and node-red as root on my machine so it has permissions to access and run shell scripts in my home assistant directory (/home/hass/) two more things I would suggest, (depending on your setup) look at the HA logs or tail -f /var/log/syslog while you fire off the cmd from HA and see what it says while you are doing that.