iCloud3 v3 iDevice Tracker - Version 3

@benflux
I just uploaded v3.4.3 that fixes several bugs introduced in v3.4.2 I uploaded yesterday. It should be available on HACS in a few minutes.

If the v3.4.3 is not displayed in HACS, select iCloud3, then 3-dots, then Update Information, then Redownload, then Restart HA

Stuck in a loop (v3.4.3)

Authenticate → Success → Attempt to Change a Param → Auth (and loop again)

@benflux

  1. What are you trying to change and on what screen?
  2. I guess you are getting the code on the ‘Apple did not send me a code’ screen, entering it and getting the code accepted message?
  3. Exit the config process, go back to the iCloud3 dashboard. There should be messages in the Event Log about the auth status. then back to config and see if you get the Auth Needed for the Apple account.
  4. Do you see any errors at HA settings > system > logs?

Apple has a TrustBrowser (True/False), and AuthNeeded (True/False) field in the data being passed back to iCloud3 during a login. That is what tells iCloud3 if a code is needed.

This got passed over for admittedly more important issues, but I still have this question.

@DifferentComputers
Go to the Configure > Update iCloud3 Device screen for each device with the message and check the MobApp device tracker field. Set to the correct one or to None

Same really

REQUEST AUTHENTICATION CODE > Delete the Trust Token. Get the Authenticate code from the Apple using the selected method

I get nothing on phone.

I might try the manual method later but got other things to do just feedign back.

All right, I apologize but I need to unpack this a bit.

Go to the Configure > Update iCloud3 Device screen

The what now? Where?

On the device?
Do you mean Settings>Apps>Home assistant? there’s no MobApp entry there.

In the iCloud control panel?
Under the purple gear configure menu there? If so, which entity because there isn’t one named “mobapp.” is it "sensor.icloud3.alerts?

There is no menu option or button for “update iCloud3 Device” I can find.

@DifferentComputers
It appears you are a little confused on what this do right now. I would suggest you head to the iCloud3 docs which explains how iCloud3 and the mobile app work together.

  1. Click the purple question mark (?) in the top right on the Event Log
  2. Start with the section Getting Started > Mobile App and Configuring Tracked Devices > iCloud3 Devices

The what?

I’m sure what you’re referring to exists at these links somewhere, but there’s no such link as “Getting Started > Mobile App and Configuring Tracked Devices > iCloud3 Devices”

I’ve been through the Settings in the Mobile App and they are configured correctly.

Except maybe I haven’t done " * Match them up with the iCloud3 device using the Mobile App device_tracker parameter from the Update iCloud3 Device screen*" Because where is the “update iCloud3 Device” screen?

@DifferentComputers
The text for each item will appear to the tight of the menu sidebar. Does anything display for any of the topics?

The docs are all on GitHub and handled by GitHub. Everything is displayed ok here

Right I’m on that page, but two things:

Minor–

isn’t the name of the link. do you mean some sort of popup on hover? I don’t get any.

More important-- that page tells you what to do, but not how to do it. I don’t see any actual instructions on how to " Match them up with the iCloud3 device using the Mobile App device_tracker parameter from the Update iCloud3 Device screen".

@DifferentComputers
You are looking in the wrong place for info on configuring iCloud3 device.

all right, that got me to the right place.

thank you.

Ditto. Rolled back to v3.4 again.

Ok managed to get the new version to work after some persistence with entering the code. Took about 5 attempts with the same code before it accepted (otherwise reported ‘unknown error’).

@spry-salt
I would be interested in what caused the Unknown Error
HA Settings > System > Logs. Look for an error message, click on it and the last few lines should show icloud3/config_flow …

That is the error from the screen. Copy and paste in this message. I have found a few things and am working on a maintenance update now.

Thanks Gary, three error messages:

Log details (ERROR)
 
