Only 1st Automation using specific entity id is recognized

I have the following automations and only the first is being recognized. The second saves and I get no errors when I check, but when I go the input boolean it shows that it is only part of the first automation. Any hints?

- alias: 'Leslie Enter lesliehome on'
  trigger:
    platform: zone
    entity_id: device_tracker.leslie_s_iphone_2
    zone: zone.GATE
    event: enter
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.lesliehome
    
- alias: 'Leslie Enter lesliehome off'
  trigger:
    platform: zone
    entity_id: device_tracker.leslie_s_iphone_2
    zone: zone.GATE
    event: exit
  action:
    service: input_boolean.turn_off
    entity_id: input_boolean.lesliehome

Where are these two automations located? Under automation: in configuration.yaml or in the automations.yaml file?

They are located in the automations folder in a file named homeaway.yaml. I have maybe dozens of automation files saved there in the same way but have never come across this. Seems like sort of a glitch.

I’ve tried making new input Booleans and recreating the automation and get the same result. Only the first sticks and the rest will just kind of exist but not run and not show up in the related section of the input booleans details where it shows what automations it is a part of.

Not sure what is causing this ‘glitch’ but the two events for a Zone Trigger are enter and leave (not ‘exit’). In addition, an entity_id is always expressed in lower case.

You can consolidate the two automations (and maybe it will have the side-benefit of eliminating the glitch).

- alias: 'Leslie Enter lesliehome'
  id: leslie_enter_lesliehome
  trigger:
  - platform: zone
    entity_id: device_tracker.leslie_s_iphone_2
    zone: zone.gate
  action:
  - service: "input_boolean.turn_{{ 'on' if trigger.event == 'enter' else 'off' }}"
    target:
      entity_id: input_boolean.lesliehome
1 Like