Define a Shell Command that uses curl to call the URL. Then call the shell command in your automation’s action.
# Example configuration.yaml entry
shell_command:
call_something: curl https://www.myexternalurl.com/something
In your automation:
action:
- service: shell_command.call_something
EDIT
This assumes you are not interested in any data that may be returned by the URL. If you are then you’ll need to consider using something different, perhaps a RESTful sensor.
Hijacking the thread… I have a similar question.
I have to occasionally log on to my Home Assistant at port 3456 to refresh my Amazon token. When I log on, I enter my Amazon login credentials and I am finished. Close the browser. If the token is already current the port 3456 doesn’t exist, so I get a 404 error.
Thanks for your reply. I did try a shell command but it didn’t work. I even tried the -G (get) option. I didn’t have any errors but for some reason it did not executed the external URL. I tried the rest command instead and that worked. So my solution was:
# In configuration.yaml file
rest_command:
call_something:
url: https://www.myexternalurl.com/something
verify_ssl: false
# action In automation:
action:
- service: rest_command.call_something
It will look a lot like the example in the first post of this topic. An automation with a Time Trigger that calls a REST command. The main difference is that sometimes your rest_command will fail (because the desired port doesn’t exist) and generate an error message. I think if you add continue_on_error: true then it’ll allow the automation to finish.