Guys, is there any possibility to make automation that will call a command to run a Kodi from Raspbian? I tried several options in last week and nothing unfortunatelly work.
2 Likes
So after a month trying and spamming this forum (sorry) I got it figured out. For Hassio on Raspbian guide as follows:
- Open https://pimylifeup.com/raspberry-pi-ssh-keys/ and use following parts:
- Generating SSH Keys on Linux based systems
- Copying the Public Keys Manually
- Copy private key to the Hassio config directory which shoud be /usr/share/hassio/homeassistant/
- Add below to configuration.yaml in Hassio:
shell_command:
runwhateveryouwant: ssh -i /config/ssh_key -o 'StrictHostKeyChecking=no' user@host program_you_want_to_run
- Replace ssh_key by the filename of your private key
- If you are using Raspbian the default user should be pi
- Host is your ip or hostname
- -o ‘StrictHostKeyChecking=no’ command is used thanks to Tinkerer Shell Command SSH and I used if after figuring out this commands works in SSH addon of Hassio but not as shell_command component.
- Now you just call the service shell_command.runwhateveryouwant
2 Likes
Much more simple method:
From hass.io addon store install OpenSSH set ssh port for ex 22222
- Connect to hass.io by SSH create the folder for ssh keys → mkdir /config/.ssh
- ssh-keygen → enter path to save /config/.ssh/id_rsa ( without password )
- copy keys to primary system for. ex. raspbian
ssh-copy-id -i /config/.ssh/id_rsa pi@raspbian_ip
shell_command:
gammu: ssh -i /config/.ssh/id_rsa -o “StrictHostKeyChecking=no” pi@raspbian_ip gammu sendsms TEXT “123456789” -text “test”
Works after reboot, no errors !
4 Likes