I made a manual installation of HA on RPi and run HA as homeassistant user. I created new ssh key for homeassistant put public key on my other RPI (running Rasplex). I can connect and send the desired command via terminal, but not as command line switch.
- platform: command_line
switches:
plex:
command_on: ssh root@[IP] "echo 'on 0' | cec-client -s"
command_off: ssh root@[IP] "echo 'standby 0' | cec-client -s"
friendly_name: TV
The error I am getting is:
ERROR (Thread-11) [homeassistant.components.switch.command_line] Command failed: ssh root@[IP]"echo 'on 0' | cec-client -s"
I found a workaround… when I don’t have passphrase on my ssh key the command go through, but I would rather have the passphrase on my ssh key. Thanks for help.