Shell_command location

Hi All, I am very new to Home Assistant (and using YAML) and I am having troubles with the shell_command. I want to run a curl command and the command I have works fine in the terminal.
I use the GUI a fair bit in home assistant so I may be adding this in the wrong location.

I add the command in the following location:
Automation & Scenes, I have created a new automation and then I create a new action by clicking “Add Action” I am choosing “Fire Event” then adding in my YAML for the shell command here.
is this the correct place to add this? example of the command is below.

  runshell: >-
    curl -X POST -H
    'Content-Type: application/json'

Thank you for your help.

Hey Steven and welcome :slight_smile:
An event is … well the core of everything, since it happens on the event bus.
That’s where everything goes through, so it’s perfect for listening to events that happen:

However, you’re looking for a way to call a webhook.
This is done with a service call. You call the service rest_command.mywebhook for example.
However those service calls (please have a read through what services are here) need to be defined first.
You might want to use a RESTful Command.
To integrate this, add the configuration listed on the integration page to your configuration.yaml.
Then, after restarting Home Assistant in the server controls (Or reloading the config, this doesn’t work with all integrations):
Open your Home Assistant instance and show your server controls.
you can call this service, for example in automations.
Please have a look at all the available integrations here:

For this purpose, any REST integration might suffice. The REST Command allows you to call a URL, but you can’t work with the data that might get returned.
If, for example, you want to implement it like a switch, you could use a REST Switch.
Just search for “RESTful” in the integrations.

Hi Fedot,

Thank you for your response. I went down the pathway of using the RESTful Command and it is now working as expected.

Thank you for your help.