iCloud3 v3 iDevice Tracker - Version 3

@gwp1
iCloud3 uses the General>About>Name to identify the iCloud device. If you change it there and do not change the iCloud3 configuration, iCloud3 will not be able to find it in the iCloud data and it will fail to be set up. Errors will be in the Event Log.

#3 in my previous reply has a link to the iCloud3 docs that describes the device name and how everything is tied together.

Ok, I’m clearly staring at this and missing the obvious.

General>About>Name: John Alan
Expectation is this translates to john_alan

config_iC3:
image

Work MBP shows up great, happy as a clam. It doesn’t have iOS app installed and the config notes that.

john_alan and johnwatch error with:

Looking in the Entity Registry in HA under Mobile App I cannot locate device_tracker.john_alan or device_tracker.johnwatch - HOWEVER - I see a device_tracker.iphone-2 which corresponds with the Name field in the iOS app itself, the suffix being from me uninstalling/reinstalling the iOS app a few minutes ago.

@gwp1
From the iCloud3 docs linked to above:
" When iCloud3 starts, it reads the HA Entity Registry file (config/.storage/core.entity_registry ) and searches for a mobile_app device_tracker entity beginning with the device to be tracked (gary_iphone ). If it finds the entity, the mobile_app device_tracker suffix is extracted and iCloud3 monitors that device_tracker entity (device_tracker.gary_iphone_2 ) for zone changes, trigger changes, etc."

