I want to run a automation in this add-on but for some reason sent commands eare not working.
This is mi automation:
alias: Test automation ssh addon
description: test
# any valid trigger, I will be executing it manually for test.
trigger:
- platform: template
value_template: '{{ states("sensor.time") == "03:00" }}'
condition: []
action:
- service: hassio.addon_stdin
data:
addon: core_ssh
input: sh /config/command-scripts/test_script.sh
mode: single
and inside test_script.sh:
#!/bin/bash
# change directory
cd config
# print data to file
ls -a > test1.txt
# close
exit
But it is not working and I donāt see any error in my logs.
Iām running home assistant core.
Hi, Marius!
I tried your options, tried others - does not work.
Finally, I just removed whole HassOS - tired of trying to make it at least as working as my HA Docker.
Some differences are critical (like absence of normal SSH), some are less critical (like glitches with HACS); also there are some small differences which make HassOS not appropriate for meā¦ OK, may be I just cannot deal with HassOS. So, I went back to HA Docker and I am quite happy with it))).
When I am on the web UI, how do I pass certain Ctrl-X commands to the shell rather than to my browser? Some work, but, for example, Ctrl-A does not (nor Ctrl-D, I donāt think).
I am trying as well to have it working. I am using the latest version of the community add-on, using Hassos 6.1 on a NUC but I have no error message and nothing happens when I submit the service: no error even if I am in debug mode in the add-onā¦
Have you configured something to make it work in configuration.yaml or in the add-on ? I have no clue whatās wrongā¦
#!/bin/bash
# get input message
input_msg="$*"
# change directory
cd ~/config
# Get HA version
ha_version=$(cat .HA_VERSION)
# if input message is empty, use default message
message=${input_msg:-"Udate config on `date +'%d-%m-%Y'` - version: $ha_version"}
# Add all files to the repository with respect to .gitignore rules
git add .
# Commit changes with message with current date stamp
git commit -m "$message"
# Uncomment next line first time
# git config core.sshCommand "ssh -i ~/.ssh/id_rsa -F /dev/null"
# Push changes towards GitHub
git push
exit
Well I have the same configuration and not working for meā¦ strangeā¦ and no error message to be able to track what is not working: I checked home-assistant.log, SSH log and system logā¦ All are OKā¦but it seems the stdin command is going nowhereā¦ Thank you for your help.
Well my configuration force me to have a password or a key for SSH (I am using version 9.0.0 of SSH and Web Terminal). So I put a password. I tried from the console but same issue, no error messageā¦
I am trying to submit a shell script (I tried yours in your first example) but even this one is not working for me.
Here is the info shared when SSH is starting:
Add-on version: 9.0.0
You are running the latest version of this add-on.
System: Home Assistant OS 6.1 (amd64 / generic-x86-64)
Home Assistant Core: 2021.7.4
Home Assistant Supervisor: 2021.06.8
Here is the log after the info I shared above
[cont-init.d] 00-banner.sh: exited 0.
[cont-init.d] 01-log-level.sh: executing...
[cont-init.d] 01-log-level.sh: exited 0.
[cont-init.d] docker.sh: executing...
[cont-init.d] docker.sh: exited 0.
[cont-init.d] mosquitto.sh: executing...
[cont-init.d] mosquitto.sh: exited 0.
[cont-init.d] mysql.sh: executing...
[cont-init.d] mysql.sh: exited 0.
[cont-init.d] ssh.sh: executing...
[13:58:10] INFO: Password is NOT in the Have I Been Pwned database! Nice!
[13:58:10] WARNING:
[13:58:10] WARNING: Logging in with a SSH password is security wise, a bad idea!
[13:58:10] WARNING: Please, consider using a public/private key pair.
[13:58:10] WARNING: What is this? https://kb.iu.edu/d/aews
[13:58:10] WARNING:
[cont-init.d] ssh.sh: exited 0.
[cont-init.d] user.sh: executing...
[13:58:11] NOTICE: Session sharing has been disabled!
[cont-init.d] user.sh: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
[13:58:11] INFO: Starting the Home Assistant STDIN service...
[13:58:11] INFO: Starting the ttyd daemon...
[13:58:11] INFO: Starting the SSH daemon...
Server listening on 0.0.0.0 port 22.
Server listening on :: port 22.
Iām not talking about addon pasword. Iām talking about autenticate with ssh inside addon console or script. At begining I used a ssh key protected with pasword. Finally I used ssh key without pasword because I never was able to make it work.
When I searched info about that I find that the problem is that addon is executed in different container and donāt have access to same files or samething like that.
Iām quite sure that the problem is related to ssh agent. Why you donāt try without password to check if it works.
I have no error message when I run the script from the terminal in HA but I am sure the script is not executed (and I have no error message) when I run it with hassio.addon_stdin (as described above) as this script should create a file, and the file is not created. I donāt understand whyā¦
I presume that the add_on āSSH and Web Terminalā is creating the environment to submit command with hassio.addon_stdin without having to configure anything within HA environment. Right ?
The add-on āSSH and Web Terminalā is starting without error or warning.
My config for the add-on "SSH and Web Terminal (V 9.0.0) is:
Hi all,
I am running my HA from an Odroid N2+. I installed the SSH & Web Terminal to change the tripping Temperature to run a cooling fan (fed from the Odroid board). The fan should go on when reaching 65 degrees Celcius (fudging way too high!) so I am trying to lower the tripping temperature via SSH. In SSH (from within HA), I type the following command echo 20000 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_temp however, I get the response āzsh: read-only file system: echo 20000 > /sys/devices/virtual/thermal/thermal_zone0/trip_point_4_tempā
I disabled the zsh to go back to bash, but the same message is shown. Any suggestions?!
Does that file exist if you do a cat /sys/devices etcā¦
When you ssh from the addin you are getting a console/ssh session in the ssh container and you probably need to do it on the host itselfā¦ if you are using HAOS you probably canāt do that