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

@liamp

  1. The config parameter is tracking_method, not trackingmethod and track_devices, not trackdevices.
  2. The NameError: name 'log_msg' is not defined is an error with that version that happened iCloud3 was generating an error message encountered trying to access the iCloud account. The error it enocountered is:

iCloud3 Error for myiphone > Error Authenticating account or no data was returned from iCloud Web Services. Web Services may be down or the Username/Password may be invalid.

  1. The Event Log card was displaying a blank screen because iCloud3 was not actually running. An error message is displayed on the v2.2.0 update.

Make sure the config parameters are correct and the username/password is valid for the iCloud account.

Also, if you are using the HACS version v2.1.0, you will see a notification every 1/2 hour or so that makes FamShr unusable. v2.2.0 in the v2.2.0 Release Candidate directory here solves that problem and adds a lot of new features. HACS will be updated as soon as the next version of the iOS App is released. The following links are for v2.2.0:

  • Download it here
  • Full Change Log is here
  • v2.2.0 Documentation is almost finalized and can be found here
  • Installation instructions are here

To install it:

  1. Click on the icloud3-v2.2.0-rc#.zip zip file.
  2. Then click ā€˜Downloadā€™ on the right side of the screen.
  3. Then unzip the downloaded zip file into the \config\custom_components\icloud3 directory on the device running Home Assistant.
  4. Then restart Home Assistant.

@gcobb321 looks like some mdi icon issues with new 0.113 release and iCloud3 2.20 RC10. in my logger Iā€™m seeing logs but the icon is missing.

Thanks. I had tracking_method: and track_devices: Not sure why the two _ went away when I pasted it. I will try the new version. Thank you for the reply.

Looks like updating fixed the problem, but ran into one problem. When I start iCloud3 I get a 2FA alert on my iphone, but there is no notification alerts in HA to put the 2FA code in.

@liamp
The 2fa code is for apps and is useless here. You will eventually see a notification inThe HA notifications area when the iCloud Web Services is authenticated and wants a code. Give it some time.

@shmookles
I just updated To. 0.113 and have no icon issues. Icons are HA and Lovelace and have nothing to do with iCloud3

Hi @gcobb321

Iā€™ve just upgraded to v2.2.0rc10. It seems to be incorrectly assuming the notify/mobile_appā€¦ service has the suffix of the mobile app device tracker entity.

An error occurred sending a message to device mobile_app_XXXX_iphone_2
Error: Unable to find service notify/mobile_app_XXXX_iphone_2
Message: {`message`: `request_location_update`}

The service the mobile app integration created is notify.mobile_app_XXXX_iphone without the _2 suffix.

My iCloud3 entity is device_tracker.XXXX_iphone
My Mobile App entity is device_tracker.XXXX_iphone_2

@scotty1395
The error sending a location request to the device has to do with the device name, not the entity name. I had the same problem with my wifeā€™s phone and it took a while to track down. Do this to fix it:

  1. Open the HA app on your phone (the _2 phone).
  2. On the phone, go to HASidebar>App Configuration >General
  3. In the Name field, type the full name of your phone, I.e, XXXX_iPhone_2. Then press Done.
  4. Restart HA to reload the changed device name. You can check HASidebar>Configuration >Devices>Services to make sure they notify.mobile_app_XXX_iphone_2 notify service is listed.

Iā€™ll add there instructions to the error message in iCloud3.

Thanks Gary. That fixed it.
One additional step I had to do was delete the device from the mobile app integration so it could be added back with the new details. It didnā€™t want to update the existing details.

Thanks again. Much appreciated!

Hi @gcobb321
After running iCloud3 for 6 to 12 hours I consistently get these DB errors logged:

Error saving events: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (MySQLdb._exceptions.DataError) (1406, "Data too long for column 'attributes' at row 1") [SQL: INSERT INTO states (domain, entity_id, state, attributes, event_id, last_changed, last_updated, created, old_state_id) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s)]
...

It seems like attributes of sensor.icloud3_event_log are exceeding the 65,535 bytes limit of the attributes TEXT field in the database.

