iCloud3 v3 iDevice Tracker - Version 3

@Alexandre451
iCloud3 gets the time from the Python time which is either the HA time or the time on your HA computer.

  1. Check the time zone in the HA config. Select the round button with your initials at the bottom of the HA Sidebar on the left. Scroll down for your time zone.
  2. Also check the time zone of the HA server itself. I’m not sure how to do that.
  3. Check the Config > Away Time Zone screen and verify that all of the devices are u using the HA Time Zone.
1 Like

@DuncanIdahoCT
See iCloud3 User Guide here and check the Event Log > Actions > Send Find My Phone Alert to iCloud

Thanks for responding, yes this time I did actually fully review the docs and even peeked into the code and found all the available services and actions but although pyicloud provides for find/lost/message the icloud3 code only “provides” access to find and lost most. Tinkering a bit I was able to repurpose your lost mode service to just call display_message in the pyicloud code which works for me but perhaps you could look at adding the 3rd service for just display messages, custom messages don’t seem possible with Find My iPhone even though the pyicloud code hints that it does I don’t think it actually can.

@DuncanIdahoCT
If you have been tinkering with the code, those changes will be wiped out on the next update.

The best way to suggest new features is to add a new issue here with ‘Feature Request - WhatYouWouldLikeAdded’ as the title, along with an explanation

1 Like

Yes of course, I did consider that. I’ll make a feature request, was more curious if you didn’t include all three of those pycloud methods for a reason, so I wanted to see if it would work at all and it does. I’ll put in an issue/feature request

Thanks fixed

Hi, I got bored :wink: and created a fork in my own Git and added the functionality for pyicloud (display_message) and tested it, I can’t claim it’s fully ready to merge and I’ve never really done this before where I’ve even attempted to contribute to another’s code but if it helps you by reviewing the commits I’ve made maybe you’ll see how simply it is to add into your own work or maybe even merge as is. I would be overjoyed to have officially contributed but that’s not the important thing for me.

Hello, in the state attributes of a device there is a section where is gives the Distance_to and other device, for example the distance between me and my wife. in meters of KM. How can I make that distance into a sensor? or an entire?

@Alexandre451
Create a template sensor. See here about that. Also, Google Home Assistant Template Sensor for more info and you will probably find some examples of what you want to do.

Is it possible to track a device (iPhone) without having the HA Companion App installed on it?

@BeastHouse
Yes, you do not need the HA Companion App. See iCloud3 docs here for more info about not using the app.

1 Like

Thanks Gary, that link didn’t work, are you able to point me to the right place? I didn’t have much luck finding it, and the Location Data Sources section of the documentation doesn’t have any links to click on.

Is there a longer timeframe or indefinite time you can set on the auth part of this?
Sometimes at inconvenient points the app wants to reauth and I get an alert all over my iPhone, iPad, Watch work phone all at once.

Last time this happened was about 2am and I thought I was being hacked etc.

Can it be pre-empted and diarised to avoid this?

@BeastHouse
Select the (?) iicon at the top right on the Event Log to go to the iCloud3 docs. Then select Mobile App Integration in the menu on the left.

@Calzor_Suzay
Apple determines when a reauthentication is needed and I do not know any way to predict when it will occur. Typically, it is every 2 months. You could go to the Configure > Enter/Request Verification Code screen and request a new code every month when it is convenient for you.

Over the last week one of my two configured accounts has been getting daily emails that the Apple ID was used to sign in through a browser.

I know this was previously an issue but I thought it was resolved on later versions. Do you know why this would be happening and especially only to one device?

Thanks

@TeaPot91
The Apple account verification process is controlled by Apple.I have never determined why there are timing differences between accounts, why the time on the email is different than when the password authentication was done or how to predict when a new verification code will be needed.

When trying to make a dashboard I get this error:

An error occurred creating the `lovelace.dashboard...` file. The dashboard code that was created is not valid json code.

Any idea what might be going on?

The log says:

