I have the following commands in config.yaml, and I am using this object in the automatons the command is not being triggerd.
When running the curl command in crontab it works fine (i see output in the file).
Any ideas what is wrong?
shell_command:
# Command to update DDNS with public IP address
update_dns: 'curl https://freedns.afraid.org/dynamic/update.php?UUswNXgweabcdefghijk1pzOjE4Njk0MTE3 >> /tmp/freedns.log 2>/dev/null'
The shell commands in my configuration do not have the single quote marks. Donāt know if it matters, but you might try removing them. You might also try using the full path to curl, for example /usr/bin/curl ā¦
That is not from an automation that is a shell_commandā¦ you shouldnāt have the actual command in the automation it should be shell_command.your_command
As others have suggested, quoting is usually the issue with shell_command
Note that I run HomeAssistant in a venv on Ubuntu under a dedicated service account - how you are setup could affect results. I tested my commands within the venv running as the service account user before implementing, which helped resolve some permission and path issues.
what do you think of this?
Still not working do you have a simple curl command I can use (eg write something to file and then I check the file)
shell_command:
# Command to update DDNS with public IP address
update_dns: '/usr/bin/curl "https://freedns.afraid.org/dynamic/update.php?UUswNXgwekabcdefghVCY1pzOjE4Njk0MTE3" >> /tmp/freedns_com.log 2>/dev/null'
Looks like there have been some parameter changes since I last tested my send_sms shell_command - I tested this evening after making some other configuration changes and was getting some 127 errors which I traced back to the parameters in the command.
Iāve just had to modify the command line (note the quote changes) to:
I donāt use docker so I donāt know how the different containers could affect how it runsā¦ I would try putting the command you just ran as your shell command in your configā¦ wrap the entire command in single quotesā¦ restart Haā¦ the go to the services tab and choose shell_command.update_dns and press call serviceā¦ then see if you get an error and check the logs to see the details