Can someone tell me how WiFi detection works, when different things are enabled?
What “weight” do they have compared to each other?
I can see that it does some multi detection on the same device_tracker?
Example enabling the following detection’s:
Unifi controller
Nmap
Ping
I currently get lightning fast detection seconds coming home!
But detecting leaving home is around 5-11 min
Wonder if one of the above is the reason for this and maybe should be disabled?
I would also like to hear about your settings for each of them?
Unify looks at what devices are connected to the AP you specify. It takes a bit to disconnect as the Unifi controller keeps them on for ~5 minutes. This is a limitation from Ubiquiti, not much you can do about it with HA.
NMAP and Ping both regularly probe for your device. Ping sends a ping and looks for a ping request. NMAP runs a fast scan (100 most common ports) and looks for a response.
Both of theses have a specified interval to run the probe as noted in your config.
All that being said I haven’t seen anything definitive on how they work with more than one service enabled.
I have one local (ubiquiti) and one for on the go (iCloud) and it works well. I would think three local trackers would step on each other eventually.
I need NMAP to find new devices to my known list… (Future I would like a Guest detection notification - have open guest WiFi with web-page password access so that catches everyone with WiFi enabled on my property)
Ping is there because they PING my iPhones read that would help detection.
Someone must know the setup/priority between them?
And if there is any conflict using them all?
Really miss a best practice guide for wifi, right now I am trying so many different thinks
You are only scanning your 4 iphones though. Nothing else is getting scanned by nmap. You can actually remove your exclude listing as those hosts wouldn’t be scanned. You would need to use exclude if you scanned an entire subnet (192.168.0.0/24) and wanted to exclude a few hosts.
The Unifi component should be identifying everyone connected to your guest ssid. Not sure if they have to be fully connected or if passers by would be detected. This is more of a unifi question.
I did have luck with ping for awhile, however, with the unifi component, Im not sure its needed. My phones have been pretty accurate with it. This is likely due to the long time it takes for them to drop off the controller. You can view as devices connect/disconnect in the events viewer on your controller to see how things react.
Yes as I said trying to many different thinks before I had a mix (Doc said that was okay)
platform: nmap_tracker
hosts:
192.168.0.201
192.168.0.202
192.168.0.203
192.168.0.204
192.168.0.0/24
It actually does (Or NMAP does?) even a taxi driving by slowly is detected by Unifi. UPS delivery - anyone near my access point is currently captured by my known_devices (Haven’t turned it off yet)
Yes its actually really quick to drop my iPhones from the list (So why is it taking additional 6 minutes?)
The 192.168.0.0/24 and your other IPs listed is redundant. Those IPs are contained in 192.168.0.0/24. 192.168.0.0/24 is 192.168.0.1 - 192.168.0.254. 192.168.0.255 is reserved as the broadcast address.
Keep in mind that scanning a whole subnet with nmap means that is is scanning 100 ports and 254 addresses every 12 seconds. That is a lot of traffic on your network.
I would think this is is the unifi tracker. Until a device has actually joined your network and gotten a IP from your DHCP server NMAP wouldn’t pick it up. Also, with your previous NMAP settings it wasn’t scanning anything but your 4 iphones.
Try dropping your nmap and ping scanners for a bit. Then connect a device and watch it come online on the controller. Confirm the same in HA. Then turn of the wifi/device and see when it drops from the controller and when it drops from HA. Tweak your detection time setting to give you the quickest reaction possible without getting false positives (cell phones often sleep and don’t respond).
Okay @silvrr so testing them one by one quickly (Turned Wifi & bluetooth off on my phone)
Unifi minutes is the time before unifi removes my iPhone from the list of connected devices)
Total time is before I get a notification from HA that I am away
Having everything turned on didnt help in total minutes or Unifi minutes
Also I think the time after Unifi minutes is the 120 sek delay in my configuration its around 2 min always
I will try to only use Unifi and see if I can tweak settings
Also Bluetooth seems to work very fast and reliable but since my Wifi have higher value in my binary sensor it will wait for that to be the deciding factor (I like that it register me even before I turn into my driveway