home-assistant / iOS

:iphone: Home Assistant for Apple platforms
https://companion.home-assistant.io
Other
1.48k stars 282 forks source link

Location not changing anymore #2602

Open domemshur opened 4 months ago

domemshur commented 4 months ago

Recently my iPhone location stopped updating in the companion app. I checked the location trying to debug it and it is updating correctly, but it is not transfer that info to the integration/ app IMG_5322 IMG_5323

bgoncal commented 4 months ago

Maybe a quick fix would be to delete and re-add you server to the companion app. Meanwhile I'll investigate this

rs443 commented 4 months ago

Also experience that the household iPhone suddently stopped updating location a few days ago. The Androids still work. Did some very quick common troubleshooting but could not see any issues.

KoMa1012 commented 4 months ago

Debug output of the app, title: Didn't update: location update from the past { "start_ssid" : "Private LAN", "error" : "locationUpdateTooOld", "event" : "ZoneManagerEvent(locationChange([ +/- 32.00m (speed -1.00 mps / course -1.00) @ 01.03.24, 10:33:12 Mitteleuropäische Normalzeit]))" } Interestingly, it's (nearly) always sending this time, how to get rid of it (once) is to restart your phone. After that the time between when the action is triggered and the time stamp in the message starts to increase.

Time sent Timestamp in message Message 10:16:07 10:15:51 Updated location 10:21:14 10:20:52 Updated location 10:28:33 10:27:56 Didn’t update: Der Vorgang konnte nicht abgeschlossen werden. (Shared.BackgroundTaskError-Fehler 0.) 10:33:41 10:33:12 Updated location 10:34:08 none Didn’t update: Der Vorgang konnte nicht abgeschlossen werden. (Shared.BackgroundTaskError-Fehler 0.) 10:34:15 10:33:12 Didn’t update: location update from the past ... 10:33:12 Didn’t update: location update from the past ... 10:33:12 Didn’t update: location update from the past ... 10:33:12 Didn’t update: location update from the past ... 10:33:12 Didn’t update: location update from the past etc

so, after some time it just stays at 10:33:12, but you can clearly see the time drift of the time in the message.

{EDIT] tried to somehow format it nicely, failed misserably, but I think you get it

revan415 commented 3 months ago

I’ve got the same issue, and a few people on the forum do as well. Location as shown in the companion app is updating, but none of that data gets back to the server. I went so far as to delete zones, uninstall and reinstall the companion app, etc. nothing I’ve done so far has resolved the issue. The location update too old is also showing in my logs.

https://community.home-assistant.io/t/location-updating-zone-not-changing/710294

revan415 commented 3 months ago

I removed the server then added it back. It did then update my location and zone. I am still seeing the same error in the logs though, so not sure how long the fix will last. It also isn’t a great fix since it requires new entities.

KoMa1012 commented 3 months ago

I removed the server then added it back. It did then update my location and zone. I am still seeing the same error in the logs though, so not sure how long the fix will last. It also isn’t a great fix since it requires new entities.

Check if it actually does update the location, I did exactly what you described, changed my location and it didn‘t update. Basically this fix lasted for a couple of minutes for me.

revan415 commented 3 months ago

I removed the server then added it back. It did then update my location and zone. I am still seeing the same error in the logs though, so not sure how long the fix will last. It also isn’t a great fix since it requires new entities.

Check if it actually does update the location, I did exactly what you described, changed my location and it didn‘t update. Basically this fix lasted for a couple of minutes for me.

Mine updated automatically today when I left the house. But I’m still seeing errors in the logs. I am expecting it to start failing fully again at some point given the odd behavior, but the patch seems to be partially successful for now.

ALaDoffe commented 2 months ago

Hi,

I have the same issue. It seems to be related with #2691 and #2675. Since installed beta version as proposed by @bgoncal everything work well again.

Still waiting for the last official release to update all my devices that present the issue.

bgoncal commented 2 months ago

Hi,

I have the same issue. It seems to be related with #2691 and #2675. Since installed beta version as proposed by @bgoncal everything work well again.

Still waiting for the last official release to update all my devices that present the issue.

It's in the AppStore now

bgoncal commented 2 months ago

I'm closing the issue, if you tested the latest 2024.4 and you cans till reproduce it, please feel free to reopen

KoMa1012 commented 2 months ago

Tested with App version 2024.4 (2024.624) and Core 2024.4.3.

