Webhooks don't fire with Trigger IDs

I am tearing my hair out… I have an automation to toggle a variable from on to off and back. I am trying to track a motion sensor state from another home automation system. I simply can’t figure out why this doesn’t work. If I use a single webhook and don’t use Trigger IDs/Choose, the automation works. With trigger IDs and a Choose, it simply does nothing. I can send the POST and Home Assistant gives me a 200, but nothing happens. There is no trace or time stamp created to show it even tried to run resulting in a default action. What am I doing wrong here?

alias: J&J Motion State Toggle
description: Track the J&J Motion Sensor State
trigger:
  - platform: webhook
    webhook_id: j-and-j-motion-state-toggle-on-Mhj5lOxSjNN-8xS0QLF5I8va
    id: 'on'
  - platform: webhook
    webhook_id: j-and-j-motion-state-toggle-off-B4PZOeKl_xcGi9RHxAMPlfDP
    id: 'off'
condition: []
action:
  - choose:
      - conditions:
          - condition: trigger
            id: 'on'
        sequence:
          - service: input_boolean.turn_on
            data: {}
            target:
              entity_id: input_boolean.j_j_motion_state
      - conditions:
          - condition: trigger
            id: 'off'
        sequence:
          - service: input_boolean.turn_off
            data: {}
            target:
              entity_id: input_boolean.j_j_motion_state
    default: []
mode: single

I mean it’s possible you found a bug with webhook triggers. If you look at your trace, what does it show for the trigger variable? If you click the very first node in the trace and switch to the variables changed tab it should show you exactly what the trigger variable looks like. If you don’t see an id attribute then you found a bug.

There are literally no traces. When I run a curl with the automation editor open, I get the blue bar that says it triggered but no, there is no history, no trace, nothing. So it sounds like I may need to make a trip to Github. Thanks for the sanity check. I would just hate to open an issue and it was a PEBKAC error.

1 Like

The issue is most certainly that the webhooks are not created until Core is restarted in this particular case. I can reproduce it consistently. Create an automation like this and it does nothing. Create an automation like this and restart Core, voila, it all works.

1 Like

Thank YOU! I was pulling my hair out as well… Everything seemed to be working and was triggering in EDIT of the automation, but nothing was happening… Restarting helps, but this is indeed a bug.

Thanks, helped me too

For others visiting here: Also ensure you allow calls from outside your network if you require that