Error in home assistant log

What does it means this error:

“Updating device list from nmap_tracker took longer than the scheduled scan interval 0:00:30”

About nmap track i have this in config file:

- platform: nmap_tracker
  hosts: 
   - 192.168.1.0/24  
  scan_options: " --privileged -sP "
  interval_seconds: 30
  home_interval: 10
  exclude:
    - 192.168.1.1
    - 192.168.1.2
    - 192.168.1.3
    - 192.168.1.4
    - 192.168.1.5
    - 192.168.1.7
    - 192.168.1.8
    - 192.168.1.9
    - 192.168.1.10
    - 192.168.1.11
    - 192.168.1.13
    - 192.168.1.14
    - 192.168.1.15
    - 192.168.1.16
    - 192.168.1.17
    - 192.168.1.19
    - 192.168.1.20
    - 192.168.1.21
    - 192.168.1.22
    - 192.168.1.23
    - 192.168.1.24
    - 192.168.1.29
  new_device_defaults:
    track_new_devices: no
    hide_if_away: True

And how to get rid of this?

May be due to you scanning ~225 IPs every 30 seconds.

Try listing the hosts you want to scan or otherwise decrease the total number of scans being performed.

You can list ranges or just cite the specific IPs you want scanned.

Can you give me an example of what you are advicing me?

My DHCP server only hands out IPs in the range of 51-60 and my statically assigned IPs are below 40 currently. Therefore I use the following setup.

https://github.com/SilvrrGIT/HomeAssistant/blob/master/device_tracker.yaml#L25

Your current setup says scan the hosts in 192.168.1.0/24 which is 192.168.1.1-192.168.1.254, thats 253 hosts to scan, your exclude removes 20-25 of those but there is still a large number to scan.

- platform: nmap_tracker
  hosts: 
   - 192.168.1.6
   - 192.168.1.12
   - 192.168.1.18
   - 192.168.1.25-29

The above would scan your currently scanned hosts below the .30 IP range. If you know you will have hosts above the .30 IP range you can add a range to catch those. 192.168.1.30-50 for example. Even with this last range added you would be scanning 28 IPs instead of in the 200 range.

Ok thanks… i want to scan only 2 IP (my phone and my wife phone) and want to exclude all those i put in the exclude list… can you give me the right config for my purpose? I am just beginning to use HASS…

OK, you are scanning way to much if you only want to track two phones.

Only tell it to scan the IP of your phones then. If they don’t have a static IP assigned in your router it is a good idea to do so.

- platform: nmap_tracker
  hosts: 
   - 192.168.1.##
   - 192.168.1.##

That will only scan two IP addresses. Finish off the 192.168.1.## with the appropriate IP address of the two phones.

Ok i did it and i already have static IP assigned to them… and what about the exclude list?

Not required. You are only telling it to scan those two IPs, no other IPs will be scanned.

So what’s the meaning of the exclude option? I followed the instructions on home assistant page

Just as you were using it above.

If you tell nmap to scan a whole subnet (192.168.1.0/24 for example) It will scan 192.168.1.1 - 192.168.1.254.

You can then tell it to exclude certain IPs from that range so they are not scanned.

If you only tell nmap to scan two IPs, the exclude option is not used.

1 Like

After all that, did the error in the log go away?

Yes, it seems so…

Simple truck to prevent the spam is to divide the nmap
I split it in most changed device (dhcp 192.168.22.0-50 and some crap 200-255) every 1 minute
second one 51-199 every 10 min

No more spam!!

device_tracker:
  - platform: nmap_tracker
    hosts:
      - 192.168.22.0-50
      - 192.168.22.200-255
    home_interval: 1
  - platform: nmap_tracker
    hosts:
      - 192.168.22.51-199
    home_interval: 10
4 Likes