gcobb321 / icloud3_v3

iCloud3 v3, Development Version - This Repo/Version is used for development and testing of new and updated features. It is not the official release of iCloud3 v3, .
MIT License
145 stars 12 forks source link

iCloud3 Tracking Exception - Tracking has been paused #224

Closed GerdRuetten closed 10 months ago

GerdRuetten commented 10 months ago
          It means the location data received from iCloud or the iOS app is old and can not be trusted. iCloud3 keeps asking for an updated location and is not getting one. I see this when I go to a doctors office and my phone loses the gps signal, when I’m on a plane in airplane mode or in a poor cell area for a long time. The _Event Log_ will show how old the location data is after each request. So it’s really bad Location data that continues to be bad. Nothing iCloud3 can do until the data is current

_Originally posted by @gcobb321 in https://github.com/gcobb321/icloud3_v3/issues/212#issuecomment-1751452348_

I read and understood your explanation in #212 :-) But is it possible to suppress this message? My wife gets it dozens of times on her cell phone when she is at home and the WAF drops rapidly because she is annoyed by the message.

gcobb321 commented 10 months ago

I’ll look at it. Maybe only every 10th message or have a minimum time between each message.

Thoughts?

GerdRuetten commented 10 months ago

Nice that you will have a look at it!Your possible solutions sounds good!Am 24.10.2023 um 11:30 schrieb Gary Cobb @.***>: I’ll look at it. Maybe only every 10th message or have a minimum time between each message. Thoughts?

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>

gcobb321 commented 10 months ago

I actually found the problem. The error count only applies to FamShr locating errors and pauses FamShr tracking for that device after 20 errors. The iOS App tracking goes through the same code when it gets an updated location and, displays the message again because of the FamShr error count when the message should only be displayed one time.

It now checks to see if the FamShr is paused and does not display the message if it is. Resuming tracking resets everything, including the error coung.

This is rc8 with the fix. It has not been released yet in case something else comes in. Unzip it into the icloud3 directory.

icloud3_v3-rc8.zip

Change Log:

  1. Configure Settings - Made the following changes:
    1. Minor text changes to field names and screens.
    2. Improved the error messages when experiencing a problem logging into the iCloud Account.
    3. Fixed a bug when selecting the Enter Verification Code screen before logging into the iCloud account.
  2. Old Location Error Notifications - Fixed a problem where Old Location notifications were constantly being sent to a phone when the maximum number of old location errors (20) had been encountered.
  3. iOSApp Location Time - If the location time is older than 3-hours, it's age is displayed (4.5 hrs ago) instead of the time (6:15:00p).
GerdRuetten commented 10 months ago

Hi Gary,

i install the fix (and now. released v8.1) and it seems to work.

ShonP40 commented 9 months ago

I’m still getting these notifications. Can you just add a way to disable them please? Or at least make them only show up on the UI instead of being sent to all phones?

gcobb321 commented 9 months ago

@ShonP40

  1. Are you really getting this on all devices or only the one that was paused?
  2. Does it show up multiple times? Looking at the code, it should only show up once when the retry number is 20 and the device is not already paused.
  3. The code also displays it in the Event Log. Is it listed there more than one time? And on every device's screen or just the one that was paused?
ShonP40 commented 9 months ago

I installed the integration earlier today and only got the notification once so far.

Didn't really check if I got it on other devices though.

Guessing I'll get a lot more notifications due to GPS issues in my area atm

gcobb321 commented 9 months ago

It is suppose to send the message only once to the device when it reaches the max error count and then pause tracking. It should not send the message if the device is paused. If you resume tracking and then the error count > 20 again, right now, it will pause tracking and send the message again to only that device. I'm in a pretty good area so it is difficult to test that behavior

ShonP40 commented 9 months ago

Well that's kinda annoying If it pauses tracking until I manually resume it, it kinda defeats the purpose of the integration...

