browetd
(Browet Didier)
July 24, 2021, 9:00pm
1
I am trying to use hassio.stdin but I can’t make it work.
So what I did: I created a shell script located in “/config” called “myscript.sh”.
I would like to run that script in a ssh shell using hassio.stdin.
So I wrote the service like this (a0d7b954-ssh is my hostname for “SSH and Terminal” add-on):
service: hassio.addon_stdin
data:
addon: a0d7b954-ssh
input: "/config/myscript"
But nothing happens in SSH & Terminal log…
Maybe it is misconfigured or a misunderstanding on my side…
Any help will be appreciated.
rccoleman
(Rob Coleman)
July 26, 2021, 5:12pm
2
If your script is really called myscript.sh, then you need to call it as such, and you need to use a proper slug for the addon:
service: hassio.addon_stdin
data:
addon: a0d7b954_ssh
input: "/config/myscript.sh"
1 Like
browetd
(Browet Didier)
July 26, 2021, 5:44pm
3
Thanks, I got it to work !!! I tried so many different ways including uninstalling/installing SSH add-on… but finally it works !
service: hassio.addon_stdin
data:
addon: a0d7b954_ssh
input: "/bin/bash /config/myscript.sh"
3 Likes
Olivier974
(Electronlibre)
August 30, 2021, 8:54pm
4
@browetd
i have exactly the same problem! thanks a lot!
i put the same command that work in the terminal but doesnt work with the script (try with and without sudo) :
sudo docker container exec -it homeassistant /bin/bash
sudo mount /dev/sdb1 /media/usbstorage
what did you put in you script.sh please?
Can you help a little bit please?
browetd
(Browet Didier)
August 31, 2021, 2:47pm
5
Here is what I did (I am starting to lauch a _ini shell to be able to get the output of the command shell…
In automations, I put the following action:
- service: hassio.addon_stdin
data:
addon: a0d7b954_ssh
input: "/bin/bash /config/heatpump_off_ini.sh"
Than I have the ini shell (heatpump_off_ini.sh):
#!/bin/bash
#
#
/config/heatpump_off.sh &> /config/heatpump_off_ini.log &
and then my “command” shell (this is just to show that I am putting “/bin/bash” everywhere !):
#!/bin/bash
/config/heatpump.sh off
/config/heatpump.sh info
Hoping this will work for you…
1 Like
Olivier974
(Electronlibre)
August 31, 2021, 5:14pm
6
2 Likes
I’m sorry for reviving this but it’s exactly my problem.
I’m trying to run
action: hassio.addon_stdin
data:
addon: a0d7b954_ssh
input: "/bin/bash /config/immich_db_backup.sh"
Running /config/immich_db_backup.sh from within the SSH addon works perfect.
But running the action, nothing happens. Nothing in the logs either.
When it was working, did you see anything in the logs or anywhere?
Thanks!
browetd
(Browet Didier)
August 14, 2025, 1:23pm
8
The service “hassio.addon_stdin” has been removed a (very) long time ago… I am using now shell commands… Examples, the first one is obvious, you submit a shell scripts in the HA container with the results written in a logfile, the second one is used when there is unknown commands in the HA container (like “mount”) but the procedure is running well in the terminal window:
shell_command:
delete_files: /bin/bash /config/private_shell_scripts/delete_files.sh > /config/private_logfiles/delete_files.log
rsync_mynas: ssh root@<your HA ip address> -o 'StrictHostKeyChecking=no' -i /config/.ssh/id_rsa '/bin/bash /config/private_shell_scripts/rsync_mynas_ini.sh >&/config/private_logfiles/rsync_mynas_ini.log 2>&1'
I hope this is helping… and sorry for the delay answering your question.
1 Like
HITMIK
(HITMIK)
October 3, 2025, 7:12pm
9
Hi,
I have HAOS a problem sending a shell_command.
spusti_vypln_pdf: ssh root@localhost -o 'StrictHostKeyChecking=no' -i /config/.ssh/id_rsa '/bin/bash /config/scripts/spusti_vypln_pdf.sh >&/config/spusti_vypln_pdf.log 2>&1'
I keep getting:
stdout: ""
stderr: "Permission denied, please try again.\r\nPermission denied, please try again.\r\nroot@localhost: Permission denied (publickey,password)."
returncode: 255
The script works for me manually in Advanced SSH. Any advice?
browetd
(Browet Didier)
October 5, 2025, 6:57pm
10
Are you using “Advanced SSH & Web Terminal” as add-on ?