zachowj / hass-node-red

Companion Component for node-red-contrib-home-assistant-websocket to help integrate Node-RED with Home Assistant Core
MIT License
465 stars 182 forks source link

Is it possible to specify the response to a Webhook? #9

Closed mdrichardson closed 4 years ago

mdrichardson commented 4 years ago

I'm using the Node-RED webhooks to integrate HASS with DialogFlow/Google Assistant. I'd love a way to customize the Webhook Response to send DialogFlow additional information (it currently gets a generic 200 with no information, I believe).

zachowj commented 4 years ago

The responses are controlled completely by HA and they respond with a status of 200 in all cases and currently can't be changed.

# Always respond successfully to not give away if a hook exists or not.

mdrichardson commented 4 years ago

Thanks for the fast response!

Can I add this as a feature request? I'd be happy to contribute something like this in the future, but currently don't have time to learn two new codebases (hass and node-red).

zachowj commented 4 years ago

This is something that would have to be added to HA for it work as you need.

If you expose NR to the outside world you can create HTTP endpoints and have full control over the responses they send.

The webhook node was implemented so you could have webhooks in NR without having to expose NR and route them through an exposed HA instance.

mdrichardson commented 4 years ago

@zachowj Aha! I hadn't considered that. I'll go that route. Thanks!