WiFi as Presence Sensor: Home Assistant Guide
In this article
Yes, you can turn your existing Wi-Fi network into a presence sensor for Home Assistant, and it works reliably enough for most home automation needs. By tracking which devices are connected to your router, Home Assistant can determine if you or your family members are home and trigger automations accordingly.
Why Use Wi-Fi for Presence Detection?
Wi-Fi-based presence detection is appealing because it requires no extra hardware—you likely already have a router and smartphones. Unlike dedicated presence sensors (like mmWave or PIR), Wi-Fi presence covers the entire house, not just one room. It's also cheaper than buying multiple sensors. The main trade-off is accuracy: Wi-Fi presence tells you if a device is on the network, not where in the house it is. For most people, that's enough to answer the simple question: "Is anyone home?"
How It Works: The Technical Side
Home Assistant can detect presence via Wi-Fi in two primary ways:
- Router integration: Many routers (e.g., Asus, TP-Link, OpenWrt, Ubiquiti) expose a list of connected clients via an API or SSH. Home Assistant has integrations for several brands that poll this list and create a
device_trackerentity for each known device. - ARP scanning: Home Assistant can run on the same network and periodically send ARP (Address Resolution Protocol) requests to find active IP addresses. This method works with any router but requires Home Assistant to be on the same LAN and may miss devices that are asleep (unless you enable "consider home" settings).
Once a device is tracked, you can create a person entity that combines multiple trackers (e.g., Wi-Fi + GPS from the mobile app) to improve accuracy.
Setting Up Wi-Fi Presence in Home Assistant
The exact steps depend on your router, but the general process is:
- In Home Assistant, go to Settings > Devices & Services and click Add Integration.
- Search for your router brand (e.g., "AsusWRT", "TP-Link", "OpenWrt"). If your router isn't supported, use the generic "Network Scanner" integration (based on ARP).
- Enter your router's IP address, username, and password (or an API key if required).
- Once connected, Home Assistant will automatically create
device_trackerentities for every device on the network. - Go to Settings > Persons and assign your phone's tracker to your person profile.
After setup, you can create automations like "when person leaves home, turn off lights" using the zone.home trigger.
Improving Accuracy: Avoiding False Positives and Negatives
Wi-Fi presence has known quirks. Here's how to handle them:
- Phones disconnect when idle: Many smartphones drop Wi-Fi when the screen is off to save battery. To counter this, enable "Keep Wi-Fi on during sleep" in your phone's settings, or use the Home Assistant mobile app which can report location via GPS as a backup.
- Devices that never leave: Smart TVs, tablets, and guests' phones will always show as present. You can exclude them from presence by unassigning them from any person, or by using the
known_devices.yamlfile to settrack: false. - Router polling delays: Most router integrations poll every 30–60 seconds. If you need faster response, consider using a dedicated presence method like Bluetooth or the mobile app's GPS.
Comparing Wi-Fi Presence to Other Methods
Wi-Fi presence is a middle ground. Here's how it stacks up:
- GPS via mobile app: More accurate for outdoor location, but requires the app to be running and can drain battery.
- Bluetooth presence: Good for room-level detection if you place BLE beacons, but requires extra hardware.
- mmWave sensors: Detect motion and presence in a single room, but are expensive and need installation.
- Wi-Fi presence: Free, whole-home coverage, but only says "on the network", not where.
For most home automation (e.g., "arrive home" scenes), Wi-Fi presence is sufficient. For room-level automations (e.g., "turn on lights when I enter the kitchen"), you need other sensors.
Common Problems and Fixes
Users often encounter these issues:
- Device not showing up: Check if the device is actually connected to Wi-Fi. Some IoT devices use Ethernet or a separate band (2.4 GHz vs 5 GHz) that the router integration might not see. Also ensure Home Assistant has the correct credentials.
- Presence flapping: If your phone briefly disconnects and reconnects, Home Assistant may mark you as away then home. Use the
consider_homeparameter (e.g.,consider_home: 180) to require 3 minutes of absence before marking you away. - Router integration not working after firmware update: Router APIs can change. Check the integration's documentation for known issues, or switch to ARP scanning as a fallback.
Cost and Security Considerations
The cost is essentially zero if you already have a router and Home Assistant running on a Raspberry Pi or old PC. However, there are security implications: giving Home Assistant access to your router's admin interface means a compromised Home Assistant could control your network. To mitigate this, create a separate, limited-privilege user for the router integration if your router supports it, and keep Home Assistant updated. Also, Wi-Fi presence only works when the device is connected to your network; if you have multiple access points or a mesh system, ensure the integration supports it.
Frequently Asked Questions
Does Wi-Fi presence work with iPhone?
Yes, iPhones work like any other Wi-Fi device. However, iOS may aggressively disconnect from Wi-Fi when locked, so you might need to adjust your iPhone's Wi-Fi settings or rely on the Home Assistant mobile app's GPS as a fallback.
Can I use a separate Wi-Fi network for presence only?
You could set up a dedicated IoT network and track devices on it, but that adds complexity. It's simpler to use your main network and just exclude devices you don't want to track.
Will Wi-Fi presence work if my phone is in airplane mode?
No. Airplane mode disables Wi-Fi, so your phone won't be detected. If you often use airplane mode, consider using a different presence method like the mobile app's GPS (which can work in airplane mode if you re-enable Wi-Fi after enabling airplane mode).
How do I prevent guests from triggering presence?
By default, Home Assistant tracks all devices. To avoid guests affecting your presence, go to Settings > Persons and only assign your own devices to your person. Unassigned devices won't affect any person's state.
Is Wi-Fi presence accurate enough for "I'm home" automations?
For most people, yes. The main issue is the delay (30–60 seconds) and the possibility of false negatives if your phone drops Wi-Fi. You can mitigate by using the mobile app's GPS as a secondary tracker for your person, so Home Assistant uses the most recent reliable source.