Hi, I currently have an automation run where when the number of people in the zone Home changes to be above 1 (using a numeric trigger). The automation turns on the lights in our room.
This works for most scenarios, except for when my partner is still sleeping when I come home. The automation runs as there’s now two people home and then turns on the lights.
Basically, I am trying to figure out how I can specifically run the automation when the count goes from 0 to 2 people and not run if it changed from 1 to 2 people.
I agree with @Troon. It is very unlikely that the state is ever going to jump from 0 to 2. If the from: 0 trigger proposed above doesn’t cover your needs, you can try adding a Wait action to listen for the second person entering the zone in a timely manner.
trigger:
- platform: state
entity_id: zone.home
from: 0
not_to: unavailable
condition: []
action:
- wait_for_trigger:
- platform: state
entity_id: zone.home
to: 2
timeout:
seconds: 30
continue_on_timeout: false
....