My wifes iPhone doesnt update gps, battery level etc

Hi

So i have mobile app on my phone and my wifes phone.

But wifes phone is almost never update gps location, battery level etc. They are set up identical and giving the exact same permissions on OS level.

Heres today, why does this happen? They have full gps, and access to everything, tried for over a week and reinstalling app etc, but does not help.

On the iPhone, the app needs to be configured to always allow location access. This will randomly trigger, at any given time, a warning popup on the iphone saying “Home Assistant has been using your location in the background, do you want to let it,”

My wife would hit no since it sounded “scary” and her phone would stop updating the location. When I finally told her you need to hit always allow, I stopped having issues.

As i wrote in the original post.
“They are set up identical and giving the exact same permissions on OS level.”

Allways permission has been given, and have allways been enabled.

That also doesnt explain why battery level is never updated. See my picture.

I realize that, but the point is that an option pops up randomly to the user to revoke that permission at any time. Once the app stops working in the background and is put to sleep, it generally stops updating everything, including the battery, and you will get the exact result “seen in your picture”.

I don’t think it’s too much to ask the user of that phone, “hey do any weird pop-ups come up, and what do you click when you see them?” To rule this out.

Short of that, are there any log errors around the phone, and have you checked the event log in the iPhone app itself by going to app configuration, debugging, event log for issues?

That is correct, i made my wife allways says allways allow when those appear. As i did with my phone, a quick trip in the settings on here phone says “tillatelse for plassering → allways” and “bakgrunnsoppdatering/background update” = Active.

Checking the log, it seems fine (its in norwegian) but basicly it says if some siginificant update has occured its pulling that, etc. however in HA the device tracker is allways showing as home. And have been for 3 days. Even though we have been gone and done stuff each day.

Guess i need to try icloud3 again or something

Some pictures

Where it says “didn’t update: ignoring during one shot”, can you click that to get the extra details and post the screenshot from that?

It looks like the phone is detecting the location changes but failing to make the connection back to home assistant to update it.

Please look at Mobileapp integration. if there are doubled phones (the same name) it might be reason why it doesn’t work.

Not the same no, or tracker names

Screenshot 2021-09-13 at 21.58.45 Screenshot 2021-09-13 at 21.59.08

These two happened almost at the same time, its even fetching new battery info, but not updating inside the home assistant ui. Really strange.

If the phone is off the wifi and on the cell network, can you access home assistant from it to control things through the app? If not check that the internal url, external url, and ssid are configured properly.

If this event happened outside the home ssid should say “none”.

I recall having an issue with the internal url and ssid with the ios app in the past. I dont even configure an internal url and ssid and just use the external url which links to my duckdns address. Also make sure you specify https in the external url.

If this doesn’t fix it, are you using VPN, reverse proxy, I r nabu casa for external access to further troubleshoot those?

1 Like

BINGO

Have a beer on me, for some reason the external url was missing, and it was just set to internal url.

Thank you a lot mwav3

Should work tomorrow when she is leaving.

1 Like

Sorry for jumping in, I have a similar issue with my iPhone and location not updating.

The location history shows changes. The geocoded entity shows locations. But I’m only ever ‘home’ or ‘away’, I’m never in zones I’ve created.

I can control HA while on cellular. But my app or phone just doesn’t seem to deal with zones! Zones is turned on in location settings, everything is turned on.

Do you have any ideas what I can try to fix this? Thank you!

I dont use zones myself. Are you defining them with the ui or by yaml?

Maybe you need to increase the radius beyond the default 100 meters?

Also, you’re looking at the state of the phone device tracker itself, and not the person it is linked to right? There’s a difference here in how zones are handled by the device tracker vs person entities.

Hi Tim, thank you for responding.

I configure them via the UI, yes. Most of them were already over 100m, I’ve changed the ones that weren’t.

I am indeed looking at the device tracker entity, and also the person it is linked to. Both are only ever home or away.

