Button to call a web Request

Hi all

I need to call a http Request with a Button like this:

type: button
  action: url
  url_path: http://test.org:1111/on.php
entity: ''
name: Elektro Öffnen
  action: url
  url_path: ''
show_state: false
show_icon: false

The mistake is: Home Assist open a new Webpage (tab) to call this command.
Is it possible to make a request without open a tab?

Thanks for help.

Create a restful command and call that from the button tap action.

1 Like

Thanks a lot!

I used this configuration to call a url I made that talks to an esp32 and closes relays to open and close my garage door:

In your configuration.yaml file, add:


Rest configuration.yaml entry

url: “
url: “

Add a card from to the dashboard, scroll to the button where it says
Need to add a custom card or just want to manually write the YAML?

Replace the text with (this is an example, change the url and name):
Button Example (Garage Open). It calls it in the background and does not open the webpage.

show_name: true
show_icon: true
type: button
name: Open Garage
action: call-service
service: rest_command.garage_up
icon: mdi:garage-open

Please format your post correctly for the forum: How to help us help you - or How to ask a good question