I would like to create a webhook automation and return data of my choosing. Custom HTTP reponse status would be a bonus.
My example use cases:
Monitoring - e.g use Uptime Kuma to monitor a sensor (or sensors) value.
CI/CD - use something like release August/ArgoCD to check installed integration versions and potentially follow up with updating integrations in HACS/Add-ons.
Use HA states to determine if a webhook call is a pass or fail.
I’m aware of the above is achievable in HA for the sake of brevity, please reach out separately if you are curious.
I’m not sure what you’re asking for here because you can do this with a webhook trigger in a “simple automation”. I say simple because it’s only a 2 or 3 step automation, parsing webhook information from a webhook trigger can be difficult if you don’t know data structures.
I’m interested in the same thing. Right now, the application that calls the webhook only gets back an HTTP 200 OK response with no additional data. It would be quite useful to be able to template some data to send back to the caller, then proceed with starting the HA automation.
Looking at the source for the webhook component, it looks like this could be possible since in __init__.py, the async_register method does take a handler parameter for generating a response. In trigger.py, the handler _handle_webhook returns None, which causes the calling method to return the HTTP 200 OK with no additional data.
My specific use case for this scenario is to send a custom text response back to the caller and execute an automation that is not communicating directly with the caller.