Beeps if you leave open the door over 20 seconds 3V battery operation, simple circuitry
R1 10K 1/4W Resistor
R2 Photo resistor (any type)
R3,R4 100K 1/4W Resistors
C1 10nF 63V Polyester Capacitor
C2 100µF 25V Electrolytic Capacitor
D1,D2 1N4148 75V 150mA Diodes
IC1 4060 14 stage ripple counter and oscillator IC
Q1 BC337 45V 800mA NPN Transistor
BZ1 Piezo sounder (incorporating 3KHz oscillator)
SW1 Miniature SPST slide Switch
B1 3V Battery (2 AA 1.5V Cells in series)
This circuit, enclosed in a small box, is placed in the fridge near the lamp (if any) or the opening. With the door closed the interior of the fridge is in the dark, the photo resistor R2 has a high resistance (>200K) thus clamping IC1 by holding pin 12 high. When a beam of light enters from the opening, or the fridge lamp lights, the photo resistor lowers its resistance (<2K), pin 12 goes low, IC1 starts counting and, after a preset delay (20 seconds in this case) the piezo sounder beeps for 20 sec. then stops for the same lapse of time and the cycle repeats until the fridge door closes. D2 connected to pin 6 of IC1 makes the piezo sounder beeping 3 times per second.
Connecting D1 to pin 2 of IC1 halves the delay time. Delay time can be varied changing C1 and/or R3 values. Any photo resistor type should work well. Current drawing is insignificant, so SW1 can be eliminated. Place the circuit near the lamp and take it away when defrosting, to avoid circuit damage due to excessive moisture. Don't place it in the freezer.