still facing the same issue.

revan415 commented 2 months ago

Same here. I removed the server and re-added it and have not had an issue since. But my wife's phone is up to date with the latest version and has not changed location since the update.

revan415 commented 2 months ago

Issue hasn’t been reopened, but isn’t resolved. Just posting again to bump this.

tmarquespt commented 2 months ago

I also have this issue with iOS devices. If I force the update on the app with 'update location' I see the update time on the person entity reset to 'now' but the location is not updated. With a "Restart Home Assistant" the issue persists but with a "Reboot System" from the 'Restart Menu' it starts working again. After some time (can be days) the issue returns. I noticed this behavior on a new instance created from scratch (without importing the backup) to replace my instance that was 6 years old. I have two other instances with a couple of years where the same phones are connected and have no location issues, so I would say the issue is not with the phone/app but something in this new HA instance.

rverstappen commented 1 month ago

I have the same/similar issue as well but it is only a problem with one of my two HA servers (two homes). One server is receiving the location updates but not the other. This is true whether on my local network or away. The companion app location event log only shows the events being sent to the one server.

If it helps for troubleshooting here, I will leave everything as is for now. Please let me know if there's any information or tests I can provide.

[All latest app and server software. Two users, same problem with both phones - one is iOS and other is Android.]

rverstappen commented 1 month ago

OK, so the problem still exists as originally reported above. I've reverted the report to near its original. That is to say that the problem is occurring on one of my two HA servers but not the other (two separate homes, same software versions).

AlecRust commented 1 month ago

@rverstappen do both your instances handle remote connection to Home Assistant in the same way?

rverstappen commented 1 month ago

Yes, through Nabu Casa. Different accounts. It also wasn't updating on the local network for the one account either. I will be at the other house (the one that works correctly) in a few days. I'm away from both homes right now but only one is receiving the location updates.

I can switch between servers no problem, both through the app and a web browser.

On Sun, May 19, 2024, 13:13 Alec Rust @.***> wrote:

@rverstappen https://github.com/rverstappen do both your instances handle remote connection to Home Assistant in the same way?

— Reply to this email directly, view it on GitHub https://github.com/home-assistant/iOS/issues/2602#issuecomment-2119304213, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH5BTZ5JGLTAFGMYNE56OLZDDMUFAVCNFSM6AAAAABDXEXPT2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCMJZGMYDIMRRGM . You are receiving this because you were mentioned.Message ID: @.***>

edgarfroes commented 2 days ago

Hey guys, I had the same problem and this is what fixed it for me:

  1. Sign out from all mobile devices from everybody.

  2. Go to home assistant using a BROWSER and start deleting each and every entity related to those mobile devices, one by one, by hand, on the entities screen. P.S.: If entities start to get recreated while you delete them, check if you're signed out on all devices.

  3. After deleting all entities, go to Settings > Integrations > Mobile app

  4. Delete each and every phone in there. If there's any phone with entities, delete the entities first.

    • If any phone is disabled in this list, re-enable it, delete the entities, and try to delete it again, in this order.
    • If you get errors while trying to delete phones or some weird "Not loaded" messages while deleting phones, restart Home Assistant and redo step 2 onwards. I had to restart Home Assistant multiple times for this to work until no errors or messages were displayed and everything was effectively deleted.
  5. Do this until you feel you have a clean slate on anything related to mobile devices, and then sign in on all devices again. Entities should get recreated, so check if they don't end with "_1" or something, because if they do, then there was something left to delete before signing on again, so redo step 2 onwards. I had to restart Home Assistant multiple times for this to work until no errors or messages were displayed and everything was effectively deleted.

  6. Once phones and entities are properly created, go to Settings > People, go to each person, and check if the only devices that belong to the people are the main phone devices that you want to be used as location trackers, so no Macs, computers, tablets, anything other than each person's main mobile phone should be there.

  7. Test it and post it here if that works for you.

I hypothesize that the zone people tracker is not getting updated because of these ghost phones created by Home Assistant. These get recreated every time you sign-in with the same account, so avoid signing out and back in again on the same device, otherwise, you'll have to make sure your entities are not messed up and each person's main device is the only one liked to the person at hand.

Is this a bug worth creating tickets on Home Assistant's GitHub? Is this reproducible? I can't say for sure because I don't want to mess up my entities, it's a pain to delete each entity by hand (I couldn't find any way to delete entities in bulk).