Restarting HA or iCloud3 fixes it temporarily until the iCloud3 log grows too big again.
This was also an issue in v2.1.

Is there anything that can be done to limit sensor.icloud3_event_log attributes to 65,535 bytes?

Is there a downside to excluding sensor.icloud3_event_log from recorder: ? The event log card seems to work fine with it excluded (from my 5 minutes of testing).

@scotty1395
Before the latest release, the debug records would be added to the Event Log after you said to. This meant you couldnā€™t see them for older issues but only going forward. The latest release adds them all the time but doesnā€™t display them until you want to see them. This increased the number of records and the size of the sensor that holds them. iCloud3 does reduce the sensors size after 5-minute of not looking at it an then reloads the data when you go to it but that is more of a memory issue.

There would be no harm in excluding the Event Log sensor form the log file. In fact, it would probably be a good thing to exclude it to reduce the HA log file size. The only o other thing would be to monitor the size of the sensor data and load the records in batches on demand as they were needed. Iā€™ll give that some thought.

For some reason all of a sudden my phone has listed itself twice and Im not sure why, Its showing as

device_tracker.myphone_iphone

and

device_tracker.myphone_iphone_2

I cant find where to delete one of the entries. It appears that ā€˜iPhone_2ā€™ has the correct details i.e. batter_level so Im thinking the ā€˜iPhoneā€™ entry one needs deleting.

Any ideas please.

Found a fun one.

Sometimes in the log my distance to home is showing 138.71 km (Waze Route History Used: Home > Dist-138.71km), and sometimes it is showing at 85.7 km (Interval-2 hrs, Dist-85.7 km).

The sensor shows the 85.7 km measure, but it is incorrect. It had me puzzled for a little while, but it looks like 85.7 is the measurement in miles, not kilometres: 85.7 x 1.609344 = 137.92 (not exact, but we have gps variances, centres of zones, etc.)

Edit: forgot to mention, using 2.2 RC10

Edit 2: And, to test, I changed the unit of measurement to mi (from km), and now the distance shows as 138 mi.

Edit 3: And some more diggingā€¦ if the unit of measure is in device_trackers.yaml, everything seems to work as expected. If it is specified in custom_components/icloud3/config_ic3.yaml, the calculations between km and mi seem to be reversed.

It appears your phone has been integrated twice. Perhaps by a recent update. The safe method is to remove the integrations, clean any mobile_app Devices/Entities from the existing configuration using the UI, delete the app from your phone, then reinstall/onboard to restore the single integration instance. A second method would be to carefully edit the storage configuration files to remove the first instance, then rename the second instance.

Thereā€™s a documented iOS App clean-up procedure in the iOS Companion documents. Thereā€™s a link to it earlier in this topic.

Thank you, done it in the end by deleting all entries in the core.config_entries, core.device_registry and the core.entity_registry.

Reinstalled the iOS app. and all updated correctly.

Iā€™ve been getting app crashes the last couple of days (a lot).
Removing the iCloud3 RC seems to have stopped them.
What can I send you to help you understand the cause?
I have the iOS crash log from home assistant.

I would be interested in seeing the HA log file when this occurs to see what iCloud3 was doing at the time of the crashes. Although iCloud3 has no interaction with the iOS app other than monitoring state changes and location triggers, setting up and moving stationary zone locations are passed to the iOS app by HA. That might pinpoint where the issue is. You can email what you have to [email protected]

Which HA log are you interested in ? There was nothing particular in the ā€œnormal logsā€.

I have installed the 2.2 RC10 and all seems be working well. I am using fanshr method. However, I received the notification in HA to configure, but I have tried several times entering the 2fa I receive on the phone (6 digit numbers) in the ā€œSelect iCloud Trusted Deviceā€ dialog box, but they do not work. The the event log displays ā€œiCloud3 Error>Invalid Trusted Device ID, Entered-364726ā€ Tried restarting several times, but none of the codes I receive work.

What am I supposed to enter under ā€œTrusted Device IDā€?