iCloud3 v3 iDevice Tracker - Version 3

While it does show up in the ‘Find My’ app, in Apple nomenclature they consider the AirTag an ‘Item’ not a Device. Strangely enough, I can see it in the app, but not in the browser version which only shows devices.

I did have some success (which I’ve now render inoperable for unknown reasons) seeing the tag by name come into HA, there were no attributes or details about the tag. I believe additional work will be required to parse the data, if the API even allows it. With the integration not showing up in the integration screen it’s pretty hard to keep track of it and it’s settings and entities.

Hi all,
i’ve installed using HACS iCloud3 components, I’ve configured it as follow:

configuration.yaml
  - platform: icloud3
    username: !secret icloud_smr_u
    password: !secret icloud_smr_p
    tracking_method: icloud

config_ic3.yaml
  - device_name: iPhone di SMR
    name: iphone_smr
    email: [email protected]
    noiosapp: true

but i’m not able to retrieve the location of the device. In HA, device_tracker and sensor are created as entity but not update. Looking log i’ve found:


in RESPONSE_DATA message
"batteryStatus":"Charging",
"location":{
   "isOld":false,
   "isInaccurate":false,
   "altitude":0.0,
   "positionType":"Cell",
   "secureLocation":"None",
   "secureLocationTs":0,
   "latitude":45.744085160600035,
   "floorLevel":0,
   "horizontalAccuracy":65.0,
   "locationType":"",
   "timeStamp":1621514584241,
   "locationFinished":false,
   "verticalAccuracy":0.0,
   "locationMode":"None",
   "longitude":9.815004973187013
}

and after

2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆UPDATE LOC DATA (FAMSHR) > None, name-iPhone di SMR, id-kHdvkqjADYA3Gyp5TuFXaTI4Sf/DhVFiSn400TfzbfMgcT5Qud45duHYVNSUzmWV from-iphone_di_smr
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆UPDATE LOC DATA (FAMSHR) > None, name-AirPods Pro di SMR, id-VATNiH8ZT3vNfpOCQWc/8ESGYf4iDKhwa2jPAdGMVheLzc3GuKQF1llRt8WEfgnFyCiOV8S0xSiclUgpQJf5BeHYVNSUzmWV from-iphone_di_smr
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆UPDATE LOC DATA (FAMSHR) > None, name-iPhone di SMR, id-Cqy9Jwq8nXRUiuFVok2QGmEU2WI0R+Awi7mxiFvihSk= from-iphone_di_smr
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆SETUP BASE KWARGS zone_name-None, inzone-state-True
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆WRITE Attrs ___ (DetIntlErrorRetry)
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆WRITE Last State-not_set, This State-not_set
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆WRITE Attrs-{'gps': (45.150707071895155, 9.487875681370499), 'battery': 0, 'gps_accuracy': 0}{'interval': '1 min', 'poll_count': '0:0:7', 'last_update': '2021-05-20 14:44:00', 'next_update': '2021-05-20 14:45:00', 'info': '● No location data (#7) ●', 'timestamp': '2021-05-20 12:44:00', 'name': 'iphone_smr', 'trigger': 'NextUpdateTime (Retry)@00:00:00'}

So, position in JSON seem to be correctly reported …but wrong in ‘WRITE Attrs’

Anyone could help me?

thanks in advance
Regards
Stefano

Hi all,
sorry for other question … i’m trying to use ‘icloud3-event-log-card’ … but lovelace seems that don’t load it …

in lovelace mail file:

mode: yaml

resources:
  - url: /hacsfiles/icloud3-event-log-card/icloud3-event-log-card.js?v=1.000
    type: module
  - url: /hacsfiles/entity-attributes-card/entity-attributes-card.js
    type: module

in lovelace view file:

  - type: horizontal-stack
    cards:  
      - title: iCloud Event Log
        icon: mdi:information-outline
        cards:
          - type: "custom:icloud3-event-log-card"
            entity: sensor.icloud3_event_log

and here where i’ve store lovelace resources

