iCloud3 v3 iDevice Tracker - Version 3

@Snuffy2
What is your configuration.yaml or config_ic3.yaml?

configuration.yaml

[...]
device_tracker:
  - platform: icloud3
    username: my_appleid
    password: my_appleid_password
    event_log_card_directory: 'www/community/icloud3'
[...]

config_ic3.yaml

devices:
  - device_name: my_iphone
    email: my_appleid
    name: my_name
    iosapp_suffix: '_app'
  - device_name: wifes_iphone
    noiosapp: true
    name: wifes_name
  - device_name: sons_iphone
    noiosapp: true
    name: sons_name

@Snuffy2
You can set the devices to track to the other house in config_ic3.yaml using the track_other_zone parameter. Using that, it will track the ā€˜other_houseā€™ and the ā€˜homeā€™ zone

devices:
  - device_name: my_iphone
    email: my_appleid
    name: my_name
    iosapp_suffix: '_app'
  - device_name: wifes_iphone
    noiosapp: true
    name: wifes_name
    track_other_zone: other_house
  - device_name: sons_iphone
    noiosapp: true
    name: sons_name
    track_other_zone: other_house

One issue is not using the iOS App on the other devices. You will not get zone enter/exit and any location update triggers from the iOS App. When you leave a zone, the exit is not recognized until the next polling interval which could be 2-hours later. See here for more info.

I could not find script.gary_leaves_zone in the example docs. Also could you please provide your code for input_boolean.ha_started_flag in the example docs. Thanks, Stefan.

Thanks for the clarifications. I had missed the info in the documentation that you linked to.

As for track_other_zone, I had tried that previously and again when you mentioned it and I canā€™t seem to get it to work. It always throws an error.

iCloud3 Error decoding `/config/config_ic3.yaml` parameters > The following parameters can not be handled: track_other_zone: other_house

Iā€™ll private message you the actual log and config files with the real names as well.

#swa72
Itā€™s in Chapter 3.2 Sample Automations & Scripts here

There is a bug handling the unit_of_measurement: km parameter when it is specified in config_ic3.yaml and occurs when iCloud3 is restarted using Event Log > Actions > Restart iCloud3. The ā€˜kmā€™ is displayed correctly on the screen but the value is the miles value, not the km value.

This does not happen if:

  • the unit_of_measurement: km is specified in the configuration.yaml file
  • the unit_of_measurement: km is specified in the config-ic3 file and iCloud3 is restarted by restarting HA instead of using Event Log > Actions > Restart iCloud3

This has been fixed in v2.3.1 that is available in the v2.3.1 Development Directory here.

1 Like

I had checked that, just overlooked that gary_arrives_home, gary_leaves_home,gary_leaves_zone are all automations, while gary_status, gary_arrives_home and notify_gary_iphone are scripts. The flag input_boolean.ha_started_flag is used in these scripts - but the docs do not show how it is defined.

Here is another question: for some reason or the other my equivalent of script notify_gary_iphone does show only (mobile app) on my phone - no title and no message. Any idea, why?

notify_swaiphone:
  alias: 'Send Message to swa'
  sequence:
    - service: notify.mobile_app_swaiphone
      data_template:
        title: "{{ title }} (mobile_app)"
        message: "{{ message }}"

The section of the automation reads

  action:
  - service: script.notify_swaiphone
    data:
      data_template:
        title: Dammit
        message: 'Zone: foo --> foo , Distance: 1234'

It seems the parameters donā€™t get passed to the script.

@swa72
I would look in the documentation of the iOS app. Itā€™s been a while since Iā€™ve been there but there are examples of how to use the notify service. There might also be some info on the iOS app forum.

Thanks @gcobb321 for the fix!!

Thanks for the hint. Googled a bit and found a solution in

  action:
  - service: script.notify_swaiphone
    data:
      title: Dammit
      message: 'Zone: foo --> foo , Distance: 1234'

Note that there is no data_template.

@gcobb321 I wanted to take a moment to thank you for this outstanding extension! Itā€™s so much better than what is cooked into HA right now by miles (travel time TBD :slight_smile:).

Do you know what kind of impact the refreshes have on the battery of an iPhone? It seems like since I got this up and running that the iPhones drain significantly faster.

Thank you again!

Does the Travel Time sensor represent how far away ā€œas the crow fliesā€ or does it use intelligence to determine the travel time based on the fastest route along roads? I know this is a feed from Apple and not calculated by iCloud3, Iā€™m just wondering if anyone knows the answer to that.

@CO_4X4
Travel Time is not returned from Apple but returned from the Waze, along with the zone_distance value. The value is determined by passing the home (or other zone) gps coordinates and the gps coordinates from iCloud Location Services to Waze.

See a description about Waze here for more information.

1 Like

Hi, thanks for your app.

Iā€™ve got an error in the log, for the 2 devices iā€™ve declared.
iCloud3 Setup Error > iphonedeyohann > The iOS App device_tracker entity was not found in the Entity Registry for this device.
What did i miss?

Ok, iā€™ve read again the docs and found this:

The following parameters must be in the HA configuration.yaml file

    username/password
    tracking_method: iosapp (if using the iOS App tracking method, not needed for normal operations)
    create_sensors
    exclude_sensors
    entity_registry_file_name
    config_ic3_file_name

Here is my configuration.yaml:

#interdiction du log icloud3 dans HA History
recorder:
  purge_keep_days: 3
  exclude:
    entities:
      - sensor.icloud3_event_log
#paramĆØtres pour chaque device surveillĆ© par icloud3
device_tracker:
  - platform: icloud3
    username: xxxxx
    password: xxxx
#exclude_sensors: batstat,lzonn,lzont,name

  - platform: icloud3
    username: xxxx
    password: xxxxx
#exclude_sensors: batstat,lzonn,lzont,name

I donā€™t know how to write the missing parameters because the docs shows an example with only those params.
Thanks for your help.

@MoPepettes
Information about this can be found in the iCloud3 documentation in 1.6-configuring-starting-icloud and in 1.4-setting-up-iosapp.

All the other parameters can be specified in the config_ic3.yaml file described in 1.6-configuring-starting-icloud3.

iā€™m sorry, iā€™ve read several times but i donā€™t know what to do.

Here is the errors:

image

Iā€™ve activated those params:


# --Track Devices Parameters-------------------------------
devices:
  - device_name: iPhone de Yohann
    name: Yohann
    email: xxxxx
#    picture: gary.png
  - device_name: iPhone XR Christelle
    name: Christelle
    email: xxxxx
#    picture: lillian.png

#    noiosapp: False
    iosapp_suffix: _app
#    iosapp_entity: gary_iphone_app
#    zone: warehouse

event_log_card_directory: 'www/custom_cards'

I thought the iosapp_suffix would resolved the errors but no luck.

@MoPepettes
The device_name parameters are incorrect. They need to be:

  • iphone_de_yohann, not iPhone de Yohann
  • iphone_xr_christelle, not iPhone XR Christelle

The spaces in the name are removed instead of converting them to ā€˜_ā€™.

I was updating HACS to v2.3.1 but will make a change to accept the values you specified before I do the update.