iCloud3 v2.2.1 Device Tracker-Advanced tracking features, iOS App monitoring

So I’m going to delete that “original” folder. Then restart HA.

Looks like that fixed it. Thank you, Gary.

Gary,

very nice add-on that worked flawlessly (albeit the rather painful setup ;-).

May I suggest some install docs for the beginner (that went the HASS OS + HACS + “Find my” path)? I volunteer for the beginner docs.

Anyway, I recently noticed that on all three iPhones I get odd notifications at random times (“X left home” with “X arrived home” a minute or less later). I have installed the logger but have a hard time interpreting the data.

My setup is hopefully pretty forward, the automation to notify me …

- id: '1609014775930'
  alias: Notify when someone enters or leaves a zone
  description: Notify when someone enters or leaves a zone
  trigger:
  - platform: state
    entity_id: person.stefan
  - platform: state
    entity_id: person.anna
  - platform: state
    entity_id: person.julia
  condition:
  - condition: template
    value_template: '{{ trigger.from_state.state != trigger.to_state.state }}'
  action:
  - service: notify.mobile_app_swaiphone
    data:
      title: Location update {{ states.sensor.time.state }}
      message: '{{ trigger.to_state.attributes.friendly_name }} {% if trigger.to_state.state
        == ''not_home'' %} has left {{ trigger.from_state.state }}{% endif %}{% if
        trigger.from_state.state == ''not_home'' %}arrived at {{ trigger.to_state.state
        }}{% endif %}'

My configuration wrt device trackers

- platform: icloud3
  username: !secret icloud_name
  password: !secret icloud_password
  tracking_method: famshr
# for us europeans
  unit_of_measurement: km
  track_devices:
    - swaiPhone
    - jphone
    - iphone_von_anna

Each person

  • has the iOS Companion App installed,
  • is only tracked (Configuration | People) by one device, e.g. device_tracker.swaiphone
  • has another entry in HA like device_tracker.swaiphone_haca which was the one that the Companion App created (I think).

The more I read the docs the less I am convinced to use trigger.from_state.state != trigger.to_state.state as an indicator for changing zones…

Lastly, here is the export of an example, where a person left home for 5s.

