Sonoff PIR, Sonoff T1 & Sonoff Bridge timer and manual control

Hi, I’m wondering if you can advise me on the the following automation. I’m not familiar with Home Assistant but willing to try it if it’ll work in the following scenario.

I want to automate my Sonoff T1 light switches to turn on for x amount of time when a Sonoff PIR sensor detects motion. I am thinking of using a Sonoff Bridge to trigger the timer when it receives a signal from the PIR.

I want the light to turn on for say, 10 minutes. If the the timer counts down to 5 minutes, if the sensor detects motion again, I want the timer to be reset back to 10 minutes. Basically, while motion is being detected, I never want the light to turn off.

Also, if someone turns the light on manually I want the light to stay on indefinitely.

So far I’ve tried to set up a scene in the Ewelink app and set inching on the T1 light switch but after motion is detected, the light comes on, the timer counts down and turns off the switch no matter how many times motion is detected and never resets the timer until the light has turned off.