- if:
    condition:
      and:
        - switch.is_on: ${enable_id}
        - switch.is_on: auto_close
        - lambda: 'return id(beacon_count) == 1;'
    then:
      - button.press: gate_close
- lambda: 'id(beacon_count) -= 1;'
