Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

➤ Solution (Fixed in v3.1.4)-Cannot log into Apple Acct, 503 Error, 0 of 0 Devices Tracked #378

Open
gcobb321 opened this issue Nov 26, 2024 · 25 comments

Comments

@gcobb321
Copy link
Owner

gcobb321 commented Nov 26, 2024

Apple broke iCloud3 Again

At the end of October, Apple changed the method of validating passwords to use the Secure Remote Password method where a hash token is calculated using the password on the iCloud3 and the Apple side. Icy sends this hash token to Apple instead of the password and if they are the same value, the password is valid and the login process. This broke iCloud3 and a lot of other programs. iCloud3 v3.1 fixed this and could log into the Apple account again.

Apple has reverted to the old method of verifying passwords and broke iCloud3 again so it could no longer log into the account. Messages like the following are in the Event Log:

USERNAME, Authentication Failed, Connection Error, Secure Password Validation Data was not returned from Apple. ErrorCode-503

Apple Acct > USERNAME, Login Successful
Apple Acct > USERNAME, All Devices Located
Apple Acct > USERNAME, 0 of 0 tracked

Revert iCloud3 Back to v3.0.5.9

Downgrading to v3.0.5.9 goes back to the old way of verifying the password and getters iCloud3 working again.

Do this:
1. Go to HACS.
2. Find iCloud3 or the iCloud3 Developer Edition if you are using that version
3. Choose redownload from menu
4. Choose the v3.0.5.9
5. Install like you normally do.
6. Restart HA

Then do this:
1. Reenable using the Family Sharing data source and Mobile App data source if you are using the Mobile App on the Configure > Data Sources-Apple Accts & MobApp screen

Then restart HA again

@gcobb321 gcobb321 changed the title Cannot log into Apple Account, 503 Error, 0 of 0 Devices Tracked ➤ Cannot log into Apple Account, 503 Error, 0 of 0 Devices Tracked Nov 26, 2024
@gcobb321 gcobb321 pinned this issue Nov 26, 2024
@gcobb321 gcobb321 changed the title ➤ Cannot log into Apple Account, 503 Error, 0 of 0 Devices Tracked ➤ Cannot log into Apple Acct, 503 Error, 0 of 0 Devices Tracked Nov 26, 2024
@gcobb321 gcobb321 changed the title ➤ Cannot log into Apple Acct, 503 Error, 0 of 0 Devices Tracked ➤ Solution-Cannot log into Apple Acct, 503 Error, 0 of 0 Devices Tracked Nov 26, 2024
@gimmel
Copy link

gimmel commented Nov 26, 2024

Yes, the old version works again, but I had to login again, heaven knows what Apple is doing.
But all of my iCloud entities have the suffix _2 now. For example sensor.iphone_jasper_battery_2 instead of sensor.iphone_jasper_battery.

That’s not the first time I experience this problem. I never understood why and when Home Assistant does this.

First there were still both entities, then the old (right) entities disappeared.
Bildschirmfoto 2024-11-26 um 22 10 06
Bildschirmfoto 2024-11-26 um 22 10 18

@garyak
Copy link

garyak commented Nov 29, 2024

@gimmel

Yes, the old version works again, but I had to login again, heaven knows what Apple is doing. But all of my iCloud entities have the suffix _2 now. For example sensor.iphone_jasper_battery_2 instead of sensor.iphone_jasper_battery.

That’s not the first time I experience this problem. I never understood why and when Home Assistant does this.

Here's a quote from an earlier post by gcobb321 related to your duplicate entities:

The _2 suffix is added by HA, not iCloud3. HA does that when it finds the entity already exists and is being used when iCloud3 starts again. I found that they will be created if you do a reload iCloud3 service call while iCloud3 is also running. They might also be created by doing several integration adding-delete-add without restarting HA in between each one. From what I have seen, when HA starts, it reassigns the entity name iCloud3 uses without the _2 There has been no changes to any of that code since v3.0 was released last year.

