Setting a timer for bathroom Sonoff TX Light

Hi All,
Newbee to HA. Just installed it yesterday.

However, I am becoming familiar with it but still have a newbee question.

I have Sonoff TX switches in my house along with Sonoff DW2 window sensors and 1 sonoff motion detector.
I have arranged via a scene setting to turn on the bathroom light when my wife goes to the toilet in the middle of the night. The motion sensor is stuck to our bedroom door and is operational only between the hours of 11pm and 6am.

The problem is that the bathroom light is part of a 3 gang tx and we cannot set the loop on it, so if my wife spends more than 5 min in the bathroom (turns off the light manually) and she returns to the bedroom, the sensor triggers AGAIN and turns the light back on, often without her knowing. The light sometimes then remains on all night. grrrrrrr

So I was hoping to find a HA scene that can trigger the bathroom light to turn off after 10min if it’s on (between the same hours of 11 pm to 6 am automatically, which would fix 2 issues.

  1. My wife would not need to turn off the bathroom light manually (heavens forbid)
  2. The light would switch off after 10min thus fixing the problem listed above.

Could someone pls tell me which options to choose in HA to achieve this goal

Jonathan and Oum (Thailand)