iphone_von_anna	20:15:10	Home	Home	2 hrs	-	0 km	Sending location request to iCloud > Last Updated-18:02:34 (2.7 min ago)
iphone_von_anna	20:15:15	Home	Home	2 hrs	-	0 km	Next Update Time reached > iphone_von_anna
iphone_von_anna	20:15:15	Home	Home	2 hrs	-	0 km	FamShr update started (Next Update Time reached)
iphone_von_anna	20:15:15	Home	Home	2 hrs	-	0 km	Updating Device > GPS-(XX.398453, YY.688812)/12m), Located-18:02:34 (2.2 hrs ago)
iphone_von_anna	20:15:15	Home	Home	2 hrs	-	0 km	Selected Zone > Away > aaaa-2.71km/r40, Holderlin-1.47km/r62, Golfclub-12.86km/r970, Praxis-27.2km/r48, Home-5.72km/r100, Stationary-6.22km/r1
iphone_von_anna	20:15:17	Home	Away	2 hrs	-	0 km	Waze Route Failure > No Response from Waze Servers, Calc distance will be used
iphone_von_anna	20:15:17	Home	Away	2 hrs	-	0 km	$$Stat Zone > Reset Timer, MovedOverLimit-True, ResetTimer-True, Moved-5.72km, Timer-00:00:00,  to 20:23:15
iphone_von_anna	20:15:17	Home	Away	2 hrs	-	0 km	$$Distance Data > DirOfTrav-left_zone, LastDirOfTrav-in_zone, DistFmZone-5.72km, LastDistFmZone-0m, DistFmZoneMoved-5.72km, DistFmLastPollMoved-5.72km
iphone_von_anna	20:15:17	Home	Away	2.5 min	-	0 km	$$Interval Results > Interval-2.5 min (5ni-NeedInfo), LastUpdate-20:15:15, NextUpdate-20:17:45, DistTraveled-5.72km, CurrZone-not_home
iphone_von_anna	20:15:17	Home	Away	2.5 min	-	5.72 km	Results: From-Home > CurrZone-Away, GPS-(XX.398453, YY.688812)/12m), Interval-2.5 min, Dist-5.72 km, TravTime- (not_set), NextUpdt-20:17:45, Located-18:02:34 (2.2 hrs ago), OldLocThreshold-1 min, WillMoveIntoStatZoneAfter-20:23:15 (0m)
iphone_von_anna	20:15:18	Home	Away	2.5 min	-	5.72 km	FamShr update completed
iphone_von_anna	20:15:20	Home	Away	2.5 min	-	5.72 km	$$iOSApp Monitor > Trigger-Region Entered@18:15:15 (2h0m5s ago), State-home@18:15:14 (2h0m6s ago), GPS-(XX.420807, YY.759856)/65m), LastiC3UpdtTime-20:15:15, WillUpdate-True, Trigger Change-Region Entered
iphone_von_anna	20:15:20	Home	Away	2.5 min	-	5.72 km	iOSApp Trigger Change detected > Region Entered
iphone_von_anna	20:15:20	Home	Away	2.5 min	-	5.72 km	$$Device Monitor > UpdateMethod-IOSAPP, UpdateReason-Trigger Change, State-home, Trigger-Region Entered, LastLoc-18:15:15, Zone-home, HomeDist-24m, inZone-True, GPS-(XX.420807, YY.759856)/65m), StateThisPoll-home, StateLastPoll-home
iphone_von_anna	20:15:20	Home	Away	2.5 min	-	5.72 km	iOS App update started (Trigger Change)
iphone_von_anna	20:15:20	Home	Away	2.5 min	-	5.72 km	Selected Zone > Home > aaaa-5.2km/r40, Holderlin-4.47km/r62, Golfclub-9.18km/r970, Praxis-25.97km/r48, Home-0m/r100, Stationary-0.98km/r1
iphone_von_anna	20:15:20	Home	Home	2.5 min	-	5.72 km	$$Distance Data > DirOfTrav-in_zone, LastDirOfTrav-not_set, DistFmZone-0m, LastDistFmZone-5.72km, DistFmZoneMoved-0m, DistFmLastPollMoved-0m
iphone_von_anna	20:15:20	Home	Home	2 hrs	-	5.72 km	$$Interval Results > Interval-2 hrs (4ihz-InHomeZone), LastUpdate-20:15:20, NextUpdate-22:15:15, DistTraveled-0m, CurrZone-home
iphone_von_anna	20:15:20	Home	Home	2 hrs	-	0 km	Results: From-Home > CurrZone-Home, GPS-(XX.420807, YY.759856)/65m), Interval-2 hrs, Dist-0 km, TravTime- (in_zone), NextUpdt-22:15:15, Located-18:15:14 (2 hrs ago), OldLocThreshold-3 min
iphone_von_anna	20:15:21	Home	Home	2 hrs	-	0 km	IOS App update complete
iphone_von_anna	20:15:25	Home	Home	2 hrs	-	0 km	$$iOSApp Monitor > Trigger-Region Entered@18:15:15 (2h0m10s ago), State-home@18:15:14 (2h0m11s ago), GPS-(XX.420807, YY.759856)/65m), LastiC3UpdtTime-20:15:20, WillUpdate-False, Already Processed
iphone_von_anna	20:15:25	Home	Home	2 hrs	-	0 km	$$Device Monitor > UpdateMethod-None, UpdateReason-OlderTrigger-Region Entered@18:15:14, State-home, Trigger-Region Entered@18:15:14, LastLoc-20:15:20, Zone-home, HomeDist-24m, inZone-True, GPS-(XX.420807, YY.759856)/65m), StateThisPoll-home, StateLastPoll-home

-Stefan

Lemme add to the previous post: https://gcobb321.github.io/icloud3/#/chapters/2-sensors?id=zone-exits-due-to-gps-wandering. That pretty much says it all, doesn’t it?

Any idea to notify any zone change of any person?

@swa72
GPS wandering has always been an issue. iCloud3 does what it can to prevent it.

