Rule that turns lights off

This seemed so easy, but it is proving difficult. I have a rule that turns on some lights using any of 2 motion sensors or any of 2 doors, :white_check_mark:

Now I want a rule that will turn them off after 5 minutes unless either of the 2 motion sensors changes to active in that time frame. I can’t get this done and I’m thinking that I might be over-thinking this.

Devices involved:
Door sensor 1
Door sensor 2
Motion Sensor 1
Motion Sensor 2

Thoughts??

Tack it onto the bottom of your turning on rule. It goes something like this.

IF ANY of the 4 things shows motion, contact opens, etc
THEN turn the lights ON
WAIT 300 seconds
IF ALL of
Motion1 has stayed inactive for 4 minutes
Motion2 has stayed inactive for 4 minutes
THEN
Lights Off
ELSE
Do something else to eventually turn the lights off

Something is hanging it up. I’ll clean it up and post it for comments.