Guides › Door-left-open alert

English · Svenska · فارسی

🚪 Door-left-open alert

“Can my phone warn me when the back door is left open?”

The simplest useful build there is: a magnet on the door, a reed switch on the frame, and a small WiFi board that warns your phone if the door stays open for more than a few minutes.

Cost$6–12
Time1 evening
LevelFirst build
PowerUSB (battery later)

Ask IotMentor

What to buy

PartWhy this oneRough cost
ESP32-C3 board (e.g. Seeed XIAO ESP32C3)Small, cheap, WiFi built in.$4–7
Magnetic reed switch, door/window type, with magnetA switch that closes when the magnet is near (door shut) and opens when the door opens.$1–3
Two wires and USB powerThe switch goes between one pin and ground.$1

Prices are rough ranges, not quotes. Check the current price and stock before you order.

What to install

With Home Assistant: in ESPHome, the switch is a sensor with a delay filter, so “open for 5 minutes” triggers the alert and a quick trip outside doesn't. Home Assistant sends the phone notification.

Without: a short Arduino sketch notes when the door opened and, if it's still open 5 minutes later, posts to ntfy. Send one more message when it closes.

Build it in three steps

  1. Wire the switch. One wire to a pin, one to ground. Turn on the pin's internal pull-up (a built-in resistor that holds the pin high until the switch pulls it low). Print open/closed as you move the magnet.
  2. Add the timer. Alert only after the door has been open for a set time; 5 minutes is a good start.
  3. Mount it. Switch on the frame, magnet on the door, lined up and close together when the door is shut.

What catches people out

Your version is different?

Ask IotMentor with your own details: distance, power, budget, experience. It asks a few questions back, then gives you a plan like this one, free.

Ask IotMentor

Starts with: “Can my phone warn me when the back door is left open?” Add your own details before you send it.

More guides