Help with trigger id - monitor cover state to turn on switch

What I’m trying to accomplish: When my garage is open, turn on the shop lights. Garage is controlled with the MyQ integration. The lights are controlled via the TPLINK integration. I’m able to successfully control both via HA without automation.

I set up an automation using trigger id’s and the choose action based on the trigger id. There is nothing in the logs indicating it even tried to run. The trace timeline tab seems to show it choosing a default option that skips either choice I’ve defined.

Here is the YAML for the automation I set up:
alias: Toggle Garage Lights
description: ‘’
trigger:

  • platform: state
    id: Detached Garage Open
    entity_id: cover.detached_garage_2
    to: Open
  • platform: state
    entity_id: cover.detached_garage_2
    id: Detached Garage Closed
    for:
    hours: 0
    minutes: 5
    seconds: 0
    from: Open
    condition: []
    action:
  • choose:
    • conditions:
      • condition: trigger
        id: Detached Garage Open
        sequence:
      • service: switch.turn_on
        data: {}
        target:
        entity_id: switch.detached_garage_interior_light
    • conditions:
      • condition: trigger
        id: Detached Garage Closed
        sequence:
      • service: switch.turn_off
        data: {}
        target:
        entity_id: switch.detached_garage_interior_light
        default: []
        mode: single

Got it figured out. I needed to define the device and pick the state BEFORE I edit the trigger id, instead of picking an entity, then guessing at the desired cover state, then editing the trigger id. Some learning curve involved but this video really helped: How to use Trigger IDs in Home Assistant - Tutorial - YouTube. Anyway, here is the functional YAML for reference:
alias: ‘Light: Toggle Detached Garage Lights’
description: Turn on garage lights when garage door is opened.
trigger:

  • platform: device
    device_id: a88e702a24cf175e317791181fbecd6f
    domain: cover
    entity_id: cover.detached_garage_2
    type: opened
    id: Detached Garage is open
  • platform: device
    device_id: a88e702a24cf175e317791181fbecd6f
    domain: cover
    entity_id: cover.detached_garage_2
    type: closed
    id: Detached Garage is closed
    for:
    hours: 0
    minutes: 5
    seconds: 0
    condition: []
    action:
  • choose:
    • conditions:
      • condition: trigger
        id: Detached Garage is open
        sequence:
      • service: switch.turn_on
        data: {}
        target:
        entity_id: switch.detached_garage_interior_light
    • conditions:
      • condition: trigger
        id: Detached Garage is closed
        sequence:
      • service: switch.turn_off
        data: {}
        target:
        entity_id: switch.detached_garage_interior_light
        default: []
        mode: single

For an open cover entity, the value is open not Open. That’s why it never triggered.

alias: Toggle Garage Lights
description: ‘’
trigger:
  - id: on
    platform: state
    entity_id: cover.detached_garage_2
    to: open
  - id: off
    platform: state
    entity_id: cover.detached_garage_2
    from: open
    for: '00:05:00'
condition: []
action:
  - service: 'switch.turn_{{ trigger.id }}'
    target:
      entity_id: switch.detached_garage_interior_light