You can use a virtual switch to merge both motion sensors in one, following this approach.
- Create a virtual switch (I’ve tested with a local one, I guess it will work with cloud based too)
- Create a routine “If switch on for 5 minutes Then turn switch off”
- A routine when motion is detected by any sensor, turn the switch on (this restarts the 5 minutes timer) and the lights of course.
- A routine when the switch is off, turn off the lights. This will only happen if no sensor has detected motion in the last 5 minutes.