Door and window sensors: 10 automations that are worth setting up
Updated
A $10–$25 contact sensor does far more than guard the front door. Ten practical automations, from open-window alerts to a fridge door left ajar, plus battery and protocol basics.
As an Amazon Associate we earn from qualifying purchases. Links to Amazon on this page are affiliate links: buying through them costs you nothing extra.
What a contact sensor does, and what it does not
The sensor has two parts: a body with the radio and battery, and a small magnet. When the magnet moves away from the body, usually by about half an inch to an inch (check the maker’s limit), the sensor sends “open”. It reports state changes only. It does not detect a person, it cannot tell you why a door opened, and it does not sound an alarm by itself unless your hub or the sensor has a siren attached. That simplicity is the strength: contact sensors are inexpensive, reliable and almost never false-trigger.
Ten automations worth setting up
- Front or back door left open. Send a notification if a door stays open for five minutes. Useful with kids, dogs and wind.
- Away alert. When nobody is home, any door or window opening sends a priority alert and turns on a light or a siren. Pair with phone presence; see geofencing fixes if arrival detection is unreliable.
- Pause heating or cooling when a window opens. Have the thermostat set to away or off after a window has been open for two minutes, and restore it when it closes. The logic follows the Department of Energy’s thermostat advice: turn heating and cooling back when you do not need them, which it says can save as much as 10% a year at 7–10°F for 8 hours a day. A window open to the weather is a clear case.
- Garage side door and gate. Alert if the side door opens after 10 pm. For the overhead door itself, use a tilt sensor or an opener with built-in status instead of a contact sensor taped to a moving panel; see retrofit garage door openers.
- Mailbox. A contact sensor inside the flap tells you when mail arrives. Use a Zigbee or Thread model with a good signal, since metal boxes block radio waves; place a repeater near the window or test the range first.
- Refrigerator and freezer door ajar. Notify after two minutes. The U.S. government’s food safety guidance keys on 40°F, the temperature perishable food should stay at or below, and a door left ajar lets the fridge drift above it. See refrigerator and freezer temperature alarms for a sensor that watches temperature itself.
- Medicine cabinet or liquor cabinet. Log or notify when it opens, helpful for caregivers and homes with young kids. It is a reminder tool and a supplement to locking medicines and chemicals away, not a replacement.
- Closet and pantry lights. Turn on a smart bulb or LED strip when the door opens, off when it closes. Quick, battery-friendly and a nice first automation.
- Bedtime check. At 10:30 pm, a voice or phone summary lists any door or window still open. Many ecosystems can read “which sensors are open”.
- Basement or pool gate. Alert when a child-safety gate or basement door opens. It reduces the chance you miss it, but it does not replace barriers, locks or adult supervision.
Pick the protocol first
| Protocol | Needs | Battery | Notes |
|---|---|---|---|
| Zigbee | Zigbee hub, speaker with a Zigbee radio or a USB coordinator | Often a year or more on a coin cell | Low-cost, wide range, mesh through mains-powered devices |
| Z-Wave | Z-Wave hub | Often a year or more | US 900 MHz band avoids Wi-Fi crowding |
| Thread / Matter | Matter controller and Thread border router | Low-power by design | Works across Apple Home, Google Home, Alexa and SmartThings |
| Wi-Fi | Router only | Shorter, depends on the model | No hub, but each device uses a Wi-Fi slot |
The Connectivity Standards Alliance describes Zigbee as a low-power mesh that is optimized for battery life, and the Thread Group describes Thread as a low-power IP mesh built on IEEE 802.15.4. Matter, per the Alliance, keeps control local and lets several ecosystems share a device. If you are unsure which to pick, read Matter vs Zigbee.
Install and test
- Clean and dry the surface. Adhesive fails on dust, texture and paint that is flaking.
- Put the sensor body on the frame and the magnet on the moving part, with the gap small when closed. Use the alignment marks on the case.
- Test the gap. Open the door a half inch at a time and watch the app. Adjust until it reports closed reliably.
- Name each sensor by location, such as “Back door” or “Pantry”, before you build automations.
- Replace the battery when the app warns you. A cold garage shortens coin-cell life.
Pitfalls
- Notification overload. Alert on exceptions (open too long, open while away), not every open and close. Send routine events to a log instead.
- Bounce from loose doors. Wind can make a door flutter. Use a delay of 10 to 30 seconds in the automation before reacting.
- Windows with a lock hinge. A sliding window may leave a gap too wide for the magnet; use a sensor made for sliders.
- Using a sensor as a lock. A contact sensor reports; it does not secure. For access control see the smart lock guide.
Shop by need
Starter automation: front door and one window alert
What to look for: compact Zigbee or Thread contact sensor, coin-cell battery, adhesive mount, low-battery alert in the app
Typical price: $10–$35
See options on AmazonFridge, cabinet or mailbox
What to look for: small contact sensor with a short magnet gap and a protocol with good range, plus a repeater near metal enclosures
Typical price: $10–$30
See options on AmazonSliding window or wide gap
What to look for: sensor rated for a larger magnet gap or a slider kit, test-gap in the instructions
Typical price: $12–$35
See options on AmazonMatter ecosystem across Apple Home, Google Home and Alexa
What to look for: Matter over Thread contact sensor, compatible Thread border router, replaceable battery
Typical price: $20–$40
See options on AmazonFrequently asked questions
What can a door and window sensor automate?
Open-door alerts, pausing the thermostat when a window opens, lights in closets and pantries, mailbox notifications, away-mode alarms and fridge-door-ajar reminders. Anything that depends on “open” or “closed” works.
Do door sensors work without a hub?
Wi-Fi sensors do, but battery life is shorter. Zigbee, Z-Wave and Thread sensors need a hub, a speaker with the right radio or a USB coordinator, but run longer on a battery.
How long do contact sensor batteries last?
Many Zigbee and Z-Wave contact sensors run a year or more on a coin cell. Cold locations and frequent openings shorten that. Set a low-battery alert and keep spares.
Can a door sensor replace a smart lock?
No. A contact sensor only reports whether a door is open or closed. It does not lock, unlock or authenticate anyone.