Several shell command services

Hi there,

I have a time pattern triggered automation that activates a service that is ashell command which is situated in configuration.yaml, looks like this

# Example configuration.yaml entry
shell_command:
  call_remote: curl https://www.example.com/api/

Now, is there a way to create many services with call remote, I cannot get alias to work in configuration.yaml, Something like this?

# Example configuration.yaml entry
alias: service1
shell_command:
  call_remote: curl https://www.example.com/api/

alias: service2
shell_command:
  call_remote: curl https://www.anotherexample.com/webhook/

I don’t believe shell_command supports “alias” in the same way (for example) automations do. The documentation is using the word “alias” as a placeholder for whatever you put in there.

Give the shell command a name (alias) as a variable and set the command you want to execute after the colon. e.g., alias:the shell command you want to execute.

So in your case, your alias is “call_remote”. So you could just have aliases of “service1_call_remote” and “service2_call_remote”, as in:

shell_command:
  service1_call_remote: curl https://www.example.com/api/
  service2_call_remote: curl https://www.anotherexample.com/webhook/
1 Like

Thank you! Saved me a lot of time!