Help needed for hassio.stdin

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.

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

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

@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?

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

thanks for your help,

i have found exactly what i need : https://community.home-assistant.io/t/add-on-hassos-ssh-port-22222-configurator/264109 + samba nas addon, just use this last one for auto mount disk at boot :wink: : https://community.home-assistant.io/t/new-addon-samba-nas-mount-external-disk-and-share-it/172193/204

2 Likes