~homeassistant/.homeassistant/www/community/icloud3-event-log-card ❯ ls -la
total 96
drw-rw-rw-  2 homeassistant homeassistant  4096 May 20 15:38 .
drwxr-xr-x 16 homeassistant homeassistant  4096 May 20 11:50 ..
-rw-rw-rw-  1 homeassistant homeassistant 71855 May 20 11:51 icloud3-event-log-card.js
-rw-rw-rw-  1 homeassistant homeassistant 12880 May 20 15:38 icloud3-event-log-card.js.gz

Anyone could help me?

Thanks in advance
Stefano

The device_name configuration fields should be with the devices: parameter. There is an example here.

config_ic3.yaml

devices:
   - device_name: iPhone di SMR
     name: iphone_smr
     email: [email protected]
     noiosapp: true

[/quote]

Hi @gcobb321 thaks for you suggestion, taking a look at the log I’ve discovered that

2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆UPDATE LOC DATA (FAMSHR) > None, name-iPhone di SMR, id-kHdvkqjADYA3Gyp5TuFXaTI4Sf/DhVFiSn400TfzbfMgcT5Qud45duHYVNSUzmWV from-iphone_di_smr
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆UPDATE LOC DATA (FAMSHR) > None, name-AirPods Pro di SMR, id-VATNiH8ZT3vNfpOCQWc/8ESGYf4iDKhwa2jPAdGMVheLzc3GuKQF1llRt8WEfgnFyCiOV8S0xSiclUgpQJf5BeHYVNSUzmWV from-iphone_di_smr
2021-05-20 14:44:00 INFO (SyncWorker_4) [custom_components.icloud3.device_tracker] ◆iphone_di_smr--◆UPDATE LOC DATA (FAMSHR) > None, name-iPhone di SMR, id-Cqy9Jwq8nXRUiuFVok2QGmEU2WI0R+Awi7mxiFvihSk= from-iphone_di_smr

are present 2 devices with the same name … after cleaning the situation, removing the old iPhone, every seems to work fine, without any modification to config file.

The only open point rightnow is the usage of ‘icloud3-event-log-card’.

Thanks again for you great add-on

Regards
Stefano

I think I may have got the config parameters updated to the new ones. Looks like things have changed a bit over the past few months.

I have two questions: 1) How do I set up the driving_flag so it works? and 2) How do I get the script fixed so I don’t have the error saying the restart script is missing as shown in the screenshot?

image

I’ve installed icloud3, the config file and the lovelace card. I get “no tracked devices error” with no mesages.

My devices list has two entries…two phones. Findmy is on and active on both phones.

phone 1 shows the in “friends in the findmyapp data that can be located”…neither phone has ios installed.

my device list is:

