I’m trying to automate a webhook posted from IFTTT that will change a helper toggle to “off”. Ultimately, I want to use the IFTTT location trigger to set an additional presence sensor in HA.
For testing purposes, I’m using a SmartThings virtual toggle as the IFTTT trigger. And, to further simplify testing, I’m just working on turning the HA toggle OFF. If I can get this working, then I can get the “ON” part working, and ultimately, I’ll be able to setup the location sensor.
The problem I’m having is with the structure of the “Body” section inside IFTTT. I’ve referred to the “Receiving Events from IFTTT” section of the IFTTT - Home Assistant page. And, I’ve been able to get the automation to work with a very basic Home Assistant automation, with a single action. The problem comes in when I try to add an action with options and conditions.
The HA automation.yaml is as follows:
- id: '1649419511088'
alias: IFTTT Virtual Toggle Webhook Test
description: ''
trigger:
- platform: event
event_type: ifttt_webhook_received
id: Trigger.ON
- platform: event
event_type: ifttt_webhook_received
id: Trigger.OFF
condition: []
action:
- choose:
- conditions:
- condition: trigger
id: Trigger.ON
sequence:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.ifttt_virtual_toggle_test
- conditions:
- condition: trigger
id: Trigger.OFF
sequence:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.ifttt_virtual_toggle_test
default: []
mode: single
This is currently what I’m submitting in the IFTTT body, but it’s not working:
{ “condition”: “Triggered by”, “Trigger”: “Trigger.OFF”, “action”: “call_service”, “service”: “Input boolean: Turn off”, “entity_id”: “IFTTT - Virtual Toggle Test” }
And, here’s what a screenshot looks like in IFTTT:
I searched the HA Community, and found one similar post (Multiple IFTTT Webhooks with different variables), but no one responded.
All I’m really hoping for is a little guidance on how I can better understand the required syntax. If there are any examples out there, that might be good enough to get me going.