I’m trying to set up the device tracker using nmap (I tried using my thomson router but couldn’t figure out how to enable telnet on it) and have added the following to my configuration.yaml file:
However, I don’t get a known_devices.yaml created. I’ve tried a couple of reboots of the system and hass but no success. Am I doing something wrong? (Bonus, if someone could help me enable telnet on technicolor technicolor tg589vac router, would that be better?)
That isn’t necessary, the default is to track new devices (I’m using it without track_new_devices without a problem)
Normally enabling any device_tracker creates the known_devices.yaml file by itself.
Maybe it’s permission issues? Make sure the user running HA has access to the folder with your config.
You could also try to create an empty file, see it that helps
Hmmm okay, I’ve tried creating an empty file and see how that goes. The only logs I’m getting is related to netdisco not getting the description for two ips but that’s not related.
If that doesn’t work, you could try running map yourself from the command line, see if it actually finds any devices.
Doing nmap -oN - 192.168.1.1-255 -F --host-timeout 5s should give you some results like this:
Nmap scan report for 192.168.1.1
Host is up (0.0035s latency).
Not shown: 94 filtered ports
PORT STATE SERVICE
53/tcp open domain
80/tcp open http
139/tcp open netbios-ssn
443/tcp open https
1723/tcp open pptp
8000/tcp open http-alt
Nmap scan report for 192.168.1.50
Host is up (0.00089s latency).
Not shown: 93 closed ports
PORT STATE SERVICE
80/tcp open http
81/tcp open hosts2-ns
515/tcp open printer
631/tcp open ipp
8080/tcp open http-proxy
8888/tcp open sun-answerbook
9100/tcp open jetdirect
I’ve noticed on my own machine, that using 192.168.1.1-255 did not work, however using 192.168.1.0/24 did work, perhaps you could try a different notation as well
Okay, tried that. nmap -oN - 192.168.1.1-255 -F --host-timeout 5s did return nothing at all. Tried the 0/24 notation and it returned some of my devices so that’s good! I don’t understand the syntax for 0/24 though, could you explain (as it what it means)?
Using 192.168.1.1-255 should poll all IP address between 1 and 255
using 192.168.1.0/24 basically does the same, polls all the devices between 0 and 255.
The second notation is called CIDR blocks, you can look for more info online.
Basically what it comes to, is the the part /24 describes how many address should be polled (also spanning multiple subnets). The smallest possible is /32, which describes on the given IP address, every decremental value doubles the amount of IP’s polled.
If you for example know you only have devices between 0 and 31 you can use /27
It might be quite hard to understand at first (I still don’t understand it fully myself ), but a good rule to remember is to use /24 as it polls the entire subnet (x.x.x.0-255)/
EDIT: The fact that the first notation did not work might indicate there’s a bug in nmap itself, or some other parameters are needed to make that work
EDIT 2: After some testing, it seems that the first notation doesn’t work nicely together with the timeout that has been set using --host-timeout and the range, I’ve just successfully gotten results with 1-50 range using 5s timeout, and 1-255 with 15s timeout. However using 1-255 using 5s timeout didn’t work
I am also having this issue but did not have the same luck that addrum had when changing to 192.168.1.0/24.
I am not getting any new populated devices in known_devices.yaml even though I have the Nmap tracker set up as directed. I have tried all of the above recommendations for host names.