If I run this script manually (in the SSH Terminal add-on), everything works great. If I run it through HA under Developer Tools > Services, it fails
I just had something similar happen trying to execute a shell_command to reboot a pi. It would execute from the command line but nowhere else. I was getting a 255 error in the HA server logs when running outside the command line, though.
I had to add keys to /config/ssh and then specify that location when calling the shell command. IIRC terminal uses /root/.ssh but HA doesn’t. I also needed the community version of ssh vs the addon version of ssh.
My shell_command looks like this:
shell_command:
restart14: ssh -i /config/ssh/id_rsa [email protected] sudo shutdown -r
Thread I got my answer from