Tracking devices too often fails

I am using nmap to track family devices in this way:

- platform: nmap_tracker
  hosts: 
   - 192.168.1.X
   - 192.168.1.XX
  scan_options: " --privileged -sP "
  interval_seconds: 45
  home_interval: 10
  new_device_defaults:
    track_new_devices: no
    hide_if_away: True

but too many times i see my state not at home for few minutes or seconds without moving from my home
as you can see in this shot:

00

Where is my fault? Is there a better way to track devices?

Some phones e.g. iPhone drop from WLAN to save battery. You could try to set consider home setting. See more explation here:

Thanks, so how to set consider_home in .yaml file?

Like this. I copied your code from above.

- platform: nmap_tracker
  hosts: 
   - 192.168.1.X
   - 192.168.1.XX
  scan_options: " --privileged -sP "
  interval_seconds: 45
  home_interval: 10
  consider_home: '00:03:00'
  new_device_defaults:
    track_new_devices: no
    hide_if_away: True
1 Like

You could add a second device tracker component to make your setup more robust (e.g. GPSlogger or Owntracks for GPS or the Bluetooth tracker).

By grouping the different trackers together (not in the known_devices file!), if one device is home the device group is considered home. Only if both devices are “away” the group is marked as “away”.