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:
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