Hassio.addon_stdin no longer working with 2021.12?

I used to have an automation that runs a shell script at midnight to push changes to git. Some of the latest HA updates most have broken something as it no longer works.

service: hassio.addon_stdin
data:
  addon: a0d7b954_ssh
  input: /config/gitpush.sh

The script /config/gitpush.sh simply runs

#!/bin/bash
date >> /config/git-last.txt
cd /config
git add .
git status
# Commit changes with message with current date stamp
git commit -m "config files on `date +'%d-%m-%Y %H:%M:%S'`"
# Push changes towards GitHub
git push -u origin main
exit

Log file doesn’t show anything.

Original idea from https://peyanski.com/automatic-home-assistant-backup-to-github/ …

It was not HA updates that broke it.

This was clearly stated in the changelog of that add-on
https://github.com/hassio-addons/repository/blob/9d08973517f1e7cb2808e79a8518cefad859a463/ssh/CHANGELOG.md

1 Like

Thanks for the quick reply.

Nonetheless, I find it odd, that there still is a service and it doesn’t do anything :wink:

I went with Shell Command - Home Assistant instead and added the following to my configuration.yaml

shell_command:
  push_to_github: /config/gitpush.sh

So in any automation or script, I now call the service shell_command.push_to_github.

1 Like

The service is generic and can be used for other add-ons that implement stdin controls.

Hi Ludeeus,

many thanks for your help. I am traying to replace a stdin service that work with a different add-on:

  - service: hassio.addon_stdin
    data_template:
      addon: 89275b70-dss-voip
      input: {"call_sip_uri":"sip:[email protected]:5060","message_tts":"ALLARM!! Sensor XX"}

Is it possibile to use shell also for this add-on?

Many thanks in advance.

Sure!!!
You can use “run” file to create your own bash script, manage script I/O and choose a way to give feedback to HA!
…

But, I’d like to understand why?! Why you want to do this?! STDIN controls was not removed from HA but only from SSH addon! The thread in which you have asked this insane question is related to SSH and their breaking change…

ah, instead this yaml

try to use:

  - service: hassio.addon_stdin
    data_template:
      addon: 89275b70_dss_voip
      input: {"call_sip_uri":"sip:[email protected]:5060","message_tts":"ALLARM!! Sensor XX"}

minus IS NOT equivalent to UNDERSCORE

I am sorry: I have copy and paste wrong code from model editor in HA used for testing. In automation & script the addon code was correctly wrote.
I apologize for the misunderstanding in std-in link description referred to SSH add-on and not not HA.
I have used your add-oin from oldest HA release without problem: SIP client was registered on my FritzBox router that provide SIP connectivity: after HA udate to last GA rel 2021.12.10, add-on stop working: the problem was related to my google account for TTS service. I have to investigate on it.
Many thanks for your help.

base_url on Google TTS setup in your configuration.yaml. check addon docs

Bye

Hi is this still working for you? I am trying to do the same thing, even from the same original source blog and found this thread while troubleshooting.

My script works fine manually but I can’t get the shell_command.push_to_github to work in an automation.

Hi Ludeeus,

The trouble I find is that other add-ons that implement stdin controls may not run the same commands as ssh.

In particular, I have an script that runs docker commands in influxdb add-on, to generate a daily backup, and copy the backup into homeassistant docker. But neither homeassitant or influxdb containers implement docker commands, as SSH & Web Terminal add-on does.

I recently updated ssh add-on and, obviously, the script, that have been running for months, stopped working.

Any suggestion ?
Thanks and regards