browetd
(Browet Didier)
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)
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)
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)
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)
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)
6
2 Likes