I like to trigger python scripts using webhooks. I’ve done it in the past with IFTTT and webcore on smartthings. I was surprised that I couldn’t find anything about sending webhooks on home assistant…just tons on receiving.
I don’t see webhook as an action in the UI. Am I missing something?
Similar situation here…
I need to trigger some macros in MacroDroid app and can’t find a way to send the webhooks from HA.
I hope there is something new about this!
Then go into automations. Select a trigger. Then in actions select call service. Put rest_command.example_request in the line there. Obviously name it what you want rather than example request in both the config and automation.
Thank you!
I just tested it, the code seems fine both at configuration.yaml and automations.yaml (after adjusting indentation and copying the URL generated by MacroDroid), but the macro at MacroDroid did not start. It is a simple macro, just starting an app to test the webhook. The automation debugging says that the rest_command was executed…
Do you know any simple way to test if my HA is actually sending the webhook?
@Hellis81 Maybe… Can it perform actions within the app? (e.g. press buttons in the app)
I have no idea how to use intents. Googled it for a while, but did not find anything I could understand/apply. If you have any links showing how to do it, I would be interested in trying.
I considered using MacroDroid with ClickMate, but if HA app can do the job, it would be even better.
MacroDroid is working fine - if I paste the webhook to a web browser, it opens the app. I think the issue is on HA, as even triggering the automation manually does not start the app, so I assume it is not sending the webhook.
I’m far from an expert on this but intents are (as I have understood it) kind of like you tell the phone to do something or an app can say “I did this” and everyone else can listen and say “Ok”…
If the app has an intent for this button to be pressed then it should be possible to “push” the button from HA.
The issue is to find what the command is. There is a listener in the app that can help you or you can google for “intents [app name]”.
I just remembered a third way.
You download the apk file, either from your phone via apk extractor apps or you google for the apk file.
You are not going to run the file so you don’t need to be picky about the page you find the apk on.
Then there are online services where you upload a apk and it will return all intent listeners and broadcasts the app has
I got my apk file, found the online service you mention (comdroid from UC-Berkeley), but that’s weird… Their link leads to a kind of commercial painting site. I wrote to the developer asking where would the application be hosted currently. Still waiting for an answer.
Meanwhile, searched for other ways to find these intents, but what I found is way beyond my understanding (like decompiling the code, finding manifests…)
The app I’m trying to control is MagicHome
@vondalej Thanks a lot! As you suggested, formatting was the issue.
Little details, big difference…
It was the character used for double qoutes around the url.
url: “https://URL”
versus
url: "https://URL"
I pasted it from the original software and did not notice the different characters. Now the macro starts, and my next struggle is on the MacroDroid blog, as it seems to work only if the phone is unlocked.
@Hellis81 As I’m still struggling with the control of an app, Intents are still in the game.
The developer of Comdroid replied and he dropped the project, the software is no longer available. I tried digging deeper, to find something that could tell me to what Intents MagicHome would listen.
I could open the AndroidManifest.xml for that app, and found only the following information about the intents:
You are probably right.
It seems there is nothing to control the app.
What exactly are you trying to do? What is this app and what is the app supposed to do?
I have a webhook URL that can pass a variable. I want to add the variable to the URL using a template in the automation — is there a way to dynamically change the webhook URL when the automation triggers?