Hi, I want to know if it is possible to trigger a action by pressing a URL to trigger a action.
For example, I trigger a notification with PushOver that contains a link. Pressing this link triggers my action. I can choose not to trigger the action by ignoring the notification.
I am terribly sorry. I totally blanked out there. You can’t at the moment start an action with a simple link. That is because your browser makes a HTTP GET request. But the API for domains and services only allows POST requests.
I don’t know about HTML5 notifications. Maybe it’s possible but as he mentioned he’s using PushOver for notifications and with that I don’t see any solution. Except maybe using an external service like http://get-to-post.nickj.org/ or this http://gettopost.altervista.org/ BUT this would include you exposing your API password to a third party! Therefor I do NOT recommend this.
The use case I am interested is providing a link to tradesmen to (say) open my garage door. A JWT that expires in 24 hours would be ideal. I guess if HA only responds to posts, one could create another page (outside of HA) that uses the provided token in an AJAX POST.
Now that I’ve read the API documentation you couldn’t use AJAX as your password would be in cleartext in the JS - so you’d have to do it with some server side code
I realize this is quite old an thread, but I couldn’t find any more recent info. I’ve done a crude php script that interacts directly with a ESPHome node as my HA setup is still on the thinking stage.
my ESPHome node only needs one trigger to pulse the relay for the programmed 3500ms and release automatically, but the curl call could trigger anything including HA API.
I’d love to see something more integrated in the interface for generating tokens and templates for sending them via email or even text, copy/paste at a minimum.