They may be created when the iCloud3 integration is deleted and then readded. Once the integration is added, deleting and readding will not solve any problems.
When installing the zip file, go to the custom_components/icloud3 directory and unzip it. Then go to Devices and settings > ... (upper-right corner) > Restart Home Assistant. HA will start and the new version will be loaded.
There is no easy way to get rid of the _2's. But you can do this:

  1. Disable the iCloud3 integration
  2. Restart HA 2 times. That will clear it’s cache
  3. Go to Devices and settings > Entities you will see a lot of red circles on the iCloud3 entities since they are now unused by a loaded integration.
  4. Select the check box to select all entities
  5. Select Delete. You will get a warning message that only xxx out of xxx will be deleted. Select Yes too delete them.
  6. Restart HA
  7. Reenable the iCloud3 integration.
  8. Restart HA again. iCloud3 will start and recreate them without the _2.

@cedricdelecole
Copy link

cedricdelecole commented Nov 29, 2024

Hello, I rolled back to 3.0.5.9 (by the way, the home page shows 3.0.5.8, but the integration details shows 3.0.5.9 ... it seems I am logged in, but when I go to the devices I have added in the config, I have an "Unknown error" message when I try to update the devices :

image

The Map seems to be updated though, and here is the log :

Inès :

image

Alessio :

image

I assume all ok, except this unknown error which is preventing me to update the devices ...

@gcobb321
Copy link
Owner Author

@cedricdelecole
The version that is running its displayed in the Event Log when iCloud3 starts and finishes setting up the configuration. You might have to reinstall using HACS. It is not necessary to delete or restore any files before you do that.

@simondsmason
Copy link

Hi - what exactly are the steps needed to "Reenable using the Family Sharing data source"? Thanks.

@gcobb321
Copy link
Owner Author

gcobb321 commented Dec 2, 2024

@simondsmason
Go to _Configure > Data Sources-Apple Accts & MobApp _ screen and enable iCloud/Family Sharing

@tydalforce
Copy link

I'm curious what your plans are in terms of the next release / code updates. I'm on 3.1.3 and I'm still logged in to iCloud and everything is still OK so I'm hesitant to roll back to a previous release - especially if a new one is on the horizon and I can just wait.
Is there a way within the code to detect which auth method iCloud is using? Perhaps iCloud3 can auto-detect the "right" one and use it, in case Apple changes again!
Thanks, again, for all your efforts here!

@simondsmason
Copy link

@simondsmason Go to _Configure > Data Sources-Apple Accts & MobApp _ screen and enable iCloud/Family Sharing

ok, in that screen I see these screens but I don't see an option to enable iCloud/Family Sharing? Thanks.

image image

@gcobb321
Copy link
Owner Author

gcobb321 commented Dec 4, 2024

@simondsmason
You are enabling the Apple account as a data source. The name was changed in 3.1.3, which you are running and it is enabled. If you tried t to roll back to 3.0.5.9, it didn’t work or you didn’t restart HA

@gcobb321
Copy link
Owner Author

gcobb321 commented Dec 4, 2024

@tydalforce
When I return home on 12/9, I will implement a method to try both password verification protocols, along with a few other things.

@simondsmason
Copy link

@simondsmason You are enabling the Apple account as a data source. The name was changed in 3.1.3, which you are running and it is enabled. If you tried t to roll back to 3.0.5.9, it didn’t work or you didn’t restart HA

You are correct. I did not successfully roll back. I didn't think to check the version number and sure enough it is still reporting 3.1.3. Sorry about that.

However, seeing your last note I will wait for updates that you are looking at that try both methods so this isn't necessary. Thanks.

@bastero
Copy link

bastero commented Dec 6, 2024

@cedricdelecole did you notice that the MobileApp in your Event Log shows 'NotUsed" ? This mirrors what I'm seeing also.. note that it never gets updated.

What's more when I leave my home, the status of my location is not being tracked and automations are not being triggered. Is this something you are also seeing?

@cedricdelecole
Copy link

@cedricdelecole did you notice that the MobileApp in your Event Log shows 'NotUsed" ? This mirrors what I'm seeing also.. note that it never gets updated.

What's more when I leave my home, the status of my location is not being tracked and automations are not being triggered. Is this something you are also seeing?

I have no clue why ... I assume @gcobb321 knows more ;-)

