gcobb321 / icloud3

iCloud3 v3 - iCloud3 is an advanced iDevice tracker that uses Apple iCloud account and HA Companion App data for presence detection and location based automations.
MIT License
585 stars 53 forks source link

new error: overlapping stationary zones when coming home? #386

Open N3rdix opened 3 weeks ago

N3rdix commented 3 weeks ago

After updating to 3.1 (which runs smooth for me) I noticed a new error when returning home into my Home Zone coming from the ic3_stationary_zone which was ~500m away:

Logger: custom_components.icloud3
Quelle: custom_components/icloud3/support/zone_handler.py:318
Integration: iCloud3 v3 (Dokumentation, Probleme)
Erstmals aufgetreten: 4. November 2024 um 23:15:55 (1 Vorkommnisse)
Zuletzt protokolliert: 4. November 2024 um 23:15:55

'ic3_stationary_1'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/support/zone_handler.py", line 318, in is_same_or_overlapping_zone
    Zone1 = Gb.Zones_by_zone[zone1]
            ~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'ic3_stationary_1'

Never saw this issue before, could it be related to 3.1?

The full log of the affected time window:

                                          ⡇   WATCH_ULTRA_TOBIAS, ICLOUD PREFETCH,  
                                          ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11-04 23:00:35 ICLOUD  watch_ultra_tobias > Located > iCloud-22:45:16 → 23:00:33, 63%
11-04 23:00:35 LOCATE  watch_ultra_tobias > Located > iCloud-23:00:33 (2 secs ago)
11-04 23:00:35 ICLOUD  watch_ultra_tobias > Trigger > Next Update Time Reached
11-04 23:00:35 ICLOUD  watch_ultra_tobias > Exited Stationary Zone > StatZon1, DevicesRemaining-0
11-04 23:00:35 ICLOUD  watch_ultra_tobias > Will Remove Stationary Zone > StatZon1, LastUsedBy-Watch Ultra Tobias
11-04 23:00:35 ICLOUD ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                          ⡇   WATCH_ULTRA_TOBIAS-⸨<<REDACTED>>⸩, ICLOUD, NEXT UPDATE TIME REACHED 
                                          ⡇⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
11-04 23:00:35 ICLOUD ⡇ watch_ultra_tobias > Zone > StatZon1(1)-13m > Grundschule-626m, Arbeit Silke-4.95km, Arbeit Tobias-9.98km, AccuracyAdjustment-10m, GPS-(49.30189, 8.50756/±20m)
11-04 23:00:35 ICLOUD ⡇ watch_ultra_tobias > Results > Arrive-~@18:26, NextUpdate-23:15:35, Moved-410m , Battery-63%, ×Went3km
11-04 23:00:35 ICLOUD ⡇⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
                                          ⡇   WATCH_ULTRA_TOBIAS-⸨<<REDACTED>>⸩, ICLOUD, CURRZONE-IC3_STATIONARY_1 
                                          ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11-04 23:00:35 ICLOUD  HA Zone Deleted > Zone-StatZon1/ic3_stationary_1
11-04 23:00:35 ICLOUD  Removed HA Zone > StatZon1
11-04 23:00:36 ------  HA Zone Added > Zone-home/home (r30m)
11-04 23:15:35 ICLOUD
🔻 <<REDACTED>>, POST, RESPONSE, REFRESH_CLIENT/1725 
❗   items={'code': 450, 'ok': False}
11-04 23:15:35 ICLOUD <<REDACTED>>, Authenticating with Token
11-04 23:15:35 ICLOUD
🔺 <<REDACTED>>, POST, REQUEST,  _AUTHENTICATE_WITH_TOKEN/847
❗   items={'url': 'setup.…………/setup/ws/1/accountLogin', 'retry': 0, 'json': None}
❗   params={'dsid': '1325993913'}
❗   data.items={'accountCountryCode': 'DEU', 'dsWebAuthToken': 'M/sa+5……iULQ==', 'extended_login': True, 'trustToken': 'HSARMT……8DSRVX'}
11-04 23:15:37 ICLOUD
🔻 <<REDACTED>>, POST, RESPONSE, _AUTHENTICATE_WITH_TOKEN/847 
❗   items={'code': 200, 'ok': True}
❗   data.items={'hsaTrustedBrowser': True, 'hsaChallengeRequired': False}
❗   data.dsInfo={'lastName': '<<REDACTED>>', 'dsid': '<<REDACTED>>', 'hsaEnabled': True, 'locale': 'de-de_DE', 'hsaVersion': 2, 'locked': False, 'appleIdEntries': [{'isPrimary': True, 'type': 'EMAIL', 'value': '<<REDACTED>>@…………'}], 'fullName': '<<REDACTED>>', 'appleId': <<REDACTED>>', 'firstName': 'Tobias', 'statusCode': 2, 'familyEligible': True}
❗   data.webservices={'findme': {'url': 'https://p146-fmipweb.…………:443', 'status': 'active'}, 'contacts': {'url': 'https://p146-contactsws.…………:443', 'status': 'active'}}
11-04 23:15:37 ICLOUD  <<REDACTED>>, Authentication Successful, <<REDACTED>>Method-Token
11-04 23:15:37 ICLOUD  Apple Account Verification Code may be needed (450)
11-04 23:15:50 GETLOC ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                          ⡇   WATCH_ULTRA_TOBIAS, ICLOUD PREFETCH,  
                                          ⡇⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
11-04 23:15:50 GETLOC ⡇ watch_ultra_tobias > Located > iCloud-23:00:33 → 23:01:05, Old, 15 mins ago
11-04 23:15:50 GETLOC ⡇⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
                                          ⡇   WATCH_ULTRA_TOBIAS, ICLOUD PREFETCH,  
                                          ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
11-04 23:15:55 ICLOUD  watch_ultra_tobias > Located > iCloud-23:01:05 → 23:15:54, 63% → 62%
11-04 23:15:55 LOCATE  watch_ultra_tobias > Located > iCloud-23:15:54 (1 secs ago)
11-04 23:15:55 ICLOUD  watch_ultra_tobias > Trigger > Next Update Time Reached
11-04 23:15:55 ICLOUD ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
                                          ⡇   WATCH_ULTRA_TOBIAS-⸨<<REDACTED>>⸩, ICLOUD, NEXT UPDATE TIME REACHED 
                                          ⡇⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
11-04 23:15:55 iCloud3 v3.1
Traceback (most recent call last):
  File "/config/custom_components/icloud3/support/zone_handler.py", line 318, in is_same_or_overlapping_zone
    Zone1 = Gb.Zones_by_zone[zone1]
            ~~~~~~~~~~~~~~~~^^^^^^^
KeyError: 'ic3_stationary_1'

11-04 23:15:55 ICLOUD ⡇ watch_ultra_tobias > Zone > home(1)-5m > GPS-(49.30199, 8.50761/±8m)
11-04 23:15:55 ICLOUD ⡇ watch_ultra_tobias > Results > NextUpdate-23:30:55, Moved-12m , Battery-62%, ×Went3km
11-04 23:15:55 ICLOUD ⡇⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂⠂
                                          ⡇   WATCH_ULTRA_TOBIAS-⸨<<REDACTED>>⸩, ICLOUD, CURRZONE-HOME 
                                          ⡇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
gcobb321 commented 3 weeks ago

That is in the routine that determines if 2 zones overlap. In this case, the stationary zone (zone1)_ does not exist so it does not overlap. I added a check for that so you don't get an unneeded error message.