Input button helper to run curl command

So, I’ve just created a input_button helper - with icon - and I’ve added the entity in Lovelace in a “multiple entities” card, so it can be clicked.

Goal is when it is clicked a CURL call (command line) is done.
How can I achieve this? Do I need to add it as a script? And if so: how and how do I link the helper to the script?

Thanks!

CURL call (command line)

Do I need to add it as a script? And if so: how and how do I link the helper to the script?

Example input_button automation in the docs.

A better option might be to create a template button and put your shell command call right in the button so you don’t need a separate automation.

Eg.

template:
  - button:
      - name: "My Curl Command"
        unique_id: my_curl_command
        press:
          - service: shell_command.my_curll_command
1 Like