Shell command and SSH to NUT addon

Hi All

I’m running Hommassistant os on a raspberry pi

Wonder if anyone here can help me I do not really know SSH and since hassio.addon_stdin was removed from the addon i have been stuck just manually running the below command from the terminal.

I’m using Homeassistant on a Raspberry PI

sudo docker exec addon_a0d7b954_nut upscmd -u xxx -p xxx [email protected] beeper.toggle

I use to use the following in an automantion but it does not work any more.

action:
  - service: hassio.addon_stdin
    data:
      addon: a0d7b954_ssh
      input: sh /config/boff.sh

Everywhere I look people say to use Shell_command to Call ssh but I have no idea how to do this. And what the command should look like as I have virtually no experience in SSH is there anyone here who can guide me in getting this working again it is either that or takes my pliers open the ups and break off the buzzer from the pc board lol(don’t really want to do that) :slight_smile:

I have also tried this shell command in configuration.yaml

shell_command:
  beeper_off: ssh -i /config/.ssh/id.rsa -o 'PreferredAuthentications=publickey' [email protected] -T 'bash /config/boff.sh'

But I get the following error return code: 255
The same command works in the terminal

Any help will be appreciated

I’m not sure if I understand how you are running Home Assistant on the RPI, you seem to be using Docker for your UPS monitor. Are you running HA in a Docker container?

I run HA in a Docker container and I have a couple sensors that use SSH to go out and get the data. Each time I upgrade HA, after downloading the new Docker HA image I have to do a console into the HA Docker instance (I use Portainer to manage and connect into the Docker running containers) and reinstall the ssh keys (I think I might be using a different SSH connection method), example below. Good hunting!

# must re authenticate remote ssh connections, inside console terminal in portainer:

bash-5.1#ssh -i /config/ssh_keys/id_rsa [email protected] 'cat /sys/devices/platform/applesmc.768/fan1_input'
The authenticity of host '192.168.55.12 (192.168.55.12)' can't be established.
ECDSA key fingerprint is SHA256:blahblah.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added '192.168.55.12' (ECDSA) to the list of known hosts.
2002
bash-5.1#ssh -i /config/ssh_keys/id_rsa [email protected] 'cat /sys/devices/platform/applesmc.768/fan1_input'
1999
bash-5.1#