iCloud3 v3 iDevice Tracker - Version 3

@flobidan
Verify that the version of the recorder_prefilter.py is the latest one. Lines 102-103 should be:

def _inject_filter(hass: HomeAssistant):
    return False

Download and copy again if it is not.

Now I am confused. Looking into the file, my current one has 2800 lines and completely different content:

I also see the file size of 520kb vs. just 7kb of the one from your github. Obviously the upload function did not really overwrite that file. But I am really supposed to update those 2800 lines with just the 190 lines from your updated github file? Or where is my mistake?

@flobidan
I don’t know what you got that file from but that is html code, not the icloud3/support/recorder_prefilter.py from iCloud3 GitHub repository here. Download it and save again.

  1. Download the support/recorder_prefilter.py file in the iCloud3 GitHub repository here and save it to the icloud3/support directory. (Look for ‘Raw’ in the menu bar above the code on the right. The Download icon is the 2nd icon to the right)

Thanks, then I really don’t know where this is coming from, tried it twice with the upload function of file editor, but that does not seem to do what is expected. I now overwrote the 189 lines of the updated file just with copy and paste of the raw text directly, and after a reboot it also works for me again :smiling_face_with_three_hearts:

Have a nice remaining vacation!

Help!

my install has totally broke once again, did nothing, nothing upgraded but noticed it all wasn’t running.

In logs I see this:-

Logger: homeassistant.setup
Source: setup.py:271
First occurred: 10:15:23 (1 occurrences)
Last logged: 10:15:23

Setup failed for ‘icloud3’: Integration not found.

Logger: homeassistant.helpers.translation
Source: helpers/translation.py:226
First occurred: 10:15:23 (1 occurrences)
Last logged: 10:15:23

Failed to load integration for translation: Integration ‘icloud3’ not found.

Restarting home assistant does nothing.
From settings/devices it’s there but I don’t appear to be able to do anything.
From the dashboard I had setup for it there’s a setup select person and actions setup which neither appear to do anything no matter what I pick from the list and the usual log below this is all missing.

Where do I start?

@Calzor_Suzay
See here for a temporary solution to this problem. Scroll to the bottom and follow the instructions to get iCloud3 going again. An update will be released soon

2 Likes

Cheers,
Thought I’d horrendously broke something… :grin:

Hi Gary,
icloud3 has been running great for awhile now - since released.
I did run into the issue with the recorder. Thanks for fixing that.
I started having an issue when I tried to add a 2nd watch to icloud3. When I did that, it seemed to hose my other devices and the add process generated a unknown error. So I tried a bunch of things. Restarting HA after each.

  1. Removing the device. It said it was removed, but it was still in the device list.
  2. I removed all devices - restarted - still in the device list for icloud3.
  3. I uninstalled the configuration. restarted
  4. When I added it back in, the new watch and my iphone were detected and added to the installation. So now I had 3 devices. The integration, iphone and new watch.
  5. I tried to add in the old watch and I got the unknown error. It did however create the device and when I clicked on it, the entities seemed to be populating.
  6. Then I did a restart of HA (moving on to other things since it seemed to be working).
  7. I checked icloud3 devices and noticed that the old watch wasn’t recording a battery level. I clicked on the device and the only entity was the diagnostic - home/away.
  8. I don’t seem to be able to delete whatever is causing the unknown error. I tried different names to see if there was an entity conflict. Nothing works except removing the integration and re-installing.

Sorry for the long message, but I think I methodically went through a debug process (trial and error). Maybe you can see something in the log entry below that is a clue. Is it possible that you can’t have a 2nd watch family shared with the same iphone? That’s the only new thing I came up with.

Here is the log entry. I can get anything else that may help you help me.
Logger: homeassistant.util.loop
Source: util/loop.py:136
First occurred: 3:07:54 PM (2 occurrences)
Last logged: 3:07:54 PM

