Node Red Window Open Counter in TimeRange

Hello, I’m new to NodeRed, but I’ve been looking for it to solve the following problem:
We always forget to close our window after showering. I use window sensors and would like to start a timer that starts running within 10 seconds after opening the window 3 times. When the timer runs out, I start an action.

How do I get the trigger so that the window sensor is counted 3 times within 10 seconds and then triggers?

Probably a few different ways of doing this.

One way that comes to mind:

You can probably employ a switch node to only get the state change from close to open, then feed that into a counter node. Once it reaches 3 you can then proceed with the automation.

Thank you for your comment.

I found a “timed counter” for NodeRed. So i could create the complete flow based on this add-on.

I do use next flow using trigger.
If the window closes within 5 minutes it will stop the timer
If the window is open for 5 minutes I do send an telegram mesaage, call a TTS command and shut down the heating