Nmap doesn't add any new devices - Worked fine 10 min ago

Hi guys,

I use Nmap to see if my devices are online/offline. Most work, but some don’t.

  - platform: nmap_tracker
    track_new_devices: true
    interval_seconds: 15
    consider_home: 900
    hosts:
      - 192.168.0.110
      - 192.168.0.112
      - 192.168.0.113
      - 192.168.0.115
      - 192.168.0.114
      - 192.168.0.119
      - 192.168.0.121
      - 192.168.0.130
      - 192.168.0.131
      - 192.168.0.132
      - 192.168.0.150
      - 192.168.0.171
      - 192.168.0.172
      - 192.168.0.190
    exclude:
      - 192.168.0.170

So the result for ip: 192.168.0.150 is:

704xx73xx29e:
  hide_if_away: false
  icon: mdi:switch
  mac: 70:4X:X7:3X:X2:9E
  name: Switch TL-SG108E
  picture:
  track: true
  vendor: TP-LINK TECHNOLOGIES CO.,LTD

It automatically made a device in the known_devices.yaml.

Now i wanted to add my desktop: 192.168.0.110 and laptop: 192.168.0.113, but it doesnt add it to the known_devices.yaml file…

Any tips on how to fix this?

Did you restart after the change to the config file?

Are you desktop and laptop powered on and have an active connection to the network?

Yes and Yes.

I added all the devices in pairs, to check the result.

First: Tradfri + hue bridge - After restart automatically added to known_devices
second: switch + pi hole RPI - After restart automatically added to known_devices
Third: Desktop + laptop - No new devices

Im typing this on my desktop, checked the Ip trough Router and pc.

Im using Hassbian Home Assistant 0.66.1

EDIT: Tried adding my SynoNAS and an other Pi. Both work. Could it be that my laptop and Desktop are winsdows devices?

try running nmap 192.168.0.110 -F from hassbian. This will tell you if the host is responding or not to the nmap fast scan that Home Assistant uses.

Host is up (0.00039s latency).
Not shown: 96 filtered ports
PORT STATE SERVICE
XXX/tcp open msrpc
XXX/tcp open netbios-ssn
XXX/tcp open microsoft-ds
XXXX/tcp open wsdapi
MAC Address: XX:XX:49:XX:D4:6B (Giga-byte Technology)

Nmap done: 1 IP address (1 host up) scanned in 14.02 seconds

It should be working then, double check that you have saved your changes (I have done this before) and maybe try another restart. With a short interval like 15 seconds it should have hit it multiple times by now.

Anything in the logs?

I did a full reboot of the Pi, saved everything. Restarted router + PC.

Just added the edit to my first reply:
EDIT: Tried adding my SynoNAS and an other Pi. Both work. Could it be that my laptop and Desktop are windows devices?

Edit: Nothing in the Logs

The nmap test you manually ran shows they are responding.

Yes but why wont HA add them to the known_devices?

@silvrr
I don’t know how but i tried Ping again and now its working perfectly… Registers my desktop and laptop withing 30 seconds from boot and 1 min after shutdown.

State changes work now. So ill be working with a mix of Ping and Nmap, depending on which works best for which device.

Any tips on the best Interval and Considerhome times? I have them set to 120 sec now.