Sonoff motion detectors and Sonoff Tasmota flashed light swiches problem

Hi,

I wonder if anyone can help with a problem I have with sonoff zigbee motion detectors using ZHA.

When they are activated by motion the status on HA is shown as motion detected. After a period of time with no motion the sonoff status shown in HA is changed to clear.

I also use tasmota flashed light switches, and using automations, when the motion is detected the switch is activated. Another automation turns the light switch off after a period of time when no motion is detected, ie the status is clear + xx minutes.

This arrangement works really well, with one exception.

The scenario that causes a problem is if the light switch is manually turned off via the light switch, i.e switched off before the motion detector changes state from detected to clear.

When the light is manually turned off and the person leaves the room, the light goes off, but if someone walks back into the room shortly after, the switch is not turned on.

Is it possible to reduce the motion detector time to change status from detected to clear?
Is it possible to change the status of the motion detector to clear when the switch is used to turn off the light?

Is there an alternate solution to this problem?

Help greatly appreciated.