Hi, everyone! Thought I’d ask community for help on this one
I’ve been working on a project recently that would check on a Front Gate/Garage door status to decide if to proceed with an open/close command. The logic is as follows:
I would call respective webhooks “entrance_open” and “entrance_close” using iOS Siri Shortcuts that perform a “Get contents of URL” with POST method in JSON format (this works for all of my other automations). The webhooks would then trigger two automations each:
“entrance_open” webhook triggers “Front Gate Conditional Open” automation and “Garage Door Conditional Open” automation.
“entrance_close” webhook triggers “Front Gate Conditional Close” automation and “Garage Door Conditional Close” automation.
The automations are as follows:
- Front Gate Conditional Open
- id: '1595439065549'
alias: Front Gate Conditional Open
description: ''
trigger:
- platform: webhook
webhook_id: entrance_open
condition:
- condition: state
entity_id: cover.front_gate
state: closed
action:
- data: {}
entity_id: switch.sonoff_100097deca
service: switch.toggle
- Garage Door Conditional Open
- id: '1595439708923'
alias: Garage Door Conditional Open
description: ''
trigger:
- platform: webhook
webhook_id: entrance_open
condition:
- condition: state
entity_id: cover.garage_door
state: closed
action:
- data: {}
entity_id: switch.sonoff_100097dbf9
service: switch.toggle
- Front Gate Conditional Close
- id: '1595439971816'
alias: Front Gate Conditional Close
description: ''
trigger:
- platform: webhook
webhook_id: entrance_close
condition:
- condition: state
entity_id: cover.front_gate
state: open
action:
- data: {}
entity_id: switch.sonoff_100097deca
service: switch.toggle
- Garage Door Conditional Close
- id: '1595440049391'
alias: Garage Door Conditional Close
description: ''
trigger:
- platform: webhook
webhook_id: entrance_close
condition:
- condition: state
entity_id: cover.garage_door
state: open
action:
- data: {}
entity_id: switch.sonoff_100097dbf9
service: switch.toggle
These 4 automations check the status of Garage Door/Front Gate before toggling an open/close/stop switches (essentially dumb switches that perform the next logical command for the Garage Door/Front Gate). If the Front Gate or Garage Door is already open, it won’t open it anymore, and vice-versa for closing.
The intended effect of this is to avoid situations when I’m coming home by car but garage door is already open, leading to my Siri Shortcut closing it instead.
However, I’ve run into an issue with triggering multiple automations with a single webhook. The problem is that calling the webhook would trigger only one of the two automations, but not the other (somehow it always works for Front Gate, but not for the Garage Door).
I’ve checked the following:
- Syntax appears to be correct and identical (minus variables) for Front Gate and Garage Door automations.
- States of both “cover.garage_door” and “cover.front_gate” are reported as “open” or “closed” correctly and aren’t “unavailable” (MQTT binary switches).
- Automations work when triggered manually one-by-one without an issue (ignoring the condition of course).
Is there a limit on the number of automations a webhook can trigger, am I doing something wrong, or is there a more elegant solution to this (e.g. scripts, which I haven’t gotten around to figuring out yet)? I’d like to stick to webhook as a trigger (avoids weird “I have toggled…” Siri responses), and to maintain a single-URL on the iOS Siri Shortcut side (multiple “get contents of URL” actions tend to fail with Siri Shortcuts).
Thanks in advance for your advise on this!