Hey all
I’m trying to use device_tracker to turn all lights off when no one is home.
However, I use nmap for presence detection, so I don’t want all the lights to go off if someone’s phone just happens to disconnect from the network.
I’m wondering whether it’s possible to add some sort of timer to the state check to see whether the state is still the same for that whole period, and if so, only then turn the lights off.
This is what I have so far with no form of time awareness.
- alias: "No one home -> lights off"
initial_state: False
trigger:
platform: state
entity_id: group.devices
to: 'not home'
#condition:
# if still true after 15 minutes
action:
- service: light.turn_off
entity_id: group.all_lights