Hi everybody,
I have this shell script below, that I can successfully run when I ssh
into my hassos
; it will work as intended, in this case, toggling audio playback on a remote linux machine.
However, when I run it through shell_command, I only get Error running command: /config/packages/cli_helper.sh "toggle_playback", return code: 255
, What do I need to change in order to make this work?
cli_helper.sh
#!/usr/bin/env bash
HOST="10.10.2.22"
USER="me"
ssh -i /root/config/security/hassos $USER@$HOST "/home/me/bin/ssh_geruest.py" "$1"
# vi: ft=bash
yaml
shell_command:
unten_arbeitszimmer_drehknopf_toggle_playback: /config/packages/cli_helper.sh "toggle_playback"
EDIT: I also had it like this unten_arbeitszimmer_drehknopf_toggle_playback: '/config/packages/cli_helper.sh "toggle_playback"'
, no difference.
Again, I positively can ssh into my machine and run this; so both the identity file and the code itself must be correct. I ssh into hassos, run this code, and audio playback will toggle on my desktop PC.
I try running this through Home Assistant itself, and I get the error above. I have this in my configuration.yaml
allowlist_external_dirs:
- "/config/security"
This directory seems to work fine as well; Home Assistant can write to it (via camera.snapshot
) and access the files there (via notify.telegram
).
These are the contents of that directory; it’s permission seem to be correct as well.
What am I missing? Thank you in advance for your help