Is there a way to “Wake-up” or init an app refresh on IOS? Location presence problem

I’ve been plagued with failure after failure trying to get efficient device_tracking working. Either I’m getting false alerts randomly saying I’m away (when home) on specific devices, or — more commonly — it takes sooo long for these apps and devices to update my location.

I live in an apartment and can not wait 10,15 even 30minutes for my location trackers to update. I could lock my door manually when I leave, but that defeats the point of my home/away automations I want.

Currently I’m using a Bayesian trigger to set my home / away status, it works fine, but only when the apps actually update. Within that trigger I have Ping, Life360, Home App, And Tile. Home app is by far the slowest to update. I can leave for hours before it sends an “away” response. Life360 is the best, but it still takes about 7min on average. Tile is good as well, but also takes about 10min. Ping is instant, but a ton of false aways due to my phone “sleeping” and shutting off WiFi. Oddly enoug, my August lock app is the only one that seems to refresh quickly and often and sends my “away” status as a August-app notification almost instantly when I leave my home zone. If I can tap into that trigger I’d be good.

But as of now, The only way it all works as planned; and in a reasonable time frame is if I manually open life360 and tile apps on my iPhone. Once I open the apps they send the location instantly! But only if I open them manually.

So my question is, is there a way to use HA to force an app refresh etc without my manually opening it? I obviously have background app refresh on etc, but unless I manually open them, they all stick to their pre-timed refresh rates (which is long).

Also, I’m not hardlined on this method, I’m open to trying any way to initiate an instant or 1-5min “away trigger” by any hardware necessary. It just needs to be reliable and quick.

Any help would be greatly appreciated

Try using the routers information if you can do that.
It works quite well for me, but it all depends on the update frequency you set.

Could you explain more about what you mean by “routers information”?

Your router has the information which devices has an IP.
It depends a lot on what router you have so there is golden route to go, but many devices have integrations in HA.
Search for your manufacturer in the Integrations page.

If that fails you could perhaps use a scrape sensor.

If you get that working you will get instantaneous home/away reports if you set the update frequency to 1 second, but that is of course not practical.
I believe I have mine on 15 seconds.

I have a TP-Link Archer AX50 router.
Also have a DHCP Reserve for my HA IP and my Phone. This is how I have my “device_tracker.jon_ping” set up. But the problem with that is, my iPhone XS shuts off WiFi while resting to save power.

Below is the history today of those device trackers. As you can see, the ping tracker is all over the place.

I found this, not sure if it works. You can give it a try.

Yeah, I see what it does; but again, the limitations on that connection and tracking are on my phone; not HA or my router. All modern smartphones shut down their WiFi while resting. So no matter what setup I have configured for my router, it won’t change the fact it won’t find my phone on the network most of the time while it’s resting.

I’m not living under a rock.
It works here.
Just because your phone goes in to sleep does that mean the router disconnects the IP, are you sure?
It doesn’t happen here.

Unless I’m missing something, the way this method tracks presence is by pinging the phones IP and waiting for a reply. Regardless if my phone has a dedicated IP or not, if the WiFi on my phone is turned off (resting), it won’t get a reply.

I’m no expert In networking, but I don’t see any other method a router could interact with a phone other than it’s IP (or MAC addy) but even via MAC it would still need to be connected to the network.

I’m on IOS. Maybe android devices have a “wake up” init if the router pings it. I’m not sure

how do you have the router configured and the config entry that the tracking device is working for you. ??

Sorry, i never check these things. But to answer your question, i didnt. I abandoned home presence tracking via the router — it just wasnt stable and reliable enough. Ive moved to a Bayesian Sensor for me and my girlfriend here now. It checks the GPS location from 3 apps (HA Companion app, Life360, and OwnTracks) I give a value for which is more reliable and fastest to update and the sensor shoots out a ON or OFF value if I’m home or not. Technically you could add the ping sensor as well and just give it a low “trust rating” but I wouldn’t see the point.

Now, within 1 minute of driving away my sensor shows I’m not home and locks everything up and enables alarms etc. same for when i return. So that works for me. If i want instant ON/OFF values for when I’m at my door, I’d need to use a BT beacon method. I’m happy with the Bayesian sensor though, its easy to manage automations with the two of us home, one home, or both away etc.

@ captain sweatpants

Hello. I am trying to further expand my presence detection to not only detect Home and Away state but with GPS. I wish to try out the Waze travel time integration. I have added my phone and can see loads of sensors added in HA. The issue I am having and as you had is that the sensors will not update unless the app (HA) is open which isn’t practical to every time when leaving the house. I am using this method to detect if I am home or away. Works great, but it doesn’t provide gps.

You mentioned you are using Bayesian Sensor. I am not familiar witth this. Can you provide some codes on how to add this?

The Bayesian sensor is part of home assistant.
It basically checks the status of a few sensors and if the majority equal a value it switches to ON. So basically, you could have HA companion app as one, Life360 as two, a router ping etc as three, and OwnTracks GPS as four. Based off the value of “trust” you give each sensor, it will switch to an ON/OFF value if enough sensors report their state as defined.

Read more about it here.