If a door is opened, wait 30 seconds, and then check the conditions.
I need those 30 seconds for the presence detection.
So after I opened the door, the fritzbox sensor needs time to see the phones, so the group.family will be changing to “home” which would then NOT run the automation.
Where do I need to put in the delay, if possible.
Right now I am working with a litte time window but this is not optimal.
As the entry will be closed very fast, it will not stay open for 30 seconds, so I can not work the with “for” condition (if open for 30 seconds etc)
- alias: entry open
trigger:
platform: state
entity_id: binary_sensor.door_window_sensor_xxx
to: 'on'
condition:
- condition: time
after: '18:30'
before: '17:20'
- condition: state
entity_id: group.family
state: 'not_home'
action:
service: notify.all
data:
message: "Alarm "
The action part of an automation is a script, there’s no point launching a script as the only action of the automation unless you’re going to use it multiple times.
I was not aware that I can use condition in the action section, so in case after the 30 seconds, the state of the group.familiy is “home” the action will stop and no message will be send ?