Was looking to replace the built in iCloud integration with iCloud3 due to it being able to track AirPods But if it's going to pause tracking every single time I'll just stay with the built in integration

gcobb321 commented 9 months ago

It only pauses tracking when it has tried to get a good location with an accurate gps 20 times and iCloud keeps sending old or inaccurate data. If the location data is really old. the tracking is poor and iCloud doesn't know where the phone really is.

Should iiC3 just keep asking? And what should the request interval be?

ShonP40 commented 9 months ago

Home Assistant's integration just keeps pulling as far as I'm aware.

Don't really know their interval though, it should be 30 minutes by default but I've seen it update the location a lot more frequently than that.

gcobb321 commented 9 months ago

The interval range starts at 15-secs (4 times), 1-min (4-times), then 5 (4-times), then 30 (4 times) & 60.(6 times). So it has to be poor for a long time before the counter hits 20. It is set up this way so it will handle poor locations when close to home and when offline (airplane mode or out of cell area). The iosapp usually kicks in when getting out of airplane mode and starts everything again. The error counter is set to 0 when a good location is reached.

IC3 determines an old location threshold based on the distance and direction and current interval. There is an 'Old Location Adjustment ' on the Configure Settings > Tracking Parameters which is added to the threshold if you are in a consistently poor cell area. Try adding 1 or 2 minutes to if and see if the poor location errors is reduced.

gcobb321 commented 9 months ago

One option is to not pause tracking, reset the counter to 0 and start the cycle again. No message sent to the device but display one in the Event Log for all devices.

ShonP40 commented 9 months ago

It starts tracking again automatically after the iOS app updates the location?

If so, how will that apply to devices which don't have the app? (e.g Apple Watch & AirPods)

gcobb321 commented 9 months ago

It won't apply to them.

ShonP40 commented 9 months ago

Well yea, so do they just stop getting updated forever until manually re-enabled?

gcobb321 commented 9 months ago

Right now. Yes, it has to be resumed.

One option is to not pause tracking, reset the counter to 0 and start the cycle again. No message sent to the device but display one in the Event Log for all devices.

I could make that change and send it to you to see how that worked if you want.

ShonP40 commented 9 months ago

Probably a good idea Or just have it not count it in the first place (if the user chooses so)

GerdRuetten commented 9 months ago

I could make that change and send it to you to see how that worked if you want.

If you need a 2nd tester you can send it to me too

gcobb321 commented 9 months ago

I've change the error handling all around and think it will work better. See below. There is a lot of updates, bug fixes and new features in rc9. See the ChangeLog.txt file in the icloud3 directory for a complete list of items.

The error handling is:

  1. Old Location Error Handling - Changed the handling of old location errors from being controlled by the number of errors to using the location's age.

  2. Interval will go from 15-sec to 30-sec, 1-min, 5-min, 10-min, and 15-min for 4-times at each interval. Before, the max interval was 1-hour. If the device came back online and the iOSApp was not used, it would not be tracked since it was paused.

  3. When the device's location reaches 2-hours, the device tracking control data is reset and it will start over at 15-sec. Before, the device would be paused and a message was sent to the device.

Unzip the icloud3_v3-rc9.zip file into the icloud3 directory and restart HA.

icloud3_v3-rc9.zip

ShonP40 commented 9 months ago

Thanks, but can you push it as a GitHub release so I could download it through HACS please?

gcobb321 commented 9 months ago

Of course, probably Thursday so it will show up this weekend. You got the early version to let you see if your issue has been fixed in case I had to fix a bug before adding it to HACS.

GerdRuetten commented 8 months ago

Of course, probably Thursday so it will show up this weekend. You got the early version to let you see if your issue has been fixed in case I had to fix a bug before adding it to HACS.

Hi Gary, i install the zip-file and will test it.

Must i configuration something after install and restart from HA?

gcobb321 commented 8 months ago

No. Install and restart HA