I’m trying to setup Webhooks between qBittorrent and HA.
I have this setup as an automation / actual webhook hidden for security
alias: Media <> Movies <> Plex 12 - qBittorrent Webhook Received = DO SOMETHING
description: ""
triggers:
- trigger: webhook
allowed_methods:
- POST
- PUT
local_only: true
webhook_id: qbittorrent_example_webhook
If I fire a test Webhook from CMD Prompt (Windows) it sends OK and hits HA
curl -v POST -H "Content-Type: application/json" -d '{"message":"Hello World","test":123}' https://MY.duckdns.org:8123/api/webhook/qbittorrent_example_webhook
But I get this error in the HA Logs / and never triggers my automation
Just wondering if anyone has seen
Logger: homeassistant.components.webhook
Source: components/webhook/__init__.py:194
integration: Webhook (documentation, issues)
First occurred: 09:49:20 (13 occurrences)
Last logged: 10:29:35
Error processing webhook qbittorrent_example_webhook
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/webhook/__init__.py", line 194, in async_handle_webhook
response: Response | None = await webhook["handler"](hass, webhook_id, request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/webhook/trigger.py", line 68, in _handle_webhook
base_result["json"] = json_loads(text) if text else {}
~~~~~~~~~~^^^^^^
File "/usr/src/homeassistant/homeassistant/util/json.py", line 42, in json_loads
return orjson.loads(obj) # type:ignore[no-any-return]
~~~~~~~~~~~~^^^^^
orjson.JSONDecodeError: unexpected character: line 1 column 1 (char 0)
Interesting
OK, thanks a lot mate, I’ll keep playing and come back to you if I need to
Now I know the correct syntax, hopefully I can get it working
THANKS AGAIN MATE
Honestly, as an old age dude (58 now), I’d be lost without you guys and all your help. Thanks a bunch. HNY BTW
On Windows you need to use a different quoting style; the single quotes don’t work so you have to use double quotes on the outside and escape the ones on the inside.