iCloud3 v2.1 Device Tracker - iCloud3 v2.2 has been released (10/10/2020)


I Hope someone will be able to assist me. I have installed iC3 and it all seems to be working, except I am not getting a notification (in the notification area) to enable me to enter the verification code that I receive on the phone, as per instructios under “Authenticating Your iCloud Account”. The following is my config entry:

  - platform: icloud3
    username: !secret icloud_user
    password: !secret icloud_pwd
    tracking_method: fmf
      - iphone_x > [email protected], sunil.jpg, Sunil

Herein the screenshot of the log:

Thank you in advance.

If I set this up, can I use the icloud3_lost_phone service for devices I am not tracking but appear in my Find My app?

@Sunil You are getting an error message Missing X-APPLE-WEBAUTH-TOKEN cookie', error: 1 which probably indicates the cookies used to store your access credentials by your iCloud account is having a problem. The cookies are stored in the config/.storage/icloud directory in the file named from your icloud email address.This file is used by both the HA icloud integration and icloud3.

Are you running both the icloud integration and icloud3 at the same time? If so, I would suggest you use the HA icloud integration and make sure everything is working with it. Then turn it off and retry the icloud3 custom component and see if that solves your problem.

It appears the config is correct and the ios app entities are being identified.

@coolguymatt No, only devices that are tracked are accessible through any of the icloud3 service calls.

Good day Gary,

Thank you very much for your response.
I have not installed the iCloud integration (didn’t even know about the integration).

I removed the cookie files from the .storage/icloud directory and restarted. A new cookie appeared but getting the same error. I have emailed you the file for your info. Would uninstalling and then reinstalling iCloud3 help?

Does anyone in the UK have trouble with iCloud working properly, I find iCloud to be so unreliable here in the UK and was wondering if that’s the case or if its just me?

I was wondering if these values will update?

battery: 0
battery_status: null

Would like to know when the phone is charging and reaches above 80% so I can toggle the outlet off. Don’t want it “charging” all night and eventually brick my battery.


Charging or NotCharging. This is not available for the Find-my-Friends tracking method or when using the IOS App version 2.

Damn, that’s a shame. This was one of the reasons I wanted to implement this, because the default sensor (I guess from the app, didn’t have iCloud integration installed I think) was never updating. Was hoping this would be more accurate, but I guess not. :man_shrugging:t3:

@Ronaldt The next version of iCloud3 will support the 2fa family sharing tracking method without the constant notifications from iCloud and makes the battery status and battery level available on each location update. I hope to upload it to the iCloud3 repository/development directory in the next 2 weeks (hopefully) as a release candidate for those that want to try it out.

I’ll post a notification with all the information when it’s ready.

Wow, that sounds amazing! Your work is MUCH appreciated, you know that right?!