05-08 05:53:33 [dashboard_bu:0136] ------ Error Preparing Dashboard, Invalid Json string > {“version”: 1, “minor_version”: 1, “key”: “lovelace.ic3db_template_master”, “data”: {“config”: {“views”: [{“title”: “Main”, “path”: “main”, “type”: “sections”, “max_columns”: 2, “icon”: “”, “cards”: , “sections”: [{“type”: “grid”, “cards”: [{“type”: “horizontal-stack”, “cards”: [{“type”: “vertical-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “device_tracker.jeffs_iphone_icloud3”, “name”: “Jeff"s iPhone”}, {“entity”: “sensor.jeffs_iphone_icloud3_arrival_time”, “name”: “Arrive”}, {“entity”: “sensor.jeffs_iphone_icloud3_home_distance”, “name”: “Distance”}, {“entity”: “sensor.jeffs_iphone_icloud3_travel_time”, “name”: “TravTime”}, {“entity”: “sensor.jeffs_iphone_icloud3_next_update”, “name”: “NextUpdt”}], “state_color”: true}]}]},{“type”: “vertical-stack”, “cards”: [{“type”: “tile”, “entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Jeff"s iPhone”, “features_position”: “bottom”, “vertical”: false}], “grid_options”: {“columns”: 4, “rows”: “auto”}}]}, {“type”: “grid”, “cards”: [{“type”: “custom:icloud3-event-log-card”}]}]}, {“title”: “Other Devices”, “path”: “other-devices”, “type”: “sections”, “max_columns”: 2, “icon”: “”, “cards”: , “sections”: [{“type”: “grid”, “cards”: [{“type”: “vertical-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “device_tracker.jeffs_iphone_icloud3”, “name”: “Jeff"s iPhone”}, {“entity”: “sensor.jeffs_iphone_icloud3_arrival_time”, “name”: “Arrive”}, {“entity”: “sensor.jeffs_iphone_icloud3_home_distance”, “name”: “Distance”}, {“entity”: “sensor.jeffs_iphone_icloud3_travel_time”, “name”: “TravTime”}, {“entity”: “sensor.jeffs_iphone_icloud3_next_update”, “name”: “NextUpdt”}], “state_color”: false}, {“type”: “glance”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Battery”}, {“entity”: “sensor.jeffs_iphone_icloud3_interval”, “name”: “Interval”}, {“entity”: “sensor.jeffs_iphone_icloud3_moved_distance”, “name”: “Moved”}, {“entity”: “sensor.jeffs_iphone_icloud3_last_located”, “name”: “Located”}, {“entity”: “sensor.jeffs_iphone_icloud3_last_update”, “name”: “LastUpdt”}]}, {“type”: “entities”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_info”}]}]}], “column_span”: 2}]}, {“title”: “*All Info”, “path”: “ic3db-tracking”, “type”: “sections”, “max_columns”: 2, “cards”: , “header”: {“card”: {“type”: “markdown”, “text_only”: true, “content”: “

Device Information (Tracking Results & Status, Device Info Msg)

This screen shows Device Information sensors that can be copied and pasted to other dashboards as a combined group or as group sections.”}, “layout”: “start”, “badges_position”: “bottom”}, “sections”: [{“type”: “grid”, “cards”: [{“type”: “markdown”, “text_only”: true, “content”: “


🀫 Combined Group (results+status+info) → Jeff"s iPhone

”}, {“type”: “vertical-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “device_tracker.jeffs_iphone_icloud3”, “name”: “Jeff"s iPhone”}, {“entity”: “sensor.jeffs_iphone_icloud3_arrival_time”, “name”: “Arrive”}, {“entity”: “sensor.jeffs_iphone_icloud3_home_distance”, “name”: “Distance”}, {“entity”: “sensor.jeffs_iphone_icloud3_travel_time”, “name”: “TravTime”}, {“entity”: “sensor.jeffs_iphone_icloud3_next_update”, “name”: “NextUpdt”}], “state_color”: false}, {“type”: “glance”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Battery”}, {“entity”: “sensor.jeffs_iphone_icloud3_interval”, “name”: “Interval”}, {“entity”: “sensor.jeffs_iphone_icloud3_moved_distance”, “name”: “Moved”}, {“entity”: “sensor.jeffs_iphone_icloud3_last_located”, “name”: “Located”}, {“entity”: “sensor.jeffs_iphone_icloud3_last_update”, “name”: “LastUpdt”}]}, {“type”: “entities”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_info”}]}]}, {“type”: “markdown”, “text_only”: true, “content”: “


[Ⲷ] Separate Groups (results, status, info) → Jeff"s iPhone

”}, {“type”: “horizontal-stack”, “cards”: [{“type”: “vertical-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “device_tracker.jeffs_iphone_icloud3”, “name”: “Jeff"s iPhone”}, {“entity”: “sensor.jeffs_iphone_icloud3_arrival_time”, “name”: “Arrive”}, {“entity”: “sensor.jeffs_iphone_icloud3_home_distance”, “name”: “Distance”}, {“entity”: “sensor.jeffs_iphone_icloud3_travel_time”, “name”: “TravTime”}, {“entity”: “sensor.jeffs_iphone_icloud3_next_update”, “name”: “NextUpdt”}], “state_color”: true}]}]}, {“type”: “horizontal-stack”, “cards”: [{“type”: “vertical-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Battery”}, {“entity”: “sensor.jeffs_iphone_icloud3_interval”, “name”: “Interval”}, {“entity”: “sensor.jeffs_iphone_icloud3_moved_distance”, “name”: “Moved”}, {“entity”: “sensor.jeffs_iphone_icloud3_last_located”, “name”: “Located”}, {“entity”: “sensor.jeffs_iphone_icloud3_last_update”, “name”: “LastUpdt”}], “state_color”: true}]}]}, {“type”: “horizontal-stack”, “cards”: [{“type”: “vertical-stack”, “cards”: [{“type”: “entities”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_info”}]}]}]}], “column_span”: 1}]}, {“title”: “*Track Results”, “path”: “ic3db-summary”, “type”: “sections”, “max_columns”: 2, “header”: {“card”: {“type”: “markdown”, “text_only”: true, “content”: “

Device Information - Tracking Results

This screen shows the Tracking Results group for all devices.”}, “layout”: “start”, “badges_position”: “bottom”}, “sections”: [{“type”: “grid”, “cards”: [{“type”: “horizontal-stack”, “cards”: [{“type”: “vertical-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “device_tracker.jeffs_iphone_icloud3”, “name”: “Jeff"s iPhone”}, {“entity”: “sensor.jeffs_iphone_icloud3_arrival_time”, “name”: “Arrive”}, {“entity”: “sensor.jeffs_iphone_icloud3_home_distance”, “name”: “Distance”}, {“entity”: “sensor.jeffs_iphone_icloud3_travel_time”, “name”: “TravTime”}, {“entity”: “sensor.jeffs_iphone_icloud3_next_update”, “name”: “NextUpdt”}], “state_color”: true}]}]}], “column_span”: 2}]}, {“title”: “*Badge, Battery”, “path”: “ic3db-badge-battery”, “type”: “sections”, “max_columns”: 2, “header”: {“card”: {“type”: “markdown”, “text_only”: true, “content”: “

Device Badge and Battery Sensors

This screen shows t,he Device’s Badge and Battery sensors in several formats that can be copied and pasted to other dashboards”}, “layout”: “start”, “badges_position”: “bottom”}, “sections”: [{“type”: “grid”, “cards”: [{“type”: “horizontal-stack”, “cards”: [{“type”: “glance”, “entities”: [{“entity”: “sensor.jeffs_iphone_icloud3_badge”, “name”: “Jeff"s iPhone”}, {“entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Jeff"s iPhone”}]}], “grid_options”: {“columns”: 6, “rows”: “auto”}}, {“type”: “vertical-stack”, “cards”: [{“type”: “tile”, “entity”: “sensor.jeffs_iphone_icloud3_badge”, “name”: “Jeff"s iPhone”, “features_position”: “bottom”, “vertical”: false, “show_entity_picture”: true}, {“type”: “tile”, “entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Jeff"s iPhone”, “features_position”: “bottom”, “vertical”: false}], “grid_options”: {“columns”: 6, “rows”: “auto”}}], “column_span”: 2}, {“type”: “grid”, “cards”: [{“type”: “markdown”, “text_only”: true, “content”: “

Device Badge Sensors

”}, {“type”: “vertical-stack”, “cards”: [{“type”: “tile”, “entity”: “sensor.jeffs_iphone_icloud3_badge”, “name”: “Jeff"s iPhone”, “features_position”: “bottom”, “vertical”: false, “show_entity_picture”: true}], “grid_options”: {“columns”: 4, “rows”: “auto”}}]}, {“type”: “grid”, “cards”: [{“type”: “markdown”, “text_only”: true, “content”: “

Device Battery Sensors

”}, {“type”: “vertical-stack”, “cards”: [{“type”: “tile”, “entity”: “sensor.jeffs_iphone_icloud3_battery”, “name”: “Jeff"s iPhone”, “features_position”: “bottom”, “vertical”: false}], “grid_options”: {“columns”: 4, “rows”: “auto”}}]}]}, {“title”: “Event Log”, “path”: “event-log”, “type”: “sections”, “max_columns”: 2, “sections”: [{“type”: “grid”, “cards”: [{“type”: “custom:icloud3-event-log-card”}]}, {“type”: “grid”, “cards”: [{“type”: “heading”, “icon”: “mdi:select-group”, “heading”: “Main-View-Template-Style: result-summary”, “heading_style”: “subtitle”}]}]}, {“title”: “Main (Backup)”, “path”: “main-backup”, “type”: “sections”, “max_columns”: 2, “sections”: [{“type”: “grid”, “cards”: [{“type”: “heading”, “icon”: “mdi:select-group”, “heading”: “Main Screen - Before Last Recreate Action”, “heading_style”: “subtitle”}]}]}]}}}

@jwelvaert
I can see your phones name as this “Jeff"s iPhone” in the created code, which is not correct. I had checked for a quote in the name (Jeff’s iPhone) and will verify that piece of code is being used.

having a bit of an odd issue when attempting to configure the Apple account for the first time.

I configure my username and password, I submit it, I get the MFA prompt on my phone, but then I get a login failed.

If I then attempt to enter the verification code, I get the following error:

Error: Username is being used by another Data Source entry

Looking in the logs, I see there’s a file permissions issue:

05-09 10:14:45 [pyicloud_ic3:0825] CONFIG  bl**0**se@, Authenticate with password > Failed, Other Error, [Errno 13] Permission denied: '/config/.storage/icloud3.apple_acct/bl**0**se@geekynet'
05-09 10:14:45 iCloud3 v3.1.6.1
Traceback (most recent call last):
  File "/config/custom_components/icloud3/support/pyicloud_ic3.py", line 814, in authenticate_with_password
    self.data = self.PyiCloudSession.post(url, params=params, data=data, headers=headers,)
                ~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/site-packages/requests/sessions.py", line 637, in post
    return self.request("POST", url, data=data, json=json, **kwargs)
           ~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/icloud3/support/pyicloud_session.py", line 307, in request
    self.cookies.save(ignore_discard=True, ignore_expires=True)
    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.13/http/cookiejar.py", line 1894, in save
    os.open(filename, os.O_CREAT | os.O_WRONLY | os.O_TRUNC, 0o600),
    ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PermissionError: [Errno 13] Permission denied: '/config/.storage/icloud3.apple_acct/bl**0**se@geekynet'

Checking the directory permissions in /config/.storage/ the icloud3.apple_acct directory is as follows:

d--------x 2 docker docker 4096 May 9 10:14 icloud3.apple_acct

Running the following versions:

Home Assistant 2025.5.0
icloud3 v3.1.6.1

Running on a raspberry pi running ubuntu 24.04 in docker (using the linuxserver docker images)

Thanks!