Identification of a person who stays in the bathroom for more than five minutes

Looking for a solution/scene that detects if a person enters a room and stays there for more than 5 minutes, then a buzzer is activated.

I tried to do this with 3 scenes.
scene #1: When there is motion detection then just turn on an unused switch.
scene #2: When there is no motion detection then turn off that unused switch.
scene #3: When that unused switch is on then wait 5 minutes and then turn on the buzzer.

Scene #3 never takes place.

I would be happy for ideas.

I don’t use this, but - is it possible to set there something similar?
scene #1: When there is motion detection then just turn on an unused switch for a 5 minutes.

SNZB-04P Door Magnetic Sensor scenarios that support the door being open for a period of time as an IF, you can try using this device.