Automation condition: if state doesn't change within the next x minutes then trigger

Hi,

Is there a way so that when for example a motion sensor triggers and a state doesn’t change within x amount of minutes it triggers?

My nmap presence detection is not as fast as me entering the area and opening the door, so I would like it to wait like 2 minutes and give it some time to recognise someone came home before it sounds the alarm.

think you are after something like this

  trigger:
    - platform: state
      entity_id: input_select.dishwasher_status
      to: Drying
      for:
        minutes: 15

The motion sensor turns off automatically after a few seconds and then retriggers so that isn’t a option unfortunately

what about something like
off top of head
Well this start as and idea
I have just set this up in office and it WORKS

but each time the binary_sensor.office_motion state goes on we also flick the
input_boolean.someone_in_room_1 on then off
then if the input_boolean been in the off state for 10 mins do something

binarysensor:

  - platform: mqtt
    name: "Office motion"
    state_topic: "stat/SONOFF-FAN/POWER3"
    payload_on: "ON"
    payload_off: "OFF"
    device_class: motion

input_boolean:

  someone_in_room_1:
    name: "Someone in Office"
    initial: off

the automation would look something

  - id: 'montion gone off office'
    alias: 'montion gone off office'
    initial_state: true
    trigger:
    - platform: state
      entity_id: binary_sensor.office_motion
      to: 'on'
    action:
    - data:
        entity_id: input_boolean.someone_in_room_1
      service:  input_boolean.turn_on
    - delay: 00:00:01 
    - data:
        entity_id: input_boolean.someone_in_room_1
      service: input_boolean.turn_off

now let do someting if input_boolean.someone_in_room_1 been in a Off state for mins

- id: 'montion on for x min'
  alias: 'montion on for x min'
  initial_state: true
  trigger:
    - platform: state
      entity_id: input_boolean.someone_in_room_1
      to: 'off'
      for:
        minutes: 10
 action:
  - data:
       entity_id: switch.that_thing
    service: switch.turn_off

Now just change the minutes to your liking

This is base on this

have taken out the Node-red

bit all in HA