CoRE - Get peer assistance here with setting up Pistons

Need some help with my pistons. I have pistons that fire when motion is detected to turn on lights during certain times of the day. The screenshots below show my current config for one of them. I need help with one piece of logic. Right now, the light turn on when motion happens and set a local boolean variable called “auto…” on each piston that updates when motion causes the piston to fire. The problem is this: I want to be able to overide the piston when manually using the switch. E.g. Lights turn on automatically, when leaving the room I hit the switch and the lights stay off. Right now, the motion sensors read “motion active” as I leave the room, thus having to wait the entire set period for them to turn off automatically. Any ideas on how I can resolve this? I was considering introducing another piston that changes the “auto…” variable (I would make the local variable global) when the switch is manually used but I can’t seem to find a variable that describes “manually” setting a switch.

Thanks in advance for the help!