What I have been testing in regard to the IR filter for my project is this method:
To set the stage the camera is in the livingroom with stationary objects like a couch, chair, laptop, etc. It should always detect something. So, with that in mind.
1: Using sunrise module from PyPi get the sunrise and sunset times for current day.
2: Check the time. If daytime, no IR of course.
3: If no object detected (curtains may be closed) check brightness level. If not max, increase it one notch.
4: If still nothing detected keep increasing until max.
5: If still nothing detected, the AI informs you the camera is covered. (Even with curtains closed there should be enough light to see something.)
If nighttime, after sunset from module:
1: Same as above except, after max brightness, reset brightness back to center and turn on the LED light. Slowly increase the lights brightness.
2: If still nothing, follow the same path as before, increasing the brightness until max.
3: If still nothing, reset brightness to center, turn off LED and engage IR.
4: If nothing, increase brightness until to max or an object is detected.
5: Once maxed, turn on LED light as before and slowly increase light until an object is detected.
6: If after all that during the night, the AI alerts to an anomaly.
Still some fine tuning of course. Seems to work in a room. Hope that inspires!