Detected blocking call to walk with args ('/config/www',) inside the event loop by custom integration 'icloud3' at custom_components/icloud3/config_flow.py, line 3522: for path, dirs, files in os.walk(f"{path_config_base}www"): (offender: /config/custom_components/icloud3/config_flow.py, line 3522: for path, dirs, files in os.walk(f"{path_config_base}www"):), please create a bug report at https://github.com/gcobb321/icloud3_v3/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#walk Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, 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 83, 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 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 285, 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 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/icloud3/config_flow.py", line 943, in async_step_menu_0 return await self.async_step_menu(user_input, errors) File "/config/custom_components/icloud3/config_flow.py", line 1018, in async_step_menu return await self.async_step_device_list() File "/config/custom_components/icloud3/config_flow.py", line 2632, in async_step_device_list await self._build_update_device_selection_lists() File "/config/custom_components/icloud3/config_flow.py", line 3247, in _build_update_device_selection_lists self._build_picture_filename_list() File "/config/custom_components/icloud3/config_flow.py", line 3522, in _build_picture_filename_list for path, dirs, files in os.walk(f"{path_config_base}www"):
Detected blocking call to scandir with args ('/config/www',) inside the event loop by custom integration 'icloud3' at custom_components/icloud3/config_flow.py, line 3522: for path, dirs, files in os.walk(f"{path_config_base}www"): (offender: <frozen os>, line 366: ?), please create a bug report at https://github.com/gcobb321/icloud3_v3/issues For developers, please see https://developers.home-assistant.io/docs/asyncio_blocking_operations/#scandir Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/src/homeassistant/homeassistant/__main__.py", line 223, in <module> sys.exit(main()) File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main exit_code = runner.run(runtime_conf) File "/usr/src/homeassistant/homeassistant/runner.py", line 190, in run return loop.run_until_complete(setup_and_run_hass(runtime_config)) File "/usr/local/lib/python3.12/asyncio/base_events.py", line 674, in run_until_complete self.run_forever() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 641, in run_forever self._run_once() File "/usr/local/lib/python3.12/asyncio/base_events.py", line 1990, in _run_once handle._run() File "/usr/local/lib/python3.12/asyncio/events.py", line 88, in _run self._context.run(self._callback, *self._args) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_protocol.py", line 452, in _handle_request resp = await request_handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_app.py", line 543, in _handle resp = await handler(request) File "/usr/local/lib/python3.12/site-packages/aiohttp/web_middlewares.py", line 114, 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 83, 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 85, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 242, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/headers.py", line 32, in headers_middleware response = await handler(request) File "/usr/src/homeassistant/homeassistant/helpers/http.py", line 73, in handle result = await handler(request, **request.match_info) File "/usr/src/homeassistant/homeassistant/components/http/decorators.py", line 81, in with_admin return await func(self, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 285, 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 122, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 368, in async_configure result = await self._async_configure(flow_id, user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 415, in _async_configure result = await self._async_handle_step( File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 518, in _async_handle_step result: _FlowResultT = await getattr(flow, method)(user_input) File "/config/custom_components/icloud3/config_flow.py", line 943, in async_step_menu_0 return await self.async_step_menu(user_input, errors) File "/config/custom_components/icloud3/config_flow.py", line 1018, in async_step_menu return await self.async_step_device_list() File "/config/custom_components/icloud3/config_flow.py", line 2632, in async_step_device_list await self._build_update_device_selection_lists() File "/config/custom_components/icloud3/config_flow.py", line 3247, in _build_update_device_selection_lists self._build_picture_filename_list() File "/config/custom_components/icloud3/config_flow.py", line 3522, in _build_picture_filename_list for path, dirs, files in os.walk(f"{path_config_base}www"):

Thanks,

Greg

Long time appreciative user, but, I too have been struggling to get icloud3 working with the 2024.07.xx versions of Home Assistant.

Logger: frontend.js.latest.202407100
Source: components/system_log/__init__.py:333
First occurred: 17:42:59 (5 occurrences)
Last logged: 17:51:57

