Trying to get a webhook working

I’m calling my webhook with

https://hassio.example.com/api/webhook/xxx but I’m getting the following response:

405: Method Not Allowed

- alias: mywebhookalias
  trigger:
    - platform: webhook
      webhook_id: xxx
  action:
    - service: lock.toggle
      entity_id: lock.front_door

What am I missing?

2 Likes

doc is incorrect and should be corrected by next release.
this is what you need in your trigger:

  trigger:
    platform: event
    event_type: ifttt_webhook_received
    event_data:
      action: keyword_you_set_in_IFTTT_body

see more here:

I’m trying to use the webhook trigger, not the IFTTT triggger.

Currently, webhook only support HTTP POST method, not GET

2 Likes

That was it. I used APITester.com and it’s working perfectly. Bye bye MQTT!

Can someone help me out in how the URL has to look like?

I tried https://hassio.example.com/api/event/ifttt_webhook_received but it didn’t seem to work.

Thanks for your help

See https://www.home-assistant.io/docs/automation/trigger/#webhook-trigger

And you can use http://apitester.com/ to call the webhook.

I’m struggling with the same thing. How exactly did you solve this?

This is what I have as a test in the automation.yaml file.

- alias: 'webhook_test'
  trigger:
    - platform: webhook
      webhook_id: <webhook_id>
  action:
    service: light.turn_on
    entity_id: light.bedroom_light

I try to trigger it with the following webhook, but I get a 405 error.

https://<domain address>:443/api/webhook/<webhook_id>

1 Like

This is probably your issue. See my post (above) about using the API Tester.

I wish they would add http post

Can someone give me an example how to use the API Tester to post JSON data to the webhook?

1 Like

Hi Marius82,
maybe you can try something like this :
{ “action”: “call_service”, “service”: “light.turn_on”, “entity_id”: “light.lumiere_du_living” }