Webhooks For Scripts

Hi, after a little help, not sure there I’m going wrong here. I have an IFTTT webhook applet that works if I’m using to turn in a entity such as a light. But getting it to run a script seems to do nothing. The script is fine, I can trigger it manually from hassio. Maybe my body text or service template format?

My IFTTT webhook looks like this:

URL: https://www.mydomain.com/api/webhook/888888888888888888

Method: POST

Content Type: application/json

Body: { “action”: “call_service”, “service”: “script.turn_on”, “entity_id”: “script.iftttsc2mbh” }

My hassio IFTTT automation yaml:

- alias: 'IFTTT Automation'
  trigger:
    - platform: event
      event_type: ifttt_webhook_received
      event_data:
        action: 'call_service'
  action:
    - service_template: '{{ trigger.event.data.service }}'
      data_template:
        entity_id: '{{ trigger.event.data.entity_id }}'

In case it matters, the script that I’m trying to trigger with the webhook looks like this:

iftttsc2mbh:
    alias: iftttsc2mbh
    sequence:
      - service: camera.play_stream
        data:
          entity_id: camera.security_camera_2
          media_player: media_player.master_bedroom_hub

Script works if I manually trigger it.

What happens if you create the event in the event tab?

It’s really odd. I can trigger webhook events like turning off lights ect, but scripts are a no go. I can activate my script fine from the dashboard. Maybe the issue is the IFTTT automation yaml template. Maybe it’s a different syntax for actioning scripts?

not sure, you’d need to watch your home-assistant.log file with debug set so you can see incoming events. Also, use the reply attached to peoples posts and they will get a notification that you replied, otherwise they’ll never know you replied. Pretty much the reason why I didn’t notice your post til today.