This is not an important question, so please answer all the other questions from all the other people first.
I’m reorganizing some Home Assistant automations and I wasn’t sure how to specify the entity. I did some testing and I found that all of these work perfectly fine!
Variant 1: On action root
action:
- service: climate.set_hvac_mode
entity_id: climate.th_office
data:
hvac_mode: "auto"
Variant 2: Nested under target
action:
- service: climate.set_hvac_mode
target:
entity_id: climate.th_office
data:
hvac_mode: "auto"
Variant 3: Nested under data
action:
- service: climate.set_hvac_mode
data:
hvac_mode: "auto"
entity_id: climate.th_office
So my questions are:
- Which variant is the most idiomatic?
- Why do all of these work?
- Is there a reason to prefer one over the others?