Networking and Presence Detection in Home Assistant
How router and Wi-Fi based presence detection works in Home Assistant, the device_tracker options that actually hold up, and how to combine network presence…
Last updated: 2026-05-27
Most of the satisfying local automations - heat that backs off when the house empties, lights and locks that arm when everyone leaves, a notification when a kid gets home from school - depend on one deceptively hard question: is anyone home? Room presence is a separate problem with its own sensors. Whole-home presence, the “is this person on the property at all” signal, is almost always answered by your network. This guide covers how to do that well in Home Assistant, what is reliable, what is flaky, and how to combine network presence with room sensors so your automations stop misfiring.
Why network-based presence is the backbone
A phone is the one device a person carries everywhere and that reliably rejoins the home Wi-Fi the moment they walk in the door. That makes the network the most practical proxy for “person X is home.” You are not really tracking the person; you are tracking whether their phone is associated with your network. It is not perfect - phones sleep, Wi-Fi randomizes MAC addresses, a guest’s phone is not on your network - but as a coarse home/away signal it is hard to beat, and crucially it can be done entirely locally.
In Home Assistant this surfaces as the device_tracker entity. Each tracker is home or not_home (Home Assistant calls the away state not_home), and you combine the trackers for the people you care about into a Person entity. The Person is what your automations should key off, not individual trackers, because a person can be tracked by several sources at once.
The device_tracker options, ranked by how local they are
There is no single right answer here. Pick based on the router and gear you already run.
Router and DHCP integrations (most local, no extra hardware)
If your router is supported, this is the cleanest option: Home Assistant asks the router which devices are currently connected and turns that into trackers. It is fully local, needs no app on the phone, and costs nothing. Home Assistant ships integrations for a long list of routers and firmwares - OPNsense and pfSense, OpenWrt, AsusWRT, FRITZ!Box, Mikrotik, and many consumer brands - plus a generic Nmap Tracker and Ping (ICMP) option for anything else.
The catch is detection lag and modern phones. Routers do not instantly know a device left; they wait for a DHCP lease or association to expire, so “just left” can take several minutes. And phones increasingly use randomized MAC addresses and aggressive Wi-Fi power saving, which can make a present phone look absent. Two fixes help a lot: set your phone to use a fixed (not randomized) MAC for the home network, and give it a DHCP reservation so its address is stable.
UniFi Network integration (great if you run UniFi)
If your network is UniFi, the UniFi Network integration is the nicest middle ground. Home Assistant polls your local UniFi controller - on a UniFi Dream Machine Pro or a self-hosted controller - over the LAN using a local-only account, and every wired and wireless client can become a device_tracker. Because the controller already knows the instant a client associates with or roams between access points like the UniFi U7 Pro or UniFi U6 Pro, arrival detection is fast and departure is more reliable than raw DHCP polling. It stays on your network and does not require Ubiquiti’s cloud login. The tradeoff is that it is polling, not push, so there is still a few-second granularity, and it only tells you presence - Home Assistant monitors the UniFi gear, it does not control routing or firewall rules.
Ping and Nmap (the universal fallback)
When nothing official exists for your router, Home Assistant can simply ping a device’s IP (Ping integration) or scan the subnet (Nmap Tracker). Give the device a static IP or DHCP reservation first. Ping is light and works for anything with a stable address - a phone with a fixed MAC, a tablet, a always-on machine. Nmap is heavier and scans a range, which is handy for discovery but can be noisy and slightly slow. Both are local. The weakness is the same phone-sleep problem: a sleeping phone may not answer a ping even though it is home, so these are better for always-on devices than for phones unless you tune keep-alive behavior.
The Home Assistant mobile app: GPS plus Wi-Fi SSID
The official Home Assistant Companion app is the other half of good presence, and it is more local than it looks. It reports the phone’s location to your Home Assistant server directly (over your own connection, including via a VPN like Tailscale or WireGuard - no third-party location cloud). Two features matter most:
- Zone / GPS presence. The app fires when the phone enters or leaves a Home zone you define around your address. This catches arrival before the phone has even rejoined Wi-Fi, which is perfect for “open the garage as I pull in” automations. GPS drains a little battery and can be jumpy in dense areas.
- Connected SSID sensor. The app exposes which Wi-Fi network the phone is on. An automation that treats “connected to my home SSID” as home is fast, battery-friendly, and immune to the randomized-MAC problem because the phone is reporting about itself.
Combining the app’s SSID/zone signal with a router or UniFi tracker in one Person entity gives you the best of both: fast, low-power confirmation from the phone, plus a network-side check that does not depend on the app running.
Combine network presence with room sensors for reliability
Network presence answers “is anyone on the property.” It is terrible at “is someone in this room right now,” because a phone left on the kitchen counter looks identical to a phone in the owner’s pocket. For room-level automations, layer in dedicated presence sensors and let each do what it is good at:
- mmWave radar detects a still person - someone reading on the couch or asleep - which is exactly where motion sensors fail. Devices like the Aqara FP2 or the locally-flashed Everything Presence One report continuous occupancy per zone.
- PIR motion is instant on entry and draws almost no power, but it falsely clears when you hold still. It is the perfect fast trigger to pair with mmWave’s patience.
- Network presence gates the whole thing: do not run “nobody home, turn everything off” routines while a Person is still
home, even if every room sensor reads clear.
A reliable pattern looks like this: use the Person entity (network plus app) as the house-level home/away gate, use mmWave plus PIR for room occupancy, and require both signals to agree before doing anything disruptive like turning off HVAC or arming an alarm. That layering is what stops the classic failures - lights snapping off while you sit still, or the heat shutting down because a phone briefly dropped off Wi-Fi.
A practical setup that holds up
For most people the reliable, local recipe is:
- Give every phone a fixed (non-randomized) MAC on the home network and a DHCP reservation.
- Add a network tracker: the UniFi Network integration if you run UniFi, otherwise your router integration, or Ping against the reserved IPs.
- Install the Home Assistant Companion app on each phone and enable the Home zone and the connected-SSID sensor.
- Build one Person per human, attaching every tracker for that person so the sources back each other up.
- Use mmWave and PIR for room presence, and gate destructive whole-home routines on the Person state, not on a single sensor.
Privacy notes
Done locally, this is one of the more privacy-respecting things you can build: router, UniFi, ping, and nmap tracking all stay on your own network, and the Companion app reports straight to your server rather than a location broker. A few things to keep in mind anyway. Presence history is sensitive - it is a log of when each person comes and goes - so apply Home Assistant’s recorder retention and exclude trackers you do not need to keep. If you expose Home Assistant remotely, use a VPN or Home Assistant Cloud rather than poking a hole in your firewall, so location data is never sent in the clear. And be transparent with the people in your household: presence detection is, by design, tracking them, and that is worth a conversation rather than a surprise.
Network presence is rarely glamorous, but it is the quiet foundation under the automations people actually notice. Get it local and layered, and the rest of your smart home stops guessing about whether anyone is home.