WTH Automation condition: was entity in 'x' state in the last 'x' minutes/hours

Basically I would like to have a possibility to check if a entity was in ‘x’ state in the last ‘x’ minutes…

If the door was opened in the last hour do something…

That’s a standard state trigger with a for duration. Available in the ui and in yaml