@garyak
Copy link

garyak commented Dec 6, 2024

@bastero Have you verified the iCloud device tracker entity name generated by the companion app on your apple device matches the entity name being used by iCloud3? Is the companion app tracker configured as a data source? Are redundant, differently named (-2) device tracker entities present in your HA states listing?

@bastero
Copy link

bastero commented Dec 6, 2024

@bastero Have you verified the iCloud device tracker entity name generated by the companion app on your apple device matches the entity name being used by iCloud3? Is the companion app tracker configured as a data source? Are redundant, differently named (-2) device tracker entities present in your HA states listing?

Thanks.. Q#1: Can you elaborate, where exactly do I find the device tracker entity name generated by the companion app to compare to the name being used by iCloud3 ? Perhaps the following from the event log may help.

Screenshot 2024-12-06 at 2 39 09 PM

Q#2: Yes, the companion app tracker is configured as the source.

Q#3: Yes, there are some entities with _2 device trackers

@garyak
Copy link

garyak commented Dec 6, 2024

Q#1: Look in your HA UI in the Developer Tools tab. Select States at the top of the page to view a listing of entities known to HA. Your looking for "device_tracker.iphoneexpress" You should have one configured by iCloud3 showing device configuration info spanning several sections, and a second, showing GPS coordinates and data.

Q#2: After viewing device_tracker entities in HA, does the device_tracker entity name assigned as the companion app data source match the entity populated with GPS data? You'll want to rename the companion app device_tracker entity to distinguish it from the IC3 (iCloud3) tracking entity.

Q#3: _2 entities indicates you've let HA create duplicate entities. This doesn't prevent IC3 or the companion app from tracking, it just makes assigning entities in your tracking card more confusing. I re-posted Gary's instructions for cleaning these from your installation earlier in this thread. Perhaps when you get things running correctly you can backup HA then clean up the duplicates. I see you are currently running _2 device trackers as your IC3 data sources. These should be fully populated with several sections of device configuration data. You can keep these as-is for now.

@bastero
Copy link

bastero commented Dec 7, 2024

Q#1: Look in your HA UI in the Developer Tools tab. Select States at the top of the page to view a listing of entities known to HA. Your looking for "device_tracker.iphoneexpress" You should have one configured by iCloud3 showing device configuration info spanning several sections, and a second, showing GPS coordinates and data.

Q#2: After viewing device_tracker entities in HA, does the device_tracker entity name assigned as the companion app data source match the entity populated with GPS data? You'll want to rename the companion app device_tracker entity to distinguish it from the IC3 (iCloud3) tracking entity.

Q#3: _2 entities indicates you've let HA create duplicate entities. This doesn't prevent IC3 or the companion app from tracking, it just makes assigning entities in your tracking card more confusing. I re-posted Gary's instructions for cleaning these from your installation earlier in this thread. Perhaps when you get things running correctly you can backup HA then clean up the duplicates. I see you are currently running _2 device trackers as your IC3 data sources. These should be fully populated with several sections of device configuration data. You can keep these as-is for now.

Thanks you for your assistance, really appreciate it! Below are the answers to your recommendations.

Ans#1: Yes, I have both as per below :
Screenshot 2024-12-06 at 9 55 59 PM
Screenshot 2024-12-06 at 9 55 34 PM

Ans#2: The device_tracker entity name assigned as the companion app data source match the entity populated with GPS data... I believe so please see the device tracker name above.

Ans#3: I ran through the suggested procedure to remove _2 entities, the one device that has the _2 is because its a second device.

