Nmap Tracker

As an alternative to the router-based device tracking, it is possible to directly scan the network for devices by using Nmap. The IP addresses to scan can be specified in any format that Nmap understands, including the network-prefix notation ( and the range notation (

Please keep in mind that modern smart phones will usually turn off WiFi when they are idle. Simple trackers like this may not be reliable on their own.

If you are running Home Assistant Core in a Python virtual environment, you might have to install the packages for arp and nmap. On Debian based hosts (for example Raspbian) do so by running sudo apt-get install net-tools nmap. On a Fedora host run sudo dnf -y install nmap.

Host detection is done via Nmap’s “fast scan” (-F) of the most frequently used 100 ports, with a host timeout of 5 seconds.

To use this device tracker in your installation, add the following to your configuration.yaml file:

# Example configuration.yaml entry
  - platform: nmap_tracker

Configuration Variables



The network address to scan (in any supported Nmap format). Mixing subnets and IPs is possible.



The number of minutes Nmap will not scan this device, assuming it is home, in order to preserve the device battery.



Hosts not to include in Nmap scanning. Scanning the host where Home Assistant is running can cause problems (websocket error and authentication failures), so excluding that host is a good idea.



Configurable scan options for Nmap.

Default value:

-F –host-timeout 5s


A full example for the nmap tracker could look like the following sample:

# Example configuration.yaml entry for Nmap
# One whole subnet, and skipping two specific IPs.
  - platform: nmap_tracker
    home_interval: 10
# Example configuration.yaml for Nmap
# One subnet, and two specific IPs in another subnet.
  - platform: nmap_tracker

In the above example, Nmap will be call with the process: nmap -oX - -F --host-timeout 5s

An example of how the Nmap scanner can be customized:

Linux capabilities

On Linux systems (such as Hass.io) you can extend the functionality of Nmap, without having to run it as root, by using Linux capabilities. Be sure to specify the full path to wherever you installed Nmap:

sudo setcap cap_net_raw,cap_net_admin,cap_net_bind_service+eip /usr/bin/nmap

And you can set up the device tracker as

- platform: nmap_tracker
  scan_options: " --privileged -sn "

See the device tracker integration page for instructions how to configure the people to be tracked.