Hi all. I’ve migrated my home assistant from a Synology NAS to a Raspberry Pi, however, something is wrong with nmap presence detection. I set it up to scan for devices, toggled off the ones I didn’t want in the known_devices.yaml
The entry for my phone is the only one tagged to track, and it’s MAC address is correct. This set up worked perfectly on my synology, though for some reason on this install on the Pi my phone is always “at home”, even when I turn off wifi and restart… Running nmap ipaddress on command line does detect correctly whether that device is on the network at the time… Just home assistant always things I’m home?
device_tracker:
platform: nmap_tracker
scan_options: " --privileged -sP " // tried adding this in to see if it would help, hasn’t
hosts: 192.168.0.0/24
home_interval: 10
track_new_devices: no
if you can group your allocated IP address and only scan for them , rather than the full range (ie 255) that will help too
or pick you devices you want to scan and allocate them a fixed ip address and only scan for those IP address.
I have only 5 devices that i want to determine if the are ‘home’ , so i only scan for 5 fixed ip address (hosts)
As you can see from my config above, I have home interval set to 10, and am scanning only a small portion of the network. These same settings worked perfectly on the different platform (synology). Something seems to be going wrong as when turning off my phone’s WiFi and rebooting everything, home assistant boots up and says my phone is at home, even though it is not on my network…
I do have a static IP set up for my phone - how do you define a user by IP in nmap? It seems to work by Mac address?
So I’ve set it up to only scan the particular IP address:
device_tracker:
platform: nmap_tracker
hosts:
192.168.0.6
home_interval: 10
track_new_devices: no
Although the problem is the same as before. Even though that IP address is not connected to the network and running:
nmap 192.168.0.6
Starting Nmap 6.47 ( http://nmap.org ) at 2017-02-28 15:32 GMT
Note: Host seems down. If it is really up, but blocking our ping probes, try -Pn
Nmap done: 1 IP address (0 hosts up) scanned in 3.19 seconds
Shows that it shouldn’t be marked as “HOME” based off an nmap ping. However, according to home assistant, it is always “HOME”, regardless of whether it is or isn’t, breaking my automations. I had this working perfectly on a synology, the only thing that’s changed is that now it’s running from Raspbian and the All In One installer…
Would hugely appreciate some guidance, thanks for reading.
any news on this topic?
Have the same issue with nmap or/and icmp ping.
Already disabled nmap and only scan for devices via ping, but the issue described in this thread is still present.
Home-Assistant is running in a docker container with --net=host
workhomelan:
hide_if_away: true
mac: FC:15:CC:06:CC:F9
name: Work LAN
picture:
track: true
vendor: Hewlett Packard
I can manually ping or nmap this device and it is not responding. Not a wonder, because it is turned off and unplugged laptop in my bag .
But home-assistant is reporting this device as “home”.
This is only one of several devices with this issue.
Also the description for “count” in Ping is a little rare.
What does it mean “packet used for each device”? Is Ping sending 5 packets to every device and if its not getting 100% positiv reply, it assumes the host as “not_home”?
Or is it sending 5 packets:
3 positive, 2 negative = home
2 positive, 3 negative = not_home
How often is Ping sending packets and could this be configured?
I am still struggeling with this two platforms since 2 weeks now and excuse me, but it is a little disapointing that such fundamental and “easy” thing like presence detection with a ping is that less documented.
Trying to switch from openhab which is running on the same host, perfectly. Also with ping as presence detection.
Like @whatever , I would be very thankful for any advice
I’m not sure exactly what I did, but after deleting the known devices yaml and recreating it a few times it just started working for me. It would seem in my case it had something to do with that file.
thanks for your reply. Gave it a shot, but only solved it temporarily.
I deleted known_devices and the db, so it was fresh an new created.
As soon as I plugged in my work laptop, it was discovered. But after disconnecting, it stays “home”
I am using mysql as db backend.
Will try the steps again, using db standard hass config and let you know if that changed anything.
I tried around so much! In the end it looks like I solved it for my setup.
First, delete known_devices.yaml was not enough in my case. I have also configured the recorder with a mysql db, which also has to been dropped and let hass recreate it.
Also, the standard nmap an ping parameters seem to not work for me. Now I have a mixture of both in my config:
This is all for docker environment.
Have no unused Pi2 or 3 to test it in that scenario.
But if it stays like this and work like a charm, openhab and java is history for me :-).
Only thing missing in hass is FHT and/or Busware CUL433/868Mhz support.
I have the same problem with snmp. Some devices always remain ‘Home’ after a day or two. If i delete know_devices.yaml it works for a couple of days again. If I remove tracking from my config, reboot, add tracking and reboot a second time, it works for a couple of days without removing known devices.
Hi can someone help, I am running Hassio ver 0.57.2 on PiZero with below nmap options but causing it to hang after few minutes, at present tracking only 2 iPhones and 3 Android phones configuration.yaml entry
device_tracker:
- platform: nmap_tracker
hosts: 192.168.0.1/24
track_new_devices: no
home_interval: 15
exclude:
- 192.168.0.201
- 192.168.0.202 - ***.***.***.***
I also need help to place custom icons of family members, can someone help where to place these png files in Hassio environment. I tried placing it under config directory and placing icon: /config/name.png in customization.yaml but doesn’t work.
i know it’s a little late, but for pictures you need to place them in the www/ directory of your HA installation and reference them via local/image.ext inside of known_devices.yaml. Use the ‘picture’ property.
Thanks for your response, there are some other references where people spoke about the file size, not sure if that is the problem. I tried the way you suggested, did not work and the same was posted under another case below:
May I ask how you control the same device with these two different platforms? Cause with nmap_tracker we’re keeping track of the device with the MAC Address and with the ping we’re keeping track of the device with the Static IP.
So say I’d like to track the state of the device… Won’t there be 2 different representations for only one device?
Sorry if this sounds silly, I’m new to the Hass.io.
After playing around a little bit more I realized it is just a matter of editing the known_devices file and unify the 2 devices that appear as separate.