Presence Detection and Geofencing
Knowing Who Is Home Changes Everything
The most powerful piece of context your smart home can have is presence information: who is home and who is not. With reliable presence detection, your home can automatically adjust the thermostat when everyone leaves, turn off lights in empty rooms, arm the security system when the last person departs, and welcome you home with your preferred lighting and music when you arrive.
Without presence detection, you are limited to scheduled automations or manual triggers. With it, your home genuinely begins to feel intelligent. The challenge is getting presence detection to work reliably, because unreliable presence detection is worse than none at all. If your home thinks you left when you are actually sitting on the couch, and it locks the doors and shuts off the HVAC, you will quickly lose faith in automation.
Geofencing: Location-Based Presence
Geofencing uses your phone's GPS to determine whether you are home. You define a virtual boundary (a "fence") around your home, typically a circle with a radius of 100 to 500 meters. When your phone crosses that boundary, the smart home platform registers you as arriving or leaving.
Most major platforms support geofencing natively. Apple HomeKit uses the Home app's location services. Google Home has "Home and away routines." Amazon Alexa supports location-based routines. Home Assistant has device trackers and zone automations.
To set up geofencing effectively, follow these tips:
- Set an appropriate radius. Too small (under 100 meters) and GPS drift will cause false arrivals and departures. Too large (over 500 meters) and the automation will trigger when you are still far from home. Start with 200-300 meters and adjust based on your experience.
- Ensure location permissions are set correctly. The smart home app needs "Always" location access, not just "While Using." On iOS, this setting is in Settings, then Privacy, then Location Services. On Android, it is in App Permissions under Location.
- Account for all household members. If multiple people live in your home, each person needs the app installed with geofencing enabled. Your "away" automations should only trigger when the last person leaves, and "home" automations should trigger when the first person arrives.
Room-Level Presence: Motion and Occupancy Sensors
Geofencing tells you whether someone is home, but it does not tell you which room they are in. For room-level presence detection, you need motion and occupancy sensors. Understanding the difference between these two types is important:
Motion sensors (PIR) use passive infrared to detect movement. They are cheap, reliable, and widely available. The limitation is that they detect motion, not presence. If you are sitting still reading a book, a PIR motion sensor will eventually report "no motion" even though you are clearly still in the room.
Occupancy sensors (mmWave/radar) use millimeter-wave radar to detect the presence of a person, even if they are completely still. These sensors can detect breathing and subtle body movements from across a room. They are more expensive than PIR sensors but dramatically more accurate for detecting whether a room is actually occupied. Products like the Aqara FP2 and similar mmWave sensors have become popular for this purpose.
Combining Methods for Reliability
The most reliable presence detection systems combine multiple methods. Here is a robust approach:
- Geofencing provides the "home or away" baseline. When your phone leaves the geofence, you are marked as away.
- Wi-Fi connection provides a secondary check. If your phone is connected to your home Wi-Fi, you are almost certainly home. This catches cases where GPS is inaccurate.
- Motion sensors in hallways and transition areas detect active movement through the house.
- Occupancy sensors in rooms where you spend extended time sitting still (living room, home office, bedroom) detect presence even without motion.
By layering these methods, you minimize false positives (thinking you are home when you are not) and false negatives (thinking you are away when you are sitting on the couch). The geofence handles the macro level, and the sensors handle the micro level.
Practical Presence-Based Automations
Once you have reliable presence detection, here are some of the most useful automations to build:
Departure routine: When the last person leaves the geofence, wait 5 minutes (in case someone forgot something and comes back), then check that no occupancy sensors show activity. If the house is genuinely empty, set the thermostat to away mode, turn off all lights, lock all doors, close the garage, and arm the security system.
Welcome home: When the first person enters the geofence, disarm the security system, unlock the front door (optional and debatable from a security perspective), set the thermostat to comfort mode, and turn on the entryway and living room lights if it is after sunset.
Room-following lights: When an occupancy sensor detects someone entering a room after sunset, turn on the lights to an appropriate level based on the time of day (bright during evening, dim at night). When the room has been unoccupied for 5 minutes, turn the lights off.
Sleep detection: When the bedroom occupancy sensor detects presence after 10 PM and motion has stopped for 15 minutes, activate nighttime mode: dim any remaining lights to minimum, lock exterior doors, lower the thermostat, and disable non-critical notifications.
The key to all of these automations is the delay and confirmation step. Never take drastic action immediately based on a single sensor reading. Always wait, confirm with a second data point, and provide a way to override.