Thx for your work!
It worked nicely until the last couple of days. I now suddenly do not get correct location anymore. I use the FMF method and if I look into the -non2fa- account (on icloud.com) I see the correct location of the iphone I want to locate. However in home assistant an old location is used (I also see that gps accuracy is 0 and in the info of the event card I see “Old.Location, Age-53.2 min (#24)” The device tracker that is associated with the home assistant app (iphonetom_2) is also incorrect but if I open the app and refresh the map it corrects the location. The icloud device_tracker (iphonetom) however remains the same and incorrect. Any ideas?

Edit: if I restart homeassistant I get a correct location. If I then also open the app and refresh the map both locations (iphonetom and iphonetom2) are correct. But still “old location” in the info. The strange thing is that my wife’s phone works correct. I also sometimes see in the logs of home assistant errors in authentication or incorrect location. Do I need to reauthorize a 2fa account in the non-2fa account?

Edit2: Unfortunately after 20 minutes the device_tracker reported again the wrong location (work instead of home). In the event log I see: StateChange/Resume@20:29:46 but I have not moved location. In the icloud account of the non 2fa account I see the correct location of the 2fa account

@tomdh76 A couple of things to try -

  1. Power your phone off and then back on
  2. Check’ location Services’ in the phone to make sure it is on and the HA app is still set to ‘Always’
  3. Put log_level: debug+rawdara in the iCloud3 config. RestartHome Assistant and check the log file. This will put detailed debug entries in the Home Assistant Log file along with the actual fmf records received from iCloud location services. If the data from there is wrong, the phone is probably not sending it’s location to iCloud until it is requested.

A lot of old locations point to data from iCloud not getting updated.

It looks like just restarting the iPhone already worked. I have not been “at work” the last couple of hours :slight_smile: I also added log_level: debug+rawdata but I do not see anything in the HA log file related to icloud3 except for : You are using a custom integration for icloud3 which has not been tested by Home Assistant

Hi Gary (@gcobb321)
Firstly thanks for the great work that you have put into this component. Would appreciate it if you could take a look at the errors that I’m unable to reconcile below and provide any advice/insight as to how i can remedy or correct. ( 0.109.4 HA , iOS App version 2)

Log Details (ERROR)
Logger: custom_components.icloud3.device_tracker
Source: custom_components/icloud3/device_tracker.py:1420
Integration: icloud3 (documentation)
First occurred: 3:54:35 PM (242 occurrences)
Last logged: 4:14:40 PM

local variable 'v2_trigger_changed_secs' referenced before assignment
Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 1420, in _polling_loop_5_sec_device
UnboundLocalError: local variable 'v2_trigger_changed_secs' referenced before assignment


Log Details (ERROR)
Logger: custom_components.icloud3.device_tracker
Source: custom_components/icloud3/device_tracker.py:1611
Integration: icloud3 (documentation)
First occurred: 3:54:35 PM (242 occurrences)
Last logged: 4:14:40 PM

Device Update Error, Error=<class 'ValueError'>


Log Details (ERROR)
Logger: custom_components.icloud3.device_tracker
Source: custom_components/icloud3/device_tracker.py:1619
Integration: icloud3 (documentation)
First occurred: 3:54:30 PM (2 occurrences)
Last logged: 3:54:30 PM

Express(iphone) iCloud3 Error: An error was encountered processing device `location`request - Unable to find service notify/ios_iphoneexpress
Garbine(iphone) iCloud3 Error: An error was encountered processing device `location`request - Unable to find service notify/ios_garbineiphone

Thank you

@bastero I remember fixing the first error a while ago. The latest version is 2.1 with a few updates in the development directory of the iCloud3 GitHub Repository. I would check the version you are running and do an update if you are running an older version.

1 Like

Thank you Gary for your prompt response!, I was able to resolve the above errors by changing from iOS tracking to using the find my friends tracking method.

Got it to work eventually, but it took me all day :wink: Thanks for the Event log tool, it helped me debug the issue.


iOS App Sensors not working in iOS v13.4

Below is a response from an issue raised on the iOS App Forum a few days ago about the sensors are not being updated when the iOS App sends a notification from the iPhone to HA. Tthis means is the Last_Update_Sensor is not being updated by the iOS App. This is the sensor used by iC3 to pick up zone Enters, Exits, Background Fetch, etc updates.

"This is actually a known issue with the current version of the iOS app. What happened is that Apple changed something at the OS level with the iOS 13.4 update which broke the way the sensors worked. If you were using iOS 13.3 the HA iOS app would work perfectly fine. But once you upgrade to iOS 13.4 the sensors will no longer update and have stuck values.

The problem has been identified, but Robbie (who is the sole developer of the iOS app) has a new job and has been busy with other things, so he hasn’t been able to release an update yet. Hopefully sometime in the near future."

Thx for notifying this. Unfortunately I have already upgraded my IOS version and it seems that icloud3 works but not as perfectly as before…

@tomdh76 The problem is the HA App needs to be updated to support some changes in iOS 13.4 and 13.5. That hasn’t happened yet.

@gcobb321 Hi Gary, I have iOS 12.4.7, this is the latest for those with iPhone 6, as Apple will not be updating to iOS 13.xx for this phone. Given that the above update, has been experiencing the issue you highlighted.

Do you think that the change that Apple applied on iOS 13.xx also applies to the iOS12.xx, as it appears to be the same issue highlighted. I’m bringing this up so that you and Robbie as aware that the issue regarding updating by the iOS HA app also applies to the latest iOS 12.xx s/w.

Thank you for the work you have done, its impressive job and I have found it very useful.

I am tracking 2 phones through the HA app and I am finding that when we both take the same journey, one phone updates the location much more than the other.

Is there a way to change this, and does anyone know why one would be updating more than the other?
Both iPhone X’s.

Many thanks