name: MW phone  (which is what is shown on the phone (general/about) 
email: is the email shown in the events log 
iosapp_installed: False

That phone isn’t loaded as being tracked.

The second phone is shown in family sharing list with the name on the phone (settings/about)…and the email is shown in friends in the findmy app list.

name: as shown in the events log (and on the phone)
email: I've tried it with and without an...doesn't matter...isn't found
iosapp_installed: False

Neither phone is showing as tracked.

Maybe I’m confused about tracking vs findmyfriends??? my goal is to track via findmyfriends.

@ghstudio
The trouble shooting section here in the iCloud3 docs has some information on the ani Devices To Track problem. If nothing helps, on the Event Log, select Actions > Export Event Log and email the icloud3-event-log.txt file and your configuration files to [email protected] I’ll look at them and see if I spot anything when I get a chance.

@Allistah
There is a script in the 3.2 sample Automations and Scripts chapter in the iCloud3 docs here that shows how the driving flag is set.

They HA restart script is probably in the Lovelace card card somewhere. You will need to delete it from the Lovelace card and that error will be corrected.

user error…i put devices in config_ic3 not config_ic3.yaml

Hi Gary! :slight_smile:

Is there any way to get a notification if a tracked device goes to an error or paused state? Then I could setup an automation to kick start them?

many thanks!!

For some reason now that I’ve updated to 2.4 and fixed the tracking of myself and my wife, it doesn’t detect that we’ve left for a really long time - sometimes 30 minutes, sometimes well over an hour.

Any idea what I’m doing wrong?

Here is my config:

#-- iCloud3 Settings -----------------------------------------
device_tracker:
  - platform: icloud3
    username: [email protected]
    password: <snip>

    tracking_method: icloud

    devices:
      - device_name: jp16_iphone
        email: [email protected]
        picture: jaime.png
        iosapp_suffix: ha_app
        iosapp_entity: device_tracker.jp16_iphone_ha_app
        noiosapp: true
        #track_from_zone: <additional_track_from_zone(s)>

      - device_name: mrs_ps_iphone
        email: [email protected]
        picture: tammy.png
        iosapp_suffix: ha_app
        iosapp_entity: device_tracker.mrs_ps_iphone_ha_app
        noiosapp: true
        #track_from_zone: <additional_track_from_zone(s)>

      
    #-- General Parameters -----------------------------------------
    #group: famshr
    event_log_card_directory: 'www/custom_cards'
    #config_ic3_file_name: '/config/config_ic3.yaml'

    #-- Formatting Parameters---------------------------------------
    unit_of_measurement: mi                 #Default: km
    time_format: 12                         #Default: 24
    display_text_as:
        - [email protected] > [email protected]
        - [email protected] > [email protected]

    #--Zone/Tracking Parameters-----------------------------------------
    inzone_interval: '2 hrs'                #Default: 2 hrs
    max_interval: '4 hrs'                   #Default: 4 hrs
    center_in_zone: False                   #Valid values: True, False, Default: False
    stationary_inzone_interval: '30 min'    #Default: 30 min
    stationary_still_time: '8 min'          #Valid values: Number. Default: 8
    stationary_zone_offset: 1, 0            #Default: 1, 0
    travel_time_factor: .6                  #Default: .6
    distance_method: waze                   #Valid values: waze, calc, Default: waze

    #--Waze Parameters-----------------------------------------
    waze_region: US                         #Default: US
    waze_min_distance: 1                    #Default: 1
    waze_max_distance: 9999                 #Default: 9999
    waze_realtime: True                     #Valid values: True, False, Default: False

    #--Accuracy Parameters-------------------------------------
    gps_accuracy_threshold: 125             #Default: 125m
    ignore_gps_accuracy_inzone: False        #Valid values: True, False, Default: True
    old_location_threshold: '2 min'         #Valid values: Number of minutes, Default: 2

    #-- Debug/Logging Parameters---------------------------------------
    #log_level: debug, eventlog, info
    #log_level: debug+rawdata, intervalcalc, eventlog, info
    #log_level: debug+rawdata
    #log_level: intervalcalc
    #log_level: eventlog
    #log_level: info

@Allistah
The noiosapp: true parameter says you are not using the iOS app, which issues the zone exit triggers, location triggers and others. Delete that parameter for both devices.

@daneboom
When a device is paused, the sensor.[devicename]_next_update_time will be set to PAUSED. You could use that as a trigger condition to fire a script or automation to issue a notification or execute one of the iCloud3 service calls to restart iCloud3.

1 Like

Thank you!

Thanks Gary… I changed that and restarted. I’m sure that will fix things up. Another question - in regards to ignore_gps_accuracy_inzone, I see the default is true so I assume that is the better setting to go with as far as accurate of entering/exiting zones?

Have just purchased an Apple Airtag and would love to use it. But if I understand correctly there’s no way (yet) to incorporate it into HA - whether via this integration or otherwise?

That is correct. Air tags can not be tracked. For more info on this, follow the discussion here.

That’s a shame. What about simple presence detection via local blutooth? (eg checking whether the car is at home)

Hey Gary,

I’ve had a couple of instances when my wife and I are both at home and suddenly I will get an announcement that one or both of us have left the house and then suddenly have arrived again. I have Alexa announce when we leave the house and arrive. Last night it happened in the middle of the night and my wife just didn’t hear it but I did. It also happened one time during the day.

So it must be triggering our zone from Home to Away or something and then auto-correcting itself right after. Any tips on how I could troubleshoot and/or fix that?