I need very response and solid / reliable presence detection on WIFI (within 5 seconds of joining or leaving WIFI network) update state of two devices to home or not_home to trigger automation with google home TTS.
I have tried NMAP with Device tracker component and specified 2 hosts (to speed up scan) but it frequently triggers the automation incorrectly. Example after 5 seconds the icon status for the two mobiles are set to ‘not_home’ and then quickly flicks to ‘home’ but this triggers google home to say ‘Hi’ and then not long after ‘Bye’ this goes around in a loop.
Can anyone help to point out why this is happening, is it a limitation and is there a better solution?
Hi…what setup have you got for prescence detection and how is it reliable? Do you have phones that dont experience doze or power save false positives with state home or away?
I have three phones being monitored by Zanzito. It is very accurate but depends on how often the phones send the location. In my case they report every 3 minutes, that means that at most my home lights turn off 3 minutes after I leave home. Do you need any additional info?
I use the Xiaomi Router Mini that cost less than 35€ (28€ on the 11.11) and is an awesome router.
Home-Assistant get the list of connected device from it and it has always been accurate.
There is a dedicated tracker component for it:
It usually detect my presence before me being home, since the phone connect to my wifi when I park/walk back home.
Thanks I might look into that router, I have a modem / router on NBN so dont really want any more equpiment. I have been using bluetooth for a week or so and it picks up signal approx 10m away and is fairly reliable but what I really want to do is:
Have a variable on the front-end or something that gets updated with my state Home / Not Home / Work from the following:
Owntracks + Mosquitto - GPS (Home / Not Home / Work)
Bluetooth (From device bluetooth - Home or Not Home)
Wifi namp (From home router - Home or Not Home)
Any idea of how to get the above setup to update a variable or something on front-end?
That’s possible but you would have to define some priority first.
Which one would win if wifi say you are not_home, bluetooth say you are and owntracks say you are at work (battery died while being at work or smth like that)?
I have read a few posts but I am confused with the most accurate / right way to do things.
My thoughts on current state presence detection for ‘My Location:’ for automation, I am a noob so think in psudeo code can you help with translating this to HA presence detection code to cover the scenarios:
Scenario A1: If current state of presence is ‘Not Home’ arrival by car walk up driveway enter house with phone battery okay:
In car within Home Zone 10 / 20 meters radius OwnTracks/ Mosquitto set presence state ‘Within Home Zone’
Optional - if face detection via camera for smart lock then set presence state to ‘At Home (Camera)’ - definitely arrived home.
Bluetooth (10 sec polling) if phone or other bluetooth device owned by me e.g. Gear S3 enters range set presence state to ‘At Home (BT)’ - appears to be most accurate less power drain
Wifi nmap (30 sec polling but 180 sec appear at home for the deep sleep thing) if presence state is currently ‘At Home (BT)’ set presence state to ‘At Home (BT/WIFI)’ else set presence state to ‘At Home (WIFI)’
Scenario A2: If current state of presence is ‘Not Home’ arrival by car walk up driveway enter house phone battery dead:
Bluetooth (10 sec polling) if phone or other bluetooth device owned by me say Gear S3 enter range set presence state to ‘At Home (BT)’ - appears to be most accurate less power drain
If no device use voice to tell Google Home ‘ is at home’ to set presence state to ‘At Home (ByVoice)’ - Most accurate but point in time
Scenario B1: If presence state set to ‘At Home (xxx)’ and still at home within range of bluetooth and wifi and GPS (but indoors so might not work) with phone battery okay
Bluetooth (10 sec polling) if phone or other bluetooth device owned by me Gear S3 enters range set presence state to ‘At Home (BT)’ - appears to be most accurate less power drain
Wifi nmap (30 sec polling but 180 sec appear at home for the deep sleep thing) if presence state is currently ‘At Home (BT)’ set presence state to ‘At Home (BT/WIFI)’ else set presence state to ‘At Home (WIFI)’
If within Home Zone 10 / 20 meters radius OwnTracks/ Mosquitto working and current presence state contains ‘At Home (xxx)’ do nothing
Scenario B2: If presence state is ‘At Home (xxx)’ and phone battery dead
Bluetooth (10 sec polling) if phone or other bluetooth device owned by me say Gear S3 enter range set presence state to ‘At Home (BT)’ - appears to be most accurate less power drain
Scenario C1: Current presence state set to ‘At Home (xxx)’ and leaving home with phone battery okay
Bluetooth (10 sec polling) if phone or other bluetooth device owned by me say Gear S3 enter range set presence state to ‘At Home (BT)’ - appears to be most accurate less power drain
Scenario C2: Current presence state set to ‘At Home (xxx)’ and leaving home with dead phone battery
If no device use voice to tell Google Home ‘ is leaving in 5 minutes’ to set presence state to ‘Not Home’ in 5 mins