Uncaught error from Chrome 126.0.0.0 on Chromium OS 14541.0.0 Error: Failed to execute 'define' on 'CustomElementRegistry': the name "icloud3-event-log-card" has already been used with this registry window.CustomElementRegistry.define (src/scoped-custom-element-registry.js:44:14) /local/custom_cards/icloud3-event-log-card.js:2219:16
Logger: homeassistant.config_entries
Source: config_entries.py:586
First occurred: 17:47:42 (1 occurrences)
Last logged: 17:47:42

Error setting up entry iCloud3 for icloud3
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/icloud3/__init__.py", line 232, in async_setup_entry
    await Gb.hass.async_add_executor_job(
asyncio.exceptions.CancelledError: Global task timeout

pulling my hair out, nothing is working.

@gjgeary when you talk about the watch and other devices still in the devices list, are you referring to the one in the iCloud3 Configure Settings > Devices List or the one in the HA > Devices and Strings and which one are you removing them from.

Adding a second watch should work h however, do you have both watches paired with the same iPhone? If so, that may create a problem.

Also, when you aren’t trying to delete sensors in HA and are having issues where they are recreated, starting HA two times is necessary to clear some of the HA caches to prevent them from being recreated.

@avd706 Have you tried clearing your browsers cache? Or restarting HA 2 or 3 things to make sure the HA cache is cleared?

I’ve rebooted it 20 - 30 times.

Uninstalled and installed

Still no luck. Won’t pull down the famshr device list.

Logger: homeassistant.config_entries
Source: config_entries.py:586
First occurred: 15:11:23 (1 occurrences)
Last logged: 15:11:23

Error setting up entry iCloud3 for icloud3
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 586, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/icloud3/__init__.py", line 232, in async_setup_entry
    await Gb.hass.async_add_executor_job(
asyncio.exceptions.CancelledError: Global task timeout

@avd706 for some reason, HA is having problems starting iCloud3 up. The only thing I can think of is to wipe iCloud3 out and start again.

Try this:

  1. Uninstall iCloud3
  2. Delete the config/custom_components/cloud3 directory.
  3. Restart HA
  4. Restart HA again to make sure its caches are cleared
  5. Go to Devices & services > Add Integration. Try to install iCloud3 with the search. It should not be listed.
  6. Install iCloud3 using HACS or from the zip file on the latest release of iCloud3 on GitHub (v3.0.5.5).
  7. Do step 5 again. iCloud3 should show up this time.
  8. Restart HA.
    Hopefully, it will show up and start.

Verify that there are no platform: icloud3 entries in your HA configuration.yaml file

1 Like

Is it possible to reduce or stop logging from iCloud3 to the HA Logbook without disabling a sensor? I already have the Log Level in iCloud3 set to Info, but find the logging still too verbose.

@vaniello
iCloud3 used to exclude certain sensors from the HA log using a hack where special code was injected into the HA recorder module. The HA guys changed the recorder and the hack started crashing HA. So it was removed. iCloud3 excluded sensor attributes from the Recorder but not the sensor itself. There have been discussions in the HA sites regarding this but nothing has been done yet. I will update iCloud3 when that happens.

You can exclude the sensors individually by adding them to your configuration.yaml file recorder entry. Refers to the HA recorder integration docs on doing that.

That worked. Thanks.

How can i add a friend?
I only see the dropdown for familie members but not the other devices that i have in the find my app on my iphone. I don’t want to add everybody to the family share.

When i try to add a device through the configuration menu i do not see this option.

Thanks in advance!

@RapTile You can’t. Apple removed this feature last year.

The next version of iCloud3, v3.1, will support multiple Apple iCloud Accounts. You will be able to add your friend’s Apple Account to those you track and select your friend’s device from the selection linst on the Configuration > Update Devices screen. Naturally, you will need your friend’s password and be able to authenticate access to your friend’s account when it is needed.

3 Likes

Thanks for your clear answer and hard work!

Yep - two watches on the same phone.