What do you need before you start?
- A door sensor: a Zigbee or Thread contact sensor stuck on the door edge (see the best smart door sensors). It shows as a binary sensor that reads
onwhen the door is open. - A temperature probe: a small Zigbee thermometer sitting inside the fridge, or a probe on a cable for the freezer. Many cheap sensors are rated down to roughly -20 °C, but check the spec for your model, because some stop at 0 °C (our temperature and humidity sensor roundup covers options).
- The Companion app: it provides the
notify.mobile_app_<your_phone>action used below. Set it up with the mobile app guide if needed. - Your entity IDs: find them under Settings → Devices & services → Entities. The examples use
binary_sensor.fridge_door,binary_sensor.freezer_door,sensor.freezer_temperatureandsensor.fridge_temperature; swap in your own.
Which sensor setup works best for a fridge or freezer?
Use both a door sensor and a temperature probe if you can. The door sensor tells you quickly that someone left the door ajar, which is the cause of most warm-fridge incidents. The probe catches everything the door sensor cannot: a compressor failure, a power cut, a blocked vent or a door that looks shut but has not sealed against an overstuffed shelf.
Mind the hardware limits. Magnets and radios are fine in the cold, but coin-cell batteries lose capacity at low temperatures, and the radio signal from inside a metal-bodied appliance can be weak. Put the sensor body on the outside of the door where possible and run a thin probe cable through the door seal, or choose a sensor with an external probe. If a probe sits on a shelf, it reads the air temperature, which jumps quickly when the door opens and then recovers; a glass of water or a small container of gel around the probe gives a steadier reading.
Step 1: Check what your sensors report
Open Developer tools → States, search for each entity and open and close the door while watching it change. A contact sensor is on when the door is open and off when it is closed. A temperature sensor should show a number with a °C unit.
Check that the temperature value actually looks right. The Food Standards Agency says a fridge should be between 0 °C and 5 °C and a freezer around -18 °C. Food Standards Scotland adds that the built-in dial on a fridge does not represent a temperature in degrees, so your probe may be the first true reading you have had. Leave it for a day before you pick thresholds, so you know what "normal" looks like for your appliance.
Step 2: Alert when the door stays open
Go to Settings → Automations & scenes → Create automation, switch to YAML from the three-dot menu and paste this. The for option means the door must stay open for the whole period before the trigger fires; if it shuts sooner, nothing happens.
alias: Fridge or freezer door left open
mode: single
triggers:
- trigger: state
entity_id:
- binary_sensor.fridge_door
- binary_sensor.freezer_door
to: "on"
for: "00:03:00"
actions:
- action: notify.mobile_app_your_phone
data:
title: "Fridge door open"
message: "{{ trigger.to_state.name }} has been open for 3 minutes."
data:
tag: fridge-door-open
Three minutes suits a kitchen: long enough to unload the shopping, short enough to catch a door that did not click shut. A freezer deserves the same or a shorter timer, because it warms quickly and holds more at risk. Because one automation lists both entities, trigger.to_state.name in the message tells you which door it was.
A caution from the Home Assistant docs: the for timer resets if Home Assistant restarts or automations reload, so a restart can delay an alert by the full period.
Step 3: Alert when the temperature climbs
The door alert only helps if the door sensor works. A numeric state trigger on the probe is your backstop. This one fires if the freezer is warmer than -12 °C for 30 minutes:
alias: Freezer too warm
mode: single
triggers:
- trigger: numeric_state
entity_id: sensor.freezer_temperature
above: -12
for: "00:30:00"
actions:
- action: notify.mobile_app_your_phone
data:
title: "Freezer warming up"
message: "Freezer is at {{ states('sensor.freezer_temperature') }}°C."
data:
tag: freezer-warm
Make a second copy for the fridge with above: 8 and a for of one hour. Those figures are deliberately looser than the 5 °C and -18 °C targets. A fridge sits a degree or two above target for a while after a big shop, and a freezer drifts up during defrost cycles, so alarming at the exact guidance figure would cry wolf. Treat them as starting points and tune them to your own appliance after a week of readings.
The numeric state trigger only fires when the value crosses the threshold, not while it stays on one side, and the for timer resets if the value drops back in range. That is what you want: a brief spike when the door was open does not trigger it, but a sustained climb does.
Step 4: Only nag when it matters
Overnight, you may not care that someone is rummaging in the fridge, but you do care that the door has been open for ten minutes at 3am. Add a second, stricter alert rather than complicating the first. Duplicate the door automation, change the for to "00:10:00" and add a condition so it only runs when nobody is awake to notice:
conditions:
- condition: time
after: "23:00:00"
before: "06:00:00"
If your household travels, add a zone.home state condition of "0" so the freezer alarm still reaches you while you are on holiday. Our presence detection guide covers the phone trackers that this relies on.
Step 5: Repeat the reminder until the door is closed
A single notification is easy to swipe away. Replace the notify action in the door automation with a repeat loop that stops itself once the door closes:
actions:
- repeat:
count: 4
sequence:
- condition: state
entity_id: binary_sensor.fridge_door
state: "on"
- action: notify.mobile_app_your_phone
data:
title: "Fridge door still open"
message: "Please close it."
data:
tag: fridge-door-open
- delay: "00:05:00"
Reusing the same tag makes each new message replace the last on your phone instead of stacking. The automation runs in single mode by default, so a new trigger during the loop is ignored with a warning rather than starting a second loop. If you want the freezer included, add its own copy of the loop, because the condition inside the loop checks one specific entity.
Step 6: Send the alert to the whole household
The fridge is a shared problem, so one phone is not enough. Create a notify group under Settings → Devices & services → Helpers (the Group helper's Notify group option) with each person's mobile app, then replace notify.mobile_app_your_phone with the group's name. Alternatively, add a second action that speaks through a smart speaker, so someone in the kitchen hears it immediately. Anyone who does not have the Companion app can be added with a different notify service of your choice, such as email.
Step 7: Test it properly
Do not trust it until you have watched it fire. Set the door timer to "00:00:20", open the door and wait. Then check the temperature alert by temporarily dropping the threshold below the current reading (for example above: -30 on the freezer) and shortening the for to a minute. Each automation's Traces tab shows exactly which trigger fired and which condition stopped a run, which is the fastest route to debugging a silent failure. Put every timer and threshold back afterwards, and write the real values in the automation description so you remember them.
Why did my fridge alert not fire?
The usual cause is that the door did not stay open for the whole timer. Any state change during the for period cancels it, including the sensor dropping to unavailable for a moment because the Zigbee link inside the metal cabinet is weak.
It fires every time I unload shopping: raise the door timer to five minutes, or only alert at night.
The temperature alert never triggers: check that the sensor's unit is °C and that the number is not a string such as unknown. A numeric state trigger needs a numeric value, so an unavailable reading will not fire it. Combine it with the low battery alerts guide so a dead battery does not silently disable the protection.
The probe reads too cold or too warm: a reading from a probe placed against the back wall will be colder than one near the door. Move it to the middle shelf and compare it against a cheap standalone fridge thermometer.
No notification arrives: run the notify action on its own from Developer tools → Actions. If that fails, the notify.mobile_app_ name is wrong. The notifications guide and automations guide cover the basics.
What should you do when the freezer alarm goes off?
Check the door first, then the power. Government advice says an outage of under four hours is unlikely to affect the safety of chilled or frozen food, that doors should be kept closed as much as possible, and that a full freezer should hold for up to 48 hours and a half-full one for around 24, though times vary by model. Use the alert as a prompt to act quickly, not as a reason to throw everything out. If the cause is a mains failure, pair this with the power cut alert guide, and keep the door shut until power returns.
Once you trust this alert, the same pattern covers other forgotten doors; see the garage door left open notification guide.
Related kitchen safety: our Home Assistant oven left on alert guide warns you when an oven runs too long or is on in an empty house.