What this section of the iCloud3 docs means is:

  1. The iCloud3 devicename must be the same on the iCloud Acct (General>About>Name" of the iPhone.
  2. The iosapp devicename must start with the iCloud3 devicename and have a suffix added to the end of it. iCloud3 searches for a mobile app device tracker entity that starts with the iCloud3 devicename. It will select it to be monitored.

Example:
iPhone & iCloud3 devicename = ‘john_alan’
iOS App devicename = ‘john_alan_2’ (or ‘john_alan_3’, ‘john_alan_app’, etc). the suffix doesn’t matter, it only hast to make it unique.

Since your iosapp starts with ‘iphone’, it will never be found by iCloud3 and tied to the iC3 devicename

1 Like

Well it took multiple uninstall/reinstalls of the iOS app on my phone before it stopped saying by default that the device name as configured in the app was iPhone. No more errors!

Thanks very much for your patience and guidance @gcobb321 - looking forward to seeing what this can do and how much clutter it can remove from my presence tracking.

Having real problems with my wife’s phone not sending updates for some reason. The app is running on her phone, it’s set to ‘always’ - any ideas what I can check to debug? My phone works fine!
Thank you

image

@daneboom
It may have been unloaded and it’s not actually running in the background. I would open and force close the shop. Then return it again. That should trigger a ‘load’ update and iCloud3 should pick that trigger up. If it doesn’t, do a ‘pull downI’ on the iOS app screen to trigger a location update. Aldo, go thru the location and privacy settings on booth phones and make sure the settings are the same.

Is there any way to disable “Stationary” zone? I want either “Home”, “Away” or already created zones only.

Set the Stationary still time parameter to a very large number so the device will never be in the same place for that amount of time. Example: stationary_still_time: 99999

1 Like

Thank you Gary! I have a question. Why battery entities don’t report status for the people who aren’t on my family list but I can see their battery information on Find my app. Is that normal behavior?

I installed 2022.7.3 this evening and my iC3 stopped working. Rolled back to 2022.7.2 and iC3 is back up again.

Is there a breaking change in 2022.7.3 regarding iC3?

Apple does not return battery info for Find my devices.

@gwp1
No problems I know of. Any error messages in the HA log or iCloud3 Event Log? Sometimes iCloud is slow to provide devices at startup so you get a ‘No Devices to Track’ error. An Event Log > Actions > Restart iCloud3 fixes that.

Resolved - after the backup restore everything worked normally. I proceeded next day to retry the latest HA update 2022.7.3 and afterward there were no issues. I suspect the update didn’t deploy as expected and this was the issue. Multiple updates following have shown no issues.

For the last 2 days I have been bombarded with Apple 2FA messages on my phone. Rather annoying when at work.

I’ve had the 2FA notification pop up a few times in HA asking for new password and the 2FA code, I enter in the details and it either goes away or asks again for the 2FA code, but I continue to get the alerts on my phone.

Any clue as to what is going on here? Thanks.

@cjsimmons When programs (not to be confused with iOS apps), Log into your account, they keep the ‘session’ alive for about 1/2-hour, then the program is required to sign in again. It already knows that program is authorized because the 2fa code was entered at some time. When a program logs in, Apple sends an email letting you know about the sign in. There is nothing iCloud3 can do about this and it’s very annoying.

I have set up a filter in my email (gmail) that filters those messages from Apple and send them to the trash folder, marks them as read and bypasses the inbox.

@gcobb321 thanks for that. I understand the emails and how/why they are sent. The emails are not the issue.

The issue I’m having is the popup alert on my phone (which is also on my other devices too). The one that says that someone is trying to log in and shows a map with the location. You can either allow or decline. If you allow, you get the 6 digit code for 2FA.

This alert keeps happening. It’s rather annoying as it’s constantly on my watch too. LOL.

It seems that the integration needs to be reconfigured. I’ve done it a few times over the last few days, but it doesn’t seem to reconfigure. I enter in my password to reauthenticate and I get the alert on my phone with the 2FA code, but in HA, the notification to enter in the 2FA code does not appear. It could be an hour before it appears.

@cjsimmons Try resetting the iCloud interface using Event Log > Actions > Reset iCloud Interface. This will erase the cookies and session files and then force the 2fa request that should show up in the HA Notifications.

HI @gcobb321
I am trying to use your icloud3 integration especially because of the ability of tracking family and friends as well.

However, I struggle with the Event Log installation (I have followed the instructions and read tons of threads, but still have problems.).
Although I must admit that I am new to HA (migrated from openhab).

What I did:
I copied the icloud3-event-log-card.js to my /config/www/community/lovelace-icloud3/
(there is no .gz file in the /custom_components/icloud3 I could copy over as suggested in some posts)
Changed the configuration-yaml and config_ic3.yaml as suggested in the docs (and obviously it works as I get updates from my phone).
Changed the recorder settings according to the docs (exclude the event_log).
Installed the lovelace resource manually (Example using ‘www/community’):

# icloud3 Eventlog
lovelace:
  mode: yaml
  resources:
  - url: /local/community/lovelace-icloud/icloud3-event-log-card.js
    type: module

Anyway - please allow some questions:

  1. Is the Eventlog required for icloud3 to work?
  2. How to trigger the 2fa in HA?
    I get the notification on my phone to allow the access, but there is no HA popup asking for the code.
    (I was using the standard icloud integration before and uninstalled it)
  3. I don’t see a device_tracker... entity from my phone although I see the others like sensor.iphone_calc_distance
    Shouldn’t this be available?
    I need this to assign this to the family members (like other tracking devices)

EDIT:
I made some progress and would like to share my experience here.

@gcobb321 (just a suggestion)
Regarding the eventlog procedure (and it’s position in the documentation), I think, that it would make it much easier for the (unesperienced) user to configure icloud3 first and start it before taking care of the eventlog.
The reason is that the icloud3-event-log-card.js is copied automatically without any additional manual step.
(I know it’s mentioned in the docs but the other way around (first icloud config, then taking care of the eventlog installation) would make more sense from my perspective.

Anyway:
I just deleted the icloud3, removed the detected devices from know_devices.yaml, removed the dashboard resource and restarted HA.
Then I:

  1. Re-installed icloud3
  2. configured it in configuration.yaml per the documentation
  3. configured the devices in the config_ic3.yaml
  4. restarted HA
  5. added the icloud3-event-log-card.js to the dashboard resources
  6. Added the following card to the new view:
type: custom:icloud3-event-log-card
entity: sensor.icloud3_event_log

and the card finally was accepted.

Possibly i’t not a great finding - but starting from scratch with the icloud3 did help in my case right away.

@gcobb321
Thank you very much for your contribution and the awesome integration of the icloud!

@gcobb321 I did try that earlier, but got smashed with the 2FA alerts on my phone while at work today. When I got home I had the reconfigure message again, so did that and this time the 2FA notification in HA where you put in the code appeared straight away. So far it seems fine. No more messages.

Thanks for your help. :slight_smile:

1 Like

@gcobb321 I love this integration and it works perfectly, but only for my iphone. I can’t get it to identify or locate any of my gf/friends fmf devices. Any help would be greatly appreciated! I’m sure I am overlooking something but I cant find it after 3 days. (Sorry if this is hard to read, this is my second post on this forum)

This is my config:

CONFIG_IC3:

devices:
  - device_name: my name on iphone
    email: apple id
    name: me
    iosapp_suffix: _app
  - device_name: gf name on iphone
    email: gf apple id
    inzone_interval: 1 mins
    name: gf
    iosapp_suffix: _app
    #picture: tracked_person_picture
    #iosapp_entity: tracked_person_iosapp_entity_name

CONFIGURATION:

####  icloud3 ###

recorder:
  purge_keep_days: 3
  exclude:
    entities:
      - sensor.icloud3_event_log

device_tracker:

  - platform: icloud3
    username: My apple ID
    password: Apple ID Password
    tracking_method: fmf
    create_sensors: zon,zonn,ttim,zdis,cdis,wdis,nupdt,lupdt,info`
    exclude_sensors: zont,zonfn,lzont,lzonfn,zonts,bat
    event_log_card_directory: "/config/www/community/icloud3-card"
    config_ic3_file_name: "/config/config_ic3.yaml"
    #logger:
    #default: info

Errors from Event log:

Thank you!