Door and motion sensor together

Sometimes the motion sensor dowsn’t register someon taking a shower. So i would like to see the following logic.
If door is closed and motion detected - do not switch the light off unless the door is opened again.
But out of ideas here. One way is

Trigger
Door closed
Condition
motion on

But this set up has a drawback that even under normal conditions when you leave and close the door behind you - same conditions will apply, never switching the light off

You could use an input_bookeN to keep track of presence. Switch it on when the door is opened the first time and switch it off when someone leaves a second time.

Well that means an ideal scenario that everybody closes the door behind him. I think it will not be a case…
Maybe something like if door was closed and motion detected for at least 2 minutes - set the presence boolean to on. And than a rule that if boolean is set to on and door opened - set it to off.
This boolean will be in coditions for the lights off rule… Looks like it might work but still looking for ideas

Motion controlled light in bathroom can be put on timed delay.
Always wait about 15min(Average shower time) since last motion before off

OR

Use ceiling mounted motion that can see into shower

This won’t be perfect but is generally the easiest way to solve this issue.
Sonic sensors supporting motion may also help.