gcobb321 / icloud3_v3

iCloud3 v3, Development Version - This Repo/Version is used for development and testing of new and updated features. It is not the official release of iCloud3 v3, .
MIT License
169 stars 13 forks source link

ic3 stops updating and MobileApp changes to NotUsed #288

Closed Snuffy2 closed 3 months ago

Snuffy2 commented 8 months ago

Since going to v3.0 release, ic3 seems to stop updating after <24 hours. Looking in the ic3 Event Log, all devices say MobileApp as NotUsed. All 4 iPhones do have the Home Assistant mobile app. Restarting ic3 fixes it, but that requires me to manually identify that this happened than then restart it.

I'll try to capture debug logs for this as well.

icloud3-event-log_2024.0319-17.20.log

2024-03-19_17-18-28 430
gcobb321 commented 8 months ago

Hey, Not sure why it would hang and things would stop working but I have an update that is about ready. @balloob identified a problem where iC3 would update sensors using an async write that could cause a hang since it was not being done in the Event Loop. This fixes that and a few other things.

Unzip into the iCloud3 directory and restart HA.

icloud3_v3.0.1b4.zip

Change Log

  1. UPDATE SENSOR & DEVICE TRACKER ENTITIES (Improvement) - Changed the method of updating these items at the request of @balloob (Paulus Schousten, HA Founder) to prevent a potential Home Assistant lockup when doing an update.
  2. LOG FILE (Improvement) - Changed the method of updating the iCloud3 log files. Also changed some of the record formatting to improve readability.
  3. WAZE & CALC DISTANCE SENSORS (Fixed) - They were not being created.
  4. UPDATE DEVICES CONFIGURE SCREEN (Fixed) - The Picture parameter was listing every image file in the all of the www/ sub-directories. A filter was added to limit the search to specific directories. The filter is defined on the Tracking and Other Parameters screen. Only the first 25 image files in a directory will be displayed to prevent overloading the HA dropdown list handler.
  5. FIXED INTERVAL (Improvement) - The lowest interval was reduced from 5-minutes to 3-minutes.
  6. DIRECTION OF TRAVEL (Improvement) - Changed the way this is being updated. If the distance from Home is more than 400m/250mi, it will be set to FarAway.
  7. STATIONARY ZONE (Fixed) - The second device to enter an existing Stationary Zone was not saving the Stationary Zone info correctly.
Snuffy2 commented 8 months ago

So far running v3.0.1b4, I've been up 2.1 days without it freezing. Not sure what the exact issue was, but it looks like you likely fixed it. Thanks.

gcobb321 commented 8 months ago

Balloob identified a problem in iCloud3 where it was doing I/o in the Event loop instead of doing an executive call which could hang HA. The I/o was updating the restore state file after the device tracker and sensor entities. I also rewrote the .log file routines to create an iCloud3 fileHandler under the control of the HA logger to eliminate the i/o there.

See here and here for his info and iCloud3 change requests.

Glad it’s no longer hanging.

Snuffy2 commented 6 months ago

So I've not had a chance to post on this, but this is still happening. I've had it occur every few days without an obvious cause or trigger. I've attempted to turn on Debug logging but it never seems to happen while I have it on.

I just noticed that the locations for several of my icloud3 my devices are incorrect and noticed it happened again. The Event Log is attached. Sometime between 9pm and 11pm on 5/20 the MobileApp changed to Not Used. The icloud3 trackers have been inconsistent since then.

Restarting HA or ic3 fixes it.

Sorry I don't have much more to go on at this point. icloud3-event-log_2024.0521-17.57.log

2024-05-21_18-07-15 070
gcobb321 commented 6 months ago

I think it is a timing problem where the Mobile App Integration is set up after iCloud3 and the devices using the mobile app that are verified during startup are being reset back to the mobile app is not used.

Unzip _startic3.zip into the icloud3/support directory and restart HA. start_ic3.zip

Snuffy2 commented 6 months ago

I updated the file and restarted. I'll monitor how it goes over the next few days. Thanks!