Hello sorry for question i saw is discussed a lot in forum but i cannot find answer to my problem:
1- I added
shell_command: !include shellcommand.yaml
in configuration file
2- i created shellcommand.yaml (chmod 775) with inside
iamathome: '/usr/share/hassio/homeassistant/scripts/athome.sh'
3 - created folder in homeassist named scripts
4- create athome.sh with
#!/bin/bash
/bin/rm --force /media/Data/Hassio/File_Presenza/imnotathome
/bin/touch /media/Data/Hassio/File_Presenza/iamathome
tested commands and works, they create files
5- add in script.yalm
athome:
alias: Script iamathome
sequence:
- service: shell_command.iamathome
6- script.iamathome now is present in entities
7- added to automation
- alias: ''
data: {}
service: script.iamathome
when automation run i receive this error:
Error running command: /usr/share/hassio/homeassistant/scripts/athome.sh
, return code: 127
NoneType: None
what i tried:
- run rm & touch commands with and without /bin/
- change ’ ’ to " "
- change folder where touch has to create file inside and outside hassio folder.
- put sudo before commands
- run only 1 command
but nothing change… someone can drive me to solve this? thank you.