Cam Plus will resolve the detection issues by only recording or only alerting when there is a person, etc.
The only problem is that I see you tagged as this being related to a Pan v3, and Cam Plus doesn’t resolve the motion tracking issues, so the pan camera will get triggered by and follow the motion of the flag still, potentially moving the view away from something else you wanted to see.
I would consider voting on the following wishlist to help with that: