Current sensitivity I believe is just a percentage of pixel changes.
Above that number, a motion alert is triggered.
I suggest a max threshold, where if a motion alert is triggered, but above another percentage of pixel changes, then it’s considered a flicking on/off of a light switch, which then suppresses the alert action.
Also having debug info on the saved video will also help users fine tune the correct sensitivity. (ie actual percentage of pixel changed that caused the motion alert)