iCloud3 tracks devices, not people. That’s how iCloud Location Services works. Person tracking is a Home Assistant thing. The problem you run into is 2 devices associated with the person and the person leaves one device at home and goes to the store. Home Assistant says the person is at home because a person’s device is at home. It should be the person it’s away because one of the person’s devices is away. The solution is it not use person in Home Assistant but create your own binary sensor to monitor if a person is home or not home.

Glad you found that in the docs before i pointed to it.

iCloud3 v2.3 is officially released. It is available on HACS or on the iCloud3 GitHub repository’s Releases page.

As I do with all major releases, I am closing this forum page. The new iCloud3 v2.3 forum can be found here. Go there for a list of enhancements and to post issues or questions.

Thanks to all who have helped test the changes.

Gary Cobb, aka GeeksterGary

1 Like

@gcobb321 Hi Gary, it appears that distance is being calculated based on waze distance and used in the following sensors… sensor.xxxx_badge , sensor.xxxx_zone_distance & sensor.xxxx_waze_distance even though the distance_method: parameter in my config_ic3.yaml has been commented out.

sensor.xxxx_calc_distance however appears to be calculated differently and appears not to be used in sensor.xxxx_badge as was the case in previous releases.

In my case, waze_distance v.s calc_distance are a factor of 2 magnitude different hence my concern.

iCloud3 v2.2.1 Device Tracker-Advanced tracking features, iOS App monitoring

Thank you!
Ps: currently on V2.3 released

@bastero
The distance_method defaults to waze so waze is used to calculate the distance when it is not specified. If you want to not use waze, use distance_method: calc.

I just changed my home zone to Atlanta (about 500 miles from home) to test it.
Using distance_method: calc:

  • sensor.gary_iphone_waze_distance = NotUsed
  • sensor.gary_iphone_calc_distance = 478
  • sensor.gary_iphone_zone_distance = 478

Using distance_method: waze (actually commenting it out)

  • sensor.gary_iphone_waze_distance = 540
  • sensor.gary_iphone_calc_distance = 478
  • sensor.gary_iphone_zone_distance = 540

So it appears iCloud3 is working as it should.

@gcobb321 Thank you, yes it appears that the default changed from calc to waze in this release. I have specifically defined distance_method: calc and changed Home zone to ‘Atlanta’ for testing purposes.

This distance results make sense now. Thanks again for this great component and support, its awesome!!

Cheers

@bastero
Glad you got it working. As I recall, the default has always been waze going back to v1.?

Question with regards the the Waze calculator. WazeRouteCalculator can’t be brought into HasOS (I’m assuming) so is there way to leverage the built in Waze Travel Time component?

iCloud3 does not use the HassOS Waze calculator. It requests the travel distance & time directly from Waze. The Waze servers are US, NA (North America), EU and IS (Israel)

The documentation refers to the Waze Route Calculator Component? Out of date?

https://gcobb321.github.io/icloud3/#/chapters/2.1-config-parms?id=waze-configuration-items

Poor description. It was referring to a standard Python library, not the HassIO component. I probably wrote it 2-years ago and have not looked at it since then.

Everything with Waze is handled automatically. You do not need to do anything to use it.

Gotchya.

I’m trying to configure another set of zone sensors for work. If I’m reading the documentation right it says to add a zone: parameter to the device settings, i.e. zone: work (work is a HASS zone). But its throwing an error in the log:

    devices:
      - device_name: jiphone
        name: Jay iPhone
        email: [email protected]
        zone: work

Am I misinterpreting the documents?

The parameter is track_from_zone, not zone

Gary thanks so much for this integration. Quick question…I occasionally get random 2FA requests. There’s nowhere to put the code in, right? Anyway unless I’ve just restarted Home Assistant (and am thus expecting one) I deny them. Does that sound normal? I always approve the request I get when I’ve just restarted HA because the request makes sense.

What version of iCloud3 are y you running?

Gotchya, that worked. However the distance to my work being reported is off by over 2KM from what is reported by waze.com. I believe it may be still reporting in miles since it’s reporting “3.65 KM” when the distance is actually 3.7 M or 5.8 KM.

Ok, setting waze_region: US changes the units to KM. I had it set to wave_region: NA initially which looks like it ignores the unit_of_measurement: setting.