Fire away presence rule only if

Any examples on how to fire an away presence rule based on wifi and bt trackers but only if the front door (door reed sensor) has been triggered x minutes ago. And ny drawbacks in this rule?

You can create an input boolean that is away/home. Then create an automation that switches the state based on input from your wifi and BT trackers. Conditions would require that both the bt and wifi trackers are not home before the boolean was triggered to away.

i already did that and that is easy. You just add BT trackers to group.home

Still would like to trigger only if the front door changes state.

So would like something like

condition template:
If this sensor hasn’t changes state for x minutes…

Remember seeing an example but now couldn’t find any

You could do it with the trigger or the condition.

Trigger each time the door has been in a certain state for X minutes:

See “State Trigger” about 1/3 of the way down the page

Same for the condition (about 1/2 way down the page)

You will have to try them out and see which works and fine tune the timing requirement.

I was more thinking of the following code in condition but with proper corrections

condition: template
value_template: "{{ as_timestamp(now()) - as_timestamp(states.door_sensor.last_changed) < 600 }}"

I wonder what will happen under such conditions…

We have a trigger like this

  trigger:
  - platform: state
    entity_id: group.family
    from: 'home'
    to: 'not_home'
    for:
      hours: 0
      minutes: 7
  seconds: 0

and than condition

condition: template
value_template: "{{ as_timestamp(now()) - as_timestamp(states.door_sensor.last_changed) < 420 }}"

Let’s same for some example it gets misaligned and the rule doesn’t fire because of door sensor condition. Will it somehow fire afterwards when trigger state is more than 15 or 20 minutes in “not_home” state? Ot it’s only a one time firing at 7 minutes?

Have set the following with no success. This morning had a door sensor triggered at 7:15 and nobody home status at 7:20
Automation rule which triggered before without a hiss this time didn’t work. Where did i go wrong?

- alias: Presence Nobody Home Armed
  trigger:
  - platform: state
    entity_id: group.family
    from: 'home'
    to: 'not_home'
    for:
      hours: 0
      minutes: 7
      seconds: 0
  condition: 
    condition: template
    value_template: "{{ as_timestamp(now()) - as_timestamp(states.binary_sensor.door_window_sensor_xxxd000112axxx.last_changed) < 300 }}"