I’ve also tried Owntracks, but that didn’t seem to connect to HA, and I don’t know enough about it to figure out what was wrong.

I’m not sure what else to try or what else people can suggest. I appreciate your attempt to help, though!

I just tried adding a zone and it shows up under the location settings screen in the IOS app. When you go to app configuration, location, do all your zones show up there on that screen? If the zones don’t show up there, then there is a connection issue between your Home Assistant instance and the IOS app that needs to be resolved.

If it is there, next time you are in one of the zones, go the the app configuration, location and then click “update location”. This will force a location update and should get the location to recognize as beintg in the zone.

Also on the location screen in the app configuration, make sure your settings are as follows:
Location Permission - Always
Location Accuracy - Full
Background Refresh - Enabled

All options under “update sources” should be enabled.

Also, make sure that the app’s access to “location in the background” is “always allow” - here is the Apple link I posted above for more details.

Hopefully changing one of these settings gets it working again.

Hi Tim,

Good news: I managed to fix it.

Everything was enabled, zones were there, all permissions, everything. But it didn’t work, still. So as a last resort I stopped my device tracker, deleted all entities related to my phone, deleted the phone device and entities under the companion app integration, everything. Deletd the app from my phone, then restarted HA.
After that I reinstalled the app, and as if by magic everything works like a charm. What went wrong in the first place I don’t know. Why I didn’t try this sooner is even a bigger mystery.

But it’s working now. Thank you for your input.

Sometimes it just needs a new start, couId have been some bad cached setting that got cleared. Glad you got it working.

Exactly, stressing the “changing” word, regardless what those settings shows.
It happens not the first time, to me that after updating the application HA stopped updating the location regardless that location settings remained “Always”. It was enough to turn this settings to “Never” and then back to “Always” to make it working.
BTW this bug is really old right now.

@zacwest sorry for tagging you. Don’t know how to contact you otherwise. I have logs from iPhone in question, saved just before re-enabling location settings. If you feel it could help nailing down the root cause, please let me know. For obvious reasons I’m not going to share it publicly.

You can attach them here, please include a text document describing the issue.

It sounds like multiple things are happening in this thread:

  • a device tracker which stopped updating until resetting the integration. this makes me suspicious that the device had multiple integrations and the old one stopped updating, or the user account had multiple device trackers attached to it
  • some kind of bug where the location permission setting doesn’t work for Always though it looks like it does

For the first one it would be worthwhile to check my assumptions there.

For the second one; there’s a lot to unpack. We are almost certainly unable to affect the system-level preference for Always. However, if you delete the app at all and reinstall, when we request “Always” the system will actually lie to the app - it will show as Always until it does the annoying background prompt. Could be this depending on timing.

Hi all, apologies for reviving this thread. If you prefer I create a new one, please let me know and I will do so. Also apologies for any weird punctuation and spelling, I’m on mobile.

So after reporting my issue was fixed, about 25 days ago, my issue is back, strong as ever.

IPhone XR, latest iOS companion app.
Issue: my device tracker (and my ‘person’ related to it) are only ever “home” or “away”, and never in any of the zones I have created.

  • I can access HA when not on my home Wi-fi.
  • all permissions are enabled.
  • geocoded location is correct
  • location history is correct, it’ll even show my purple circle within a blue/green zone circle.

And yet, I am not registered as being inside a zone.

I don’t know how long it was working for, I wfh and don’t go out much. I am getting a bit frustrated with this though.

My OH has no issues with their pixel-something Android phone.

Apart from deleting my phone from HA, deleting the companion app, and reinstalling both… is there anything I can try? That worked last time, but for only a little while it seems.

I’ve tried OwnTracks months ago, but that never seemed to connect/talk to HA properly, it didn’t work well.

I’m starting to think I just have to live with faulty presence detecting.

Any help or tips is greatly appreciated!

Thank you.