Having gone through the process, I'm still seeing the 'NotUsed' under the MobileApp banner in the Event Log as indicated earlier.

I'd appreciate any further insights or suggestions you may have. Thanks again!

@garyak
Copy link

garyak commented Dec 7, 2024

Here's what the data source screen looks like on 3.0.5.9:

ic3

Does the screen you're seeing match the one above? If not, we're on different versions. If the screens match, verify the Family Sharing List and Mobile App are checked, then return to the main menu and select iCloud3 Devices and click submit to open the Devices menu:

ic32

As shown above, you should see the FamShr and MobApp device tracker entities listed nest to each data source. In my case the mobile app device tracer entity is gary_ma. IC3 prepends "device_tracker" to the iCloud device name which is why you have device_tracker.device_tracker.iphoneexpress1. If the device tracker entities don't match, you'll have to reconfigure so they do.

@bastero
Copy link

bastero commented Dec 7, 2024

Thank you for this, I'm an idiot....I just realized that I missed including the location provided by the Mobile App.
Screenshot 2024-12-07 at 10 55 40 AM

I see what you mean with the "device_tracker.device_tracker.iphoneexpress1" thanks for this observation.

Cheers

@garyak
Copy link

garyak commented Dec 7, 2024

Hey! Easy fix :-) We all miss the little things from time to time.

@cedricdelecole
Copy link

Hi there, I think I have an issue with the "Mobile app" on both the iPhones of Inès and Alessio.

  1. What I see in the iCloud log is the following, showed as Mobile App is "not used" 👍
image
  1. If I check my entities, I see 2 are well created ... the one with ic3 is the one for iCloud, and the other one is the one for Mobile App :
image
  1. If I go to the settings trying to check the setting for the phone of Alessio, I am getting an "unknown error", as you can see here :
image

then :

image

then "unknown error" appears :

image

Can someone please advise ?
I want to be sure both entities are well working with the iCloud 3 ... I think the one from iCloud 3 is ok, because location is ok, but I am wondering if the one from the Companion app is ok as well ...

Many thanks !

@garyak
Copy link

garyak commented Dec 8, 2024

@cedricdelecole I've run into the "Unknown error occurred" message also. I haven't discovered the cause, but I work around the issue by directly editing the IC3 configuration file. A quick check would be to view-only the configuration file located at /config/.storage/icould3. Check the data_source line in the "data": section:

  "data": {
    "tracking": {
      "data_source": "famshr, mobapp",

If "mobapp" isn't listed, IC3 is configured to not use data from the Companion App.

@crospa91
Copy link

crospa91 commented Dec 11, 2024

Downgraded to the 3.0.5.9 but even with a clean install I cannot login with iCloud.

the prompt ask me for email and password, I did receive the 2 factor code screen but the interface on home assistant stay stuck with the spinning circle and never complete, asking me for the code.

@gcobb321
Copy link
Owner Author

@crospa91
Click the ‘X’ in the upper-right corner to exit the Configuration screen. Then go back into the Configuration screens again and try entering or requesting the code again. iCloud3 sends a http request to HA when it wants some data from Apple and HA may get stuck if there is some type of network error.

@bkr1969
Copy link

bkr1969 commented Dec 12, 2024

Downgraded to the 3.0.5.9 but even with a clean install I cannot login with iCloud.

the prompt ask me for email and password, I did receive the 2 factor code screen but the interface on home assistant stay stuck with the spinning circle and never complete, asking me for the code.

Same thing was happening to me. Eventually got a code.

My charge percentage and charge state is still not updating though. Is this expected with the roll-back?

@gcobb321 gcobb321 unpinned this issue Dec 23, 2024
@gcobb321 gcobb321 changed the title ➤ Solution-Cannot log into Apple Acct, 503 Error, 0 of 0 Devices Tracked ➤ Solution (Fixed in v3.1.4)-Cannot log into Apple Acct, 503 Error, 0 of 0 Devices Tracked Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants