Look into history of sensor

Another day, another question… (sorry)

I want the following automation: When I leave the house the device tracker will go to “away”, to double check this, I want a condition that looks if the door sensor is used in the past 10 minutes. If this is the case, light out, heat off etc.

The automation without door sensor is already up and running, but how to integrate the door sensor…?

Help is appreciated!

I guess I figured it out…: https://home-assistant.io/components/sensor.history_stats/