I can’t get it working to trigger a custom python script with an command line parameter via a shell_command. I’m always getting errors like this, but I can’t find any help what it means:
I’m using the home assistant docker container. When I try to execute the script from within the container it is working properly. For example like this:
If you are using docker, your home-assistant folder is in /config, so you should use
/config/python_scripts/my_script.py
as the path to the script file. The cli inside the docker container cannot see outside of the container, it only sees the /config folder which is mapped to the /home/home-assistant folder on your host when you start the container.
I receive the data from a telegram command and it is working if I e.g. just send it back via telegram, so the data is contained in the variable, but somehow it cant be passed to the script. The log just says:
If I send e.g. “/mycommand 2” via telegram, I get back “Test 2”, so the variable is working fine. If I use the out commented shell script call, the 3,9 is also sent properly to the script. But the usage with “data_template” is not working.
fixed it! Since I received the proper value in the “debugging” message I didn’t look into it further. I once even tried casting it to a string but that didn’t help.
But great that it works now, thanks.