This error originated from a custom integration.
Logger: custom_components.icloud3
Source: custom_components/icloud3/apple_acct/apple_acct.py:1463
integration: iCloud3 v3: iDevice Tracker (documentation, issues)
First occurred: 6:16:08 AM (1 occurrence)
Last logged: 6:16:08 AM

'text_1'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/apple_acct/apple_acct_support_cf.py", line 682, in async_request_new_auth_code
    await Gb.hass.async_add_executor_job(AppleAcct.untrust_session_and_authenticate)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 86, in run
    result = ctx.run(self.task)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "/config/custom_components/icloud3/apple_acct/apple_acct.py", line 583, in untrust_session_and_authenticate
    self.delete_trust_cookie()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/apple_acct/apple_acct.py", line 1463, in delete_trust_cookie
    if self.conf_apple_acct[CONF_AUTH_METHODS][TEXT_1] == '':
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'text_1'





Log details (ERROR)
Logger: aiohttp.server
Source: /usr/local/lib/python3.14/site-packages/aiohttp/web_protocol.py:488
First occurred: 6:19:32 AM (1 occurrence)
Last logged: 6:19:32 AM

Error handling request from 192.168.20.121
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/site-packages/aiohttp/web_protocol.py", line 517, in _handle_request
    resp = await request_handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/site-packages/aiohttp/web_app.py", line 569, in _handle
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/site-packages/aiohttp/web_middlewares.py", line 117, in impl
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 92, in security_filter_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 87, in forwarded_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 26, in request_context_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 90, in ban_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 295, in auth_middleware
    return await handler(request)
           ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 41, in headers_middleware
    response = await handler(request)
               ^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 89, in handle
    result = await handler(request, **request.match_info)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 83, in with_admin
    return await func(self, request, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 234, in post
    return await super().post(request, flow_id)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 74, in wrapper
    return await method(view, request, data, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 121, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 336, in async_configure
    result = await self._async_configure(flow_id, user_input)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 1536, in _async_configure
    return await super()._async_configure(flow_id, user_input)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 383, in _async_configure
    result = await self._async_handle_step(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        flow, cur_step["step_id"], user_input
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    )
    ^
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 483, in _async_handle_step
    result: _FlowResultT = await getattr(flow, method)(user_input)
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/icloud3/config_flow.py", line 360, in async_step_reauth_code_from_applecom_login
    await aascf.async_send_applecom_login_auth_code(self, user_input)
  File "/config/custom_components/icloud3/apple_acct/apple_acct_support_cf.py", line 643, in async_send_applecom_login_auth_code
    await Gb.hass.async_add_executor_job(self.AppleAcct.untrust_session_and_authenticate)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 86, in run
    result = ctx.run(self.task)
  File "/usr/local/lib/python3.14/concurrent/futures/thread.py", line 73, in run
    return fn(*args, **kwargs)
  File "/config/custom_components/icloud3/apple_acct/apple_acct.py", line 583, in untrust_session_and_authenticate
    self.delete_trust_cookie()
    ~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/config/custom_components/icloud3/apple_acct/apple_acct.py", line 1463, in delete_trust_cookie
    if self.conf_apple_acct[CONF_AUTH_METHODS][TEXT_1] == '':
       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^
KeyError: 'text_1'



Log details (ERROR)
 
This error originated from a custom integration.
Logger: custom_components.icloud3
Source: custom_components/icloud3/utils/messaging.py:642
integration: iCloud3 v3: iDevice Tracker (documentation, issues)
First occurred: 6:19:46 AM (2 occurrences)
Last logged: 6:19:50 AM

Invalid Session Token

@spry-salt
I just uploaded v3.4.3.1 that fixes the KeyError issue. The Token error is not realy an error, just a message about compng out of the Apple account handler from the code request

v3.4.3.1 got me working again :+1:

How often do you users typically end up with your Apple Account locked? For me it seems to happen a couple of times a week. More if I’ve had to restart HASS or the iCloud3 device tracker for other reasons.

And if that seems unusual to anyone, any suggestions on how to fix this?