Hello Everyone,
I try to trigger an automation only if the first person comes home. My yaml code looks like this:
trigger:
- platform: state
entity_id:
- person.p1
to: home
for:
hours: 0
minutes: 0
seconds: 0
- platform: state
entity_id:
- person.p2
to: home
for:
hours: 0
minutes: 0
seconds: 0
- platform: state
entity_id:
- person.p3
to: home
condition:
- condition: and
conditions:
- condition: state
entity_id: person.p1
state: not_home
- condition: state
entity_id: person.p2
state: not_home
- condition: state
entity_id: person.p3
state: not_home
The automation doesn’t trigger because when the trigger fires the conditions can’t be met anymore. Of course I could create a separate automation per person and then only check the other two in the conditions.
Does anyone see a smarter way? How can I solve this in one automation?
Thank you very much!