I have created a .sh-file that works perfectly when I open the terminal, go to the directory (cd config/custom_components/nano) and run it (nano_GPIO_after_reboot.sh).
After a restart it is still working, but after a shutdown or reboot I have to go to the terminal again and run it. I therefore thought it would automatically work if I include it in configuration.yaml. I tried many different path descriptions for it like:
shell_command:
setup_gpio: ‘/bin/bash /root/config/custom_components/nano/nano_GPIO_after_reboot.sh’
but it hasn’t properly run once and keeps giving messages in the LOG-files like:
Logger: homeassistant.components.shell_command
Source: /usr/src/homeassistant/homeassistant/components/shell_command/init.py:129
integration: Shell Command (documentation, issues)
First occurred: 6:12:05 PM (1 occurrences)
Last logged: 6:12:05 PM
Error running command: /bin/bash /root/config/custom_components/nano/nano_GPIO_after_reboot.sh
, return code: 127
NoneType: None
I work with Home Assistant OS 14.1, Core: 2024.12.5 and HACS installed, and files outside the config-directory seem to be deleted or reset after a reboot. Manually starting terminal and executing the file does work.
Can anyone tell me why I cannot start bash for .sh-files from the configuration.yaml during the reboot? What am I doing wrong? Does anyone have examples how bash is working successfully from configuration.yaml for them?