This is a Custom Component for Home-Assistant (https://home-assistant.io) that tracks devices using the arp-scan linux command, it's very fast, and reasonably accurate.
custom_components/arpscan_tracker
to your <config dir>/custom_components
directory.Install the arp-scan command and set it's sticky bit, so it can be run as root.
NOTE: This step is not needed on Hass.io, it contains the arp-scan command already.
$ sudo apt-get install arp-scan
$ sudo chmod +s /usr/bin/arp-scan
To use this component in your installation, add the following to your configuration.yaml
file:
# Example configuration.yaml entry with exclude
device_tracker:
- platform: arpscan_tracker
interval_seconds: 15
consider_home: 60
track_new_devices: true
exclude:
- 192.168.178.1
- 192.168.178.3
or
# Example configuration.yaml entry with include
device_tracker:
- platform: arpscan_tracker
interval_seconds: 15
consider_home: 60
track_new_devices: false
include:
- 192.168.178.1
- 192.168.178.3
Configuration variables:
-l -g -t1 -q
)Sometimes your host has more than one network adapter (on Hass.io for example), and you need to figure out which one to use for the scans, you can specify the correct one using scan_options.
Examples:
scan_options: " --interface=enp2s0 192.168.178.0/24 -g"
LAN interface:
scan_options: " --interface=eth0 192.168.1.0/24 -g"
Add the relevant lines below to the configuration.yaml
:
logger:
default: info
logs:
custom_components.arpscan_tracker: debug