Little advice with manual trigger detection adaptation

Hi, I’m seeking for advice, I’m trying to adapt Design Pattern: Manual Trigger Detection to my house, but I’m missing something.
The scenario y have a hue light, hue tap and a zwave motion detector (everything is working as espect).
What I’ve done: My hue light turn on and off with the motion detector. Also i can turn or and off from my tap. I create an string item call “vest” that change when to rule when the motion detector turns on the light. And a rule that change the same item to manual when I turn it on from the tap so the motion detector won’t work. What I’m missing is how to clean “vest” without using timers (or similar) son ther rule can run againg.
The idea is: If iI turn the light on or off manually. the rule must stop working. Until somothing. I don’t know what this something can be.

it’s not possible for us to tell you what you want.

But there are only two real choices -

You could turn off your "manual’ mode at the next manual action.
e.g. If you turn on the light manually, "manual mode’ is set and nothing automatic is allowed. Later, if you turn off the light manually, automatic is allowed once more.
Or some fancier version of the method, say two on/offs are needed within a few seconds to cancel “manual mode”.

Or you do it with a timer of some kind, maybe many hours.
(that’s the way I do it)

You can have these in combination - having both a means to manually cancel “manual mode” AND a timer that eventually expires it even if you do nothing.

i like you solution, can you elaborate on the rule for pressing twice in a few seconds, I have a Hue Tap, can I use it for this?

I don’t know what a hue tap is.

To capture two events within a period, you can use rules and timers.
At each event, if no timer exists, then start one.
Otherwise, if a timer already exists, you have a “two action within window” to do something about.
When/if the timer runs out, it just erases itself.