I have a pi4 running Volumio music player. Before I turn off the power switch (smart plug), I want to send a shutdown command to the pi to be kind to the SD card.
I’ve already set up my shared public/private key pair between HA and Volumio Pi and that works. I don’t need to enter any credentials to log into the pi from HA anymore.
I have added the following to my configuration.yaml file as a shell command.
The script appears to run when I test it directly from the script but nothing happens. The pi doesn’t shut down. I have rebooted both the pi and HA numerous times. It doesn’t look like there are any errors in the traces of the script that I can see.
You bloody genius. I was logged into my docker host machine and running all the ssh commands via VS code. I didn’t even think that it was the HA container that needed the keys setting up and needed access to the remote pi.
Thank you so much. I really had been going round and round in circles. I must have watched this guys youtube video 20 times which was really starting to grate on my nerves cos there was annoying background music too.
the -l indicates that you are providing the user then host with a space between. without the -l you can use user@host. Just in case anyone comes along to read this afterwards. -h means halt all services before shutdown. Not strictly necessary but best practice from what I’ve read.