gcobb321 / icloud3

iCloud3 v3 - iCloud3 is an advanced iDevice tracker that uses Apple iCloud account and HA Companion App data for presence detection and location based automations.
MIT License
534 stars 53 forks source link

iCloud3 versions < v3.0.5.3 won't work starting in HA 2024.7.2 #353

Closed Snuffy2 closed 4 weeks ago

Snuffy2 commented 1 month ago

Adding as an FYI so hopefully some others may see this before updating.

https://github.com/home-assistant/core/pull/121658

You may want to stay on HA 2024.7.1 until @gcobb321 gets back from vacation or you can make the changes noted here and also update manifest.json version to 3.0.5.3 (at your own risk)

manifest.json:

{
  "domain": "icloud3",
  "name": "iCloud3 v3",
  "after_dependencies": ["recorder", "ios"],
  "codeowners": ["@gcobb321"],
  "config_flow": true,
  "dependencies": [],
  "documentation": "https://gcobb321.github.io/icloud3_v3_docs/#/",
  "iot_class": "cloud_polling",
  "issue_tracker": "https://github.com/gcobb321/icloud3_v3/issues",
  "loggers": ["icloud3"],
  "requirements": [],
  "version": "3.0.5.3"
}

Note that after you make this change, you may see this in your logs. You can ignore this for now.

homeassistant  | 2024-07-05 16:57:05.946 WARNING (Recorder) [homeassistant.components.recorder.db_schema] State 
attributes for sensor.icloud3_event_log exceed maximum size of 16384 bytes. This can cause database performance 
issues; Attributes will not be stored
gcobb321 commented 1 month ago

To stop the above warning message, add the following to configuration.yaml. It adds a manual exclude for a few sensors that might help.

recorder:
  exclude:
    entities:
      - sensor.icloud3_event_log
LioBoul commented 1 month ago

:-(

Enregistreur: homeassistant.setup Source: setup.py:271 S'est produit pour la première fois: 16:58:39 (1 occurrences) Dernier enregistrement: 16:58:39

Setup failed for 'icloud3': Integration not found.

gcobb321 commented 1 month ago

@Snuffy2 I just updated the GitHub repo for iCloud3 and iCloud3_v3 _custom_component/icloud3/support/recorderprefilter.py from injecting itself into the HA recorder code. Can you download it and check it out.

Let me know so I can pass it on to some HA guys that the infection has been disabled.

Thanks Gary

Snuffy2 commented 1 month ago

@gcobb321 It looks ok. Not seeing any errors in the logs and ic3 seems to be working ok with limited testing.

PrayerfulDrop commented 1 month ago

I am still seeing issues even after making the changes to the recorder_prefilter.py file.

akrigator commented 1 month ago

I am still seeing issues even after making the changes to the recorder_prefilter.py file.

You have to update manifest.json as suggested in the topic start

KazemaRyukuro commented 1 month ago

Is there a fix, because icloud v3 isn´t schowing anymore in the integrations tab.

gcobb321 commented 1 month ago

iCloud3 inserts special code into the HA recorder that automatically excludes some text based iCloud3 sensors from the HA log database. HA release 3024.7 broke this and 2024.7.2 prevented iCloud3 from loading if it tried to do this injection.

I am in Switzerland and cannot release an update to iCloud3 to fix this error. However, I have updated the code in GitHub.

  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)
  2. Restart HA.

The Event Log also adds a large item into the log and will generate a warning message in the Error Log. To stop the warning message and exclude this sensor from being added, add the following to the configuration.yaml file. It adds a manual exclude for sensor.

recorder:
  exclude:
    entities:
      - sensor.icloud3_event_log
varenc commented 1 month ago

If you're like me and discovered that iCloud3, my favorite integration, isn't loading after the recent update, then you can downgrade back to the latest working HA version by just running this command over ssh:

ha core update --backup --version=2024.7.1

Running that gave me a smooth downgrade and iCloud3 immediately came back after the restart. Kudos to the HA devs for making downgrading so easy, a are thing these days. Cheers!

posixx commented 1 month ago

iCloud3 inserts special code into the HA recorder that automatically excludes some text based iCloud3 sensors from the HA log database. HA release 3024.7 broke this and 2024.7.2 prevented iCloud3 from loading if it tried to do this injection.

I am in Switzerland and cannot release an update to iCloud3 to fix this error. However, I have updated the code in GitHub.

1. Download the support/recorder_prefilter.py file in the iCloud3 GitHub repository [here](https://github.com/gcobb321/icloud3_v3/blob/main/custom_components/icloud3/support/recorder_prefilter.py) 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)

2. Restart HA.

The Event Log also adds a large item into the log and will generate a warning message in the Error Log. To stop the warning message and exclude this sensor from being added, add the following to the configuration.yaml file. It adds a manual exclude for sensor.

recorder:
  exclude:
    entities:
      - sensor.icloud3_event_log

Very strange, i replaced the code from your github file on my orginal install using vscode plugin but still icloud3 refuses to load..

EDIT: ok so beside replacing the recorder_prefilter.py content you also need to alter the manifest file as mentioned in the topic start. After modifying the manifest file and restart it works again

poudenes commented 1 month ago

The change did the work!!! Thanks @gcobb321 ( Don't forget to enjoy Swiss and turn off the computer ) 😄

gcobb321 commented 1 month ago

iCloud3 v3.0.5.5 (7/16/2024) has been released that fixes this problem. It should be available on HACS in a day or so. No other changes have been made.

gcobb321 commented 4 weeks ago

Completed with iCloud3 v3.0.5.5/v3.0.5.6