I have a file called cast.sh in my config directory that runs a few catt commands. I usally call it by logging in and ./cast.sh.
Is there a way to execute that with an automation?
I have a file called cast.sh in my config directory that runs a few catt commands. I usally call it by logging in and ./cast.sh.
Is there a way to execute that with an automation?
Iâve tried that. Do you have an example you could show?
Thereâs one in Shell Commandâs documentation and many more if you search the forum:
https://community.home-assistant.io/search?q=shell_command
I think OP is looking to view contents of a file. My understanding is that sheâll command captures stdout to log but it is not available via template or front end. So in that case, sheâll command not a solution. The command line sensor might be a better solution.
Thanks. Im not trying to view contents of a file. The script just runs a few catt commands. Catt is a python app that casts pages to google hubs. Or if I could run this from within HA it would help. Ive tried the examples in searching btw.
catt -d 'Bathroom Display' cast_site http://10.1.99.111:8123/lovelace/home
Aahh. Thought âcattâ was typo for âcatâ.
Youâll need to provide full path to catt command. What is HA core running on?
I havent paid attn to all the name changes. Not hassio. Regualer home assistant in docker. config is at /home/homeassistant/.homeassistant
Ive whitelisted the path and also tried with /config
when you call a script with a path how do you use the ./
Ive only used ./filename.sh from within the dir
Iâd try something like:
/home/homeassistant/.homeassistant/cast.sh
The ./ youâre talking about just means look for this in Ethernet directory youâre already in, but that wonât work from HA.
Iâd also try to drop the shell script and call the catt command directly. But again, youâll need full path to catt. Try âwhich cattâ to find.
I think your on to some thing. What do you mean by just the shell script? Just call each command without the script file? Catt is located in /usr/local/bin/catt
In the logs I see it failed with error 127âŚgoogle tells me that means it doesnt know that commandâŚso i believe your right.
How would I call that using the path Catt is in? (this is one thing I really need to learn, the PATH$ always confuses me)
I still get 127.
I whitelisted /usr/local/bin too. But since its docker isnt /usr/local/bin within that container, the container doesnt know about the hosts /usr unless its mappedâŚI guess i can try installing catt within the containerâŚthanks for helpin man
Right. Anything command line is much more complicated with Docker.
I got itâŚdef a hack but hey:) installed catt on another box, created an ssh key and put it in my config dir and then use this shell command
ssh -i ssh/id_rsa -o StrictHostKeyChecking=no [email protected] "/usr/local/bin/catt -d 'Baseme
nt display' cast_site 'http://10.1.99.111:8123/lovelace/arbos-home'"