I am trying to construct a webhook with form data as described on the Nabu Casa website but the documentation is a little sparse. Ultimately I want to call this webhook from Microsoft Flow. I’ve created a webhook for another automation without the form data and this works fine. I gave up on that and tried to use Postman, also failed and I’m trying curl and also failing.
This is the action YAML in my automation; I’m not sure if this is correct.
service: counter.configure
target:
entity_id: counter.annual_leave
data_template:
value: '{{trigger.data.annual_leave}}'
as there is nothing in the Nabu Casa documentation about how to add the form data to the webhook URL. I’ve tried lots of random googling and trial and error but always run into this error message;
2021-03-16 14:18:06 ERROR (MainThread) [homeassistant.components.automation.annual_leave_update] Annual Leave Update: Error executing script. Invalid data for call_service at pos 1: expected int for dictionary value @ data['value']
2021-03-16 14:18:06 ERROR (MainThread) [homeassistant.components.automation.annual_leave_update] Error while executing automation automation.annual_leave_update: expected int for dictionary value @ data['value']
The simplest call I am trying is as follows, as if I can get it working in curl, at least I have somewhere to start.
curl -X POST https://hooks.nabu.casa/my_webhook_id -d '{"annual_leave":18}'