Automation based on recently entering zone (home)

Hi,

I am want to make this automation and I have no idea how to solve the time condition in the following case:

I am at home, if I open a door some lights will turn on but only if I am entering home zone recently (maximum 5 minutes), after these 5 minutes, the automation is not suposed to work.
I am in the area for no more than 5 minutes? Yes? Run automation.

The main idea is that I need an automation that works when I am arriving home, not every time I open the door.

Any ideas? Thank you!

Possibly there are more efficient solutions but this is what you could (!) do
Create a input boolean helper that says if you are in / outside the zone, add an automation that sets this value when in/out zone. Then you can use the input_boolean last_updated value with its state to trigger further actions

Maybe your idea is a good starting point I need to conditionate 2 persons, so if I am understanding right … maybe I can create 2 timers helper for the 2 persons started by entering zone, and the trigger of door get effectiv if condition timer 1 is active OR timer 2 is active? Sounds logic? :))

We are 4p… I have 4 input helpers indicating ‘home’ or not and I can then choose from these how to work further in automations, i.e. my wife and myself away triggers different things then when we are all away
You can group people too, then you trigger on the group being on/off (home/not-home)

Best you try things out
If not yet known, you can manually update entities via Dev.Tools > States and see their effect on the automation(s)

My condition looks like this ( the timers are active for each person when entering zone), Now I need to leave home to test if it works :))

condition: or
conditions:
  - condition: and
    conditions:
      - condition: state
        entity_id: timer.timer_aurelia
        state: active
      - condition: state
        entity_id: timer.timer_catalin
        state: active
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: timer.timer_aurelia
            state: active
          - condition: device
            domain: device_tracker
            entity_id: device_tracker.iphone_catalin
            type: is_not_home
      - condition: and
        conditions:
          - condition: state
            entity_id: timer.timer_catalin
            state: active
          - condition: device
            domain: device_tracker
            entity_id: device_tracker.iphone_aurelia
            type: is_not_home

As mentioned in my post above, you can update the sensor and simulate being ‘away’