My fridge tends to work it's way up against the wall, and the freezer door will occasionally get stuck just before closing all the way. Food melts. It's a bummer.
I rigged up an alarm system using an ESP-32, a reed switch, a magnet, and a LiPo - all of which I had sitting around, fortunately. The magnet attaches to the freezer door, and the reed switch + ESP-32 sit across from it on the roof of the fridge. The ESP-32 wakes up every few minutes to check the switch. If it detects an open switch on two consecutive checks, it assumes the freezer has been open for more than a few minutes. It then connects to WiFi and triggers a notification!
With a wake-up period of 120 seconds, a 400mah battery lasts a bit more than 3 weeks. Eventually I'd like to set up a low battery alert as well.
Full instructional video below!
"Lolin-32" board with built in battery connector / charging circuit. Any web-connected board will do.
Inductors, Chokes, Coils and Magnetics / Fixed Inductors, Chokes and Coils
I used the 400mah "Ideal for Feather" battery from Adafruit. Fit nicely.