Motion Activated light with Off switch

I have a light controlled with a Shelly switch behind the wall switch. I also have a motion sensor which controls the shelly switch.

I want to be able to cancel the motion timer if the light switch is turned off. Can this be done? If so How?

hi there, can you clarify some thing?

When you say “light switch” is it the rocker switch that is conneted to the shelly device which controls the relay?

is the shelly device running tasmota or the default firmware?