I’m completely new to HA and YAML, so I’m trying to take some small steps. I made a small WAN IP change automation which runs a shell command on state change of my router’s wan ip sensor.
I added this to configuration.yaml to create the required service for the curl command.
shell_command:
curl_get: "curl -X GET {{ url }}"
All works fine, but when I move this to scripts.yaml, the service no longer works and I get an error in my log: [curl_get] is an invalid option for [script]
Am I supposed to format things differently when I add them to an include or is this not supposed to go in scripts.yaml?
Thanks, that makes sense. I hoped it would work via the scripts include so that I wouldn’t have to restart HA after every small addition/change. I’m still wrapping my head around what goes where and the correct terms for everything.
So if I wanted to keep my main config clean I could add a separate include to my main configuration.yaml like this?
shell_command: !include shell_commands.yaml
And inside that I just list the various commands I want to be able to call as a service: