PING / NMAP showing as home

Does anyone have a working config for ping and NMAP? I’ve been trying to use both of these for a while now, and while it looks like it is working, if a device is offline for sometime, it will still show as ‘home’. I’ve tried deleting the devices from known_devices.yaml and while this seems to then work for a bit, the issue then starts again.

I saw the following bug - https://github.com/home-assistant/home-assistant/issues/10231, which looks to be my exact issue, but I am using 0.68.0 so this should be resolved.

In both ping and NMAP I have defined the hosts (all with static IP addresses) and have tried hide_if_away = true as that was mentioned on another thread that it may resolve the issue.

Regarding ping, I have enabled debug and can see that the ping is not finding the device (No response from 192.168.7.50 failed=1), but it still stays as ‘home’.

My config:

  • platform: nmap_tracker
    hosts:

    • 192.168.7.50
    • 192.168.7.51
    • 192.168.7.52
    • 192.168.7.53
      track_new_devices: yes
      interval_seconds: 30
      hide_if_away: true
      home_interval: 10
      scan_options: " -sP --host-timeout 10s"
      exclude:
    • 192.168.7.124
  • platform: ping
    hide_if_away: true
    hosts:
    s_s6_ping: 192.168.7.50
    p_iphone_ping: 192.168.7.51
    c_iphone_ping: 192.168.7.52
    b_iphone_ping: 192.168.7.53

With this config, your devices can show as home for up to 10min & 30sec, after changing to not_home.

My config is now:

  • platform: nmap_tracker
    hosts:
    • 192.168.7.50
    • 192.168.7.51
    • 192.168.7.52
    • 192.168.7.53
      track_new_devices: yes
      consider_home: 360
      interval_seconds: 60
      hide_if_away: true
      home_interval: 3
      scan_options: " --privileged -sP --host-timeout 10s"
      exclude:
    • 192.168.7.124

And it still isn’t working as expected. If I am in my house and disable Wifi on the phone, it will eventually show me as away, as expected. But if I leave the house with my phone, it will always stay as home. This is happening on both an android and iphone.

Please use proper formatting of code via the </> button.

I think I can see the issue. When you have hide_if_away set to true, even though the device may correctly set itself to away, the history of the device will always show as home - this is what has been confusing me - and makes it really hard to troubleshoot whether the device tracker is working or not!

The reason for setting hide_if_away was reading a comment from someone saying they thought this resolved an issue they had with NMAP and ping working.