Device tracker with Wi-Fi : frequently home/not home with Android phone


Currently, I’ve a problem with my new Oneplus 7 Pro smartphone. It’s constantly switch from home to not home for few seconds/minutes.

Here a graph stats of the last 24 hours.

I don’t know if it’s a settings on my phone or on Home Assistant. I’ve never experienced this with my old Oneplus 6 or with the Pixel 3’s of my wife.

I’ve tried to changer consider_home in device tracker but nothing change. FIY, I use a Orbi router (from Netgear).

Thanks a lot. If anyone have an idea…

many (most?) android phones will turn of wifi in order to save battery. You may be able to disable this in the phone settings

What component are you using for device_tracker ? Your best bet is going to be the one for your router.

@walaj : I’m looking for this option but I find nothing… Except some one in battery settings but already disabled.

@bbrendon : I use these components (before the bug, it was only Netgear).

#Google Maps
- platform: google_maps
    username: !secret email
    password: !secret google_pwd

  # Ping
  - platform: ping
    interval_seconds: 30
    consider_home: 180
      oneplus7_p: 192.168.1.XX
      pixel3_p: 192.168.1.XX

  # Netgear Orbi
  - platform: netgear
    password: !secret orbi_pwd
    host: 192.168.1.XX
    port: 80
    accesspoints: node
    interval_seconds: 30
    consider_home: 180
      track_new_devices: false

This is comparison between Ping and Netgear tracker



I’ve found a recent similar post on Reddit too :


Tried the ping componant and the asuswrt componant and the result is the same. Phones wifi keeps disabling due to inactivity. Haven’t found any setting or 3rd party app that changes this nature.
Went on to use the bluetooth component instead for phonetracking. Works very well, atleast for me who lives in a small apartment. In a bigger house you might have to set upp a couple of bluetooth becons the extend the bl range.

I’m getting this on my Android phone also, wifi keeps going off, and HA thinks I’m away when I’m not.

You may be able to disable this in the phone settings

Where would I find this in the settings? I’m on Android 6

will be somewhere under wifi settings. if it is changeable.

I get the same issue, my phone’s WiFi stays connected but I am unable to use router detection as my Mac address changes every time I reboot my phone so I use static IP and the ping sensor. So even though WiFi stays on, the phone can still stop responding to pings.

Only solution I have found is to alter the time that you are considered home. Usually the phone wakes up and responds again within this time. It just takes longer to show you away.

Hello Yes, I’m not sure how to get screenshots out of my Android phone but I went to ‘wifi > advanced’ and disabled power saving.

I have also gone in the the battery settings and turned off all App power saving.

However I’m still seeing my device vanish from the Wifi:


The phone has been home all day and the signal is strong, are there any other settings I have missed?

I had an Apple iPad also, and this works OK, no vanishing from the Wifi, so my network and device tracker is set up correctly:


I note you are using the SNMP presence detection - I suspect this is passive. So even though you have told you phone not to disconnect from wifi, it is quite possible it isn’t being logged as live in the router (as I dont know which router you have, I dont know how the OID MAC list is populated.)

I would consider moving to using something more active like NMAP tracker or PING

1 Like

Thanks for the reply, SNMP in HA does seem to use network polling. I’m able to change the scan interval and get HA to check the network every 5 minutes for example.

I’m using a TP-Link Archer VR2600 and OID MAC should in theory show the current connected clients on the network. I’ll give nmap and Ping a try, and see if I get better results.

It does seem odd how my older iOs tracking seems to be OK while the newer Android device seems to be vanishing from the network even though I have turn all form of wifi power saving off.

EDIT: Docs say ‘local polling’:

which means HA talks direct to the router, not via a cloud connection - not that the router polls the devices.

Thanks, I see the difference now. I’m running the NMAP tracker now also for the device which is disappearing and it does seem to be giving different results to SNMP.

Would using NMAP or Ping cause battery powered devices to use much more battery is the Wifi is already on and am Ping’ing once per min?

yes from the point of view that the phone is actively transmitting. No from the point of view that wifi is already on and there is always some traffic going.

tbh, I dont think you would notice it.