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

iCloud3 v3.0 --> Questions and Answers Area #258

Open gcobb321 opened 10 months ago

gcobb321 commented 10 months ago

The other Q&A Issue was getting long and contained a lot of very old items that we don't need to week through. So this is the fresh copy. Add comments below for help, assistance and guidance.

shim895 commented 10 months ago

EDITED to add that I am only seeing this when turning on DEBUG logging.

I am seeing this in my HA logs:

2024-01-23 09:08:20.342 ERROR (SyncWorker_0) [icloud3] 'NoneType' object has no attribute 'next_update_secs' Traceback (most recent call last): File "/config/custom_components/icloud3/icloud3_main.py", line 276, in _polling_loop_5_sec_device self._main_5sec_loop_update_tracked_devices_icloud(Device) File "/config/custom_components/icloud3/icloud3_main.py", line 475, in _main_5sec_loop_update_tracked_devices_icloud or icloud_data_handler.no_icloud_update_needed_tracking(Device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/icloud3/support/icloud_data_handler.py", line 35, in no_icloud_update_needed_tracking elif (Device.is_next_update_time_reached is False ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/icloud3/device.py", line 1416, in is_next_update_time_reached return Gb.this_update_secs >= self.FromZone_NextToUpdate.next_update_secs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'next_update_secs'

I've also attached a screenshot of my EventLog page. Was there anything I need to add or tweak in the config?

image

Thank you for this integration!!

gcobb321 commented 10 months ago

I think I have tracked it down to an invalid configuration item.

Can you do one of the following:

The 'track_from_base_zone': '' configuration field being empty ('') will cause this error. It should be 'track_from_base_zone': 'home' and I'd like to check it out. That field is on each device and in the general parameters. After you send the files, go to the Configure Settings > Update Devices screen and check the Primary Track-from-Home-zone override field for your devices and see if any are wrong. If it is wrong and an error message is displayed, set it to Home and restart iCloud3 as it normally does when you Exit the Configure Settings screen.

shim895 commented 10 months ago

I think I have tracked it down to an invalid configuration item.

Can you do one of the following:

  • send your icloud3-0.log file to geekstergary@gmail.com. Also send icloud3-1.log and _icloud32.log if they exist. They are older versions I can compare to the current version.

The 'track_from_base_zone': '' configuration field being empty ('') will cause this error. It should be 'track_from_base_zone': 'home' and I'd like to check it out. That field is on each device and in the general parameters. After you send the files, go to the Configure Settings > Update Devices screen and check the Primary Track-from-Home-zone override field for your devices and see if any are wrong. If it is wrong and an error message is displayed, set it to Home and restart iCloud3 as it normally does when you Exit the Configure Settings screen.

I followed your steps at the bottom - each appeared to be previously set. I then went and reselected that value for each device, along with a save and then a full restart. Now the errors are gone.

gcobb321 commented 10 months ago

I've redone the device field/valid zone error checking when starting up. It seems HA was firing the new "remove_zone" handler when iC3 was starting and iC3 was removing the home and other zones.

2024-01-23 13:30:16 [start_ic3...:1160] STAGE 3 > HA Zone Deleted > Zone-Angie's Home/angie_s_home (0m 2024-01-23 13:30:16 [start_ic3...:1160] STAGE 3 > HA Zone Deleted > Zone-Millard South/millard_south (0m 2024-01-23 13:30:16 [start_ic3...:1276] STAGE 3 > INITIALIZED Device > Ryan's iPhone (ryan_iphone) 2024-01-23 13:30:16 [start_ic3...:1160] STAGE 3 > HA Zone Deleted > Zone-West Campus/west_campus (0m 2024-01-23 13:30:16 [start_ic3...:1300] STAGE 3 > ✓ ryan_iphone > Ryan's iPhone (Tracked) • FamShr Device: Shimmy • MobApp Entity: shimmy 2024-01-23 13:30:16 [start_ic3...:1160] STAGE 3 > HA Zone Deleted > Zone-Westside High/westside_high (0m 2024-01-23 13:30:16 [start_ic3...:1160] STAGE 3 > HA Zone Deleted > Zone-Boot Barn/boot_barn (0m

Things when down hill from there. I can not duplicate it but the validation is working better. I'll send you a link to updated code in a few minutes.

Also, go to Settings > Areas & zones > zones and make sure everythink looks ok. It should since the iC3 remove routine is to clean up iC3 stuff and has nothing to do with HA.

Gary Cobb (geekstergary)

------ Original Message ------ From "Ryan Schilmoeller" @.> To "gcobb321/icloud3_v3" @.> Cc "Gary Cobb" @.>; "Author" @.> Date 1/23/2024 4:15:07 PM Subject Re: [gcobb321/icloud3_v3] iCloud3 v3 - Release Candidate 10 --> Questions and Answers Area (Issue #258)

I think I have tracked it down to an invalid configuration item.

Can you do one of the following:

send your icloud3-0.log file to @.*** Also send icloud3-1.log and icloud3_2.log if they exist. They are older versions I can compare to the current version. The 'track_from_base_zone': '' configuration field being empty ('') will cause this error. It should be 'track_from_base_zone': 'home' and I'd like to check it out. That field is on each device and in the general parameters. After you send the files, go to the Configure Settings > Update Devices screen and check the Primary Track-from-Home-zone override field for your devices and see if any are wrong. If it is wrong and an error message is displayed, set it to Home and restart iCloud3 as it normally does when you Exit the Configure Settings screen.

I followed your steps at the bottom - each appeared to be previously set. I then went and reselected that value for each device, along with a save and then a full restart. Now the errors are gone.

— Reply to this email directly, view it on GitHub https://github.com/gcobb321/icloud3_v3/issues/258#issuecomment-1906929075, or unsubscribe https://github.com/notifications/unsubscribe-auth/AIOOVBY4GVRUL5QHKJ7SC33YQAR5XAVCNFSM6AAAAABCGAMO7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBWHEZDSMBXGU. You are receiving this because you authored the thread.Message ID: @.***>

gcobb321 commented 10 months ago

@shim895 Here is rc10.1 that prevents zone maintenance when iC3 is starting and improves device parameter/sone verification and error reporting during start up.

Unzip into the icloud3 directory and restart HA. icloud3_v3-rc10.1.zip

shim895 commented 10 months ago

@shim895 Here is rc10.1 that prevents zone maintenance when iC3 is starting and improves device parameter/sone verification and error reporting during start up.

Unzip into the icloud3 directory and restart HA. icloud3_v3-rc10.1.zip

Appreciate it @gcobb321! Loading it now.

DS-B-BB-G commented 10 months ago

Hi,

my log get also spam with following error below.

Is this a simmilar issue and make it sense to take you zip file update?

This error originated from a custom integration.

Logger: icloud3 Source: custom_components/icloud3/device.py:1416 Integration: iCloud3 v3: iDevice Tracker (documentation, issues) First occurred: 8:33:23 AM (3865 occurrences) Last logged: 1:55:20 PM

'NoneType' object has no attribute 'next_update_secs' Traceback (most recent call last): File "/config/custom_components/icloud3/icloud3_main.py", line 276, in _polling_loop_5_sec_device self._main_5sec_loop_update_tracked_devices_icloud(Device) File "/config/custom_components/icloud3/icloud3_main.py", line 475, in _main_5sec_loop_update_tracked_devices_icloud or icloud_data_handler.no_icloud_update_needed_tracking(Device) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/icloud3/support/icloud_data_handler.py", line 35, in no_icloud_update_needed_tracking elif (Device.is_next_update_time_reached is False ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/icloud3/device.py", line 1416, in is_next_update_time_reached return Gb.this_update_secs >= self.FromZone_NextToUpdate.next_update_secs ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'next_update_secs'

———- next error log ——-

This error originated from a custom integration.

Logger: icloud3 Source: custom_components/icloud3/icloud3_main.py:994 Integration: iCloud3 v3: iDevice Tracker (documentation, issues) First occurred: 8:33:22 AM (18 occurrences) Last logged: 1:55:15 PM

'NoneType' object has no attribute 'from_zone' Traceback (most recent call last): File "/config/custom_components/icloud3/icloud3_main.py", line 894, in process_updated_location_data self._get_tracking_results_and_update_sensors(Device, update_requested_by) File "/config/custom_components/icloud3/icloud3_main.py", line 994, in _get_tracking_results_and_update_sensors from_zone = Device.FromZone_TrackFrom.from_zone ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ AttributeError: 'NoneType' object has no attribute 'from_zone'

Thanks for watching into it.

fila612 commented 10 months ago

Same here, tried also with rc10.1:

EventLog: System Events:

Time Event

05:52:05 INTERNAL ERROR > Det IntervalLoop⣇⠋•⠉File... > File /icloud3_main.py, line 1051, in _determine_interval _and_next_update)⣇⠋•⠉Code > log_start_finish_update_banner(finish, devicename, Device.dev_data_sou

05:52:10 INTERNAL ERROR > Det IntervalLoop⣇⠋•⠉File... > File /icloud3_main.py, line 1051, in _determine_interval _and_next_update)⣇⠋•⠉Code > log_start_finish_update_banner(finish, devicename, Device.dev_data_sou

05:52:10 INTERNAL ERROR > Det IntervalLoop⣇⠋•⠉File... > File /icloud3_main.py, line 1051, in _determine_interval _and_next_update)⣇⠋•⠉Code > log_start_finish_update_banner(finish, devicename, Device.dev_data_sou

05:52:15 INTERNAL ERROR > Det IntervalLoop⣇⠋•⠉File... > File /icloud3_main.py, line 1051, in _determine_interval _and_next_update)⣇⠋•⠉Code > log_start_finish_update_banner(finish, devicename, Device.dev_data_sou

iCloud3.log [...] UnboundLocalError: cannot access local variable 'from_zone' where it is not associated with a value 2024-01-27 06:20:25 [icloud3_main:1055] ICLOUD > Traceback (most recent call last): File "/config/custom_components/icloud3/icloud3_main.py", line 1051, in _determine_interval_and_next_update log_start_finish_update_banner('finish', devicename, Device.dev_data_source, from_zone) ^^^^^^ UnboundLocalError: cannot access local variable 'from_zone' where it is not associated with a value 2024-01-27 06:20:25 [icloud3_main:1054] ICLOUD > Traceback (most recent call last): File "/config/custom_components/icloud3/icloud3_main.py", line 1051, in _determine_interval_and_next_update log_start_finish_update_banner('finish', devicename, Device.dev_data_source, from_zone) ^^^^^^^^^ UnboundLocalError: cannot access local variable 'from_zone' where it is not associated with a value 2024-01-27 06:20:25 [icloud3_main:1055] ICLOUD > Traceback (most recent call last): File "/config/custom_components/icloud3/icloud3_main.py", line 1051, in _determine_interval_and_next_update log_start_finish_update_banner('finish', devicename, Device.dev_data_source, from_zone) ^^^^^^ [...]

gcobb321 commented 10 months ago

Here is the latest rc10.1 (1/27/2024) that fixes all of the above items. This will be on the GitHub Releases page tomorrow.

Download, unzip into the icloud3 directory and restart HA. icloud3_v3-rc10.1.zip

smart-ctrl commented 10 months ago

rc10.1 image

gcobb321 commented 10 months ago

@smart-ctrl Was that error from the 1/27 rc10.1 or the one from 1/22. That should have been fixed in the 1/27 version

Edit: I was in the process of updating the GitHub Release to rc10.1 but will wait untilo you confirm it is fixed (or not). Thanks.

smart-ctrl commented 10 months ago

@gcobb321 My bad, now it works fine with 1/27 rc10.1 :)

gcobb321 commented 10 months ago

Thanks for the confirmation. Updating now.

gcobb321 commented 9 months ago

I've just uploaded v3.0.rc10.4. Visit the Releases page for more info. It should show up on HACS on 2/19 or 2/20 when HACS does a refresh. Or go into HACS, select iCloud3 and update it's information.

gcobb321 commented 9 months ago

Nir, As it turns out, everything is correct. The distance to the devices is the calculated distance is the straight line distance between two gps points. The _zone_distance and _home_distance state values is the Waze Route Driving distance between these same points. I have done some reformatting of these sensor's attributes and updated the documentation to explain this better. The '--Nir/iPhone', and the 'calc distance' are all in agreement (3.98km) as shown on the sample images you sent

I also changed the Device name in the attributes to remove the device type so you would use '--Nir' instead of '--Nir/iPhone' for your dashboard sensors.

Unzip rc10.5 below into the icloud3 directory and restart HA. icloud3_v3.0.rc10.5.zip

amaisano commented 8 months ago

One of the past couple releases changed the minimum interval you can set a device to from 1 minute to 5 minutes.

5 minutes is not fast enough for the majority of my use cases. I know this is a conversation that has been had before, and suggestions using distance-from-home and/or Waze timing to address this, but those workarounds are not going to work for the following AFAICT:

  1. Going for a walk around the block w/o phone (Apple Watch)
  2. Driving to get coffee 1 mile away - I can be through the drivethru and back to my driveway within 5-10 minutes, which is not enough time to calculate workarounds in my experience.

Is there a setting or detail I am missing? 1 minute was adequate for almost all of my automations. When it changed to 5 minutes, nearly all my automations are failing.

Again, this is apple watch related. If it was iPhone only I could easily rely on the Companion app.

You can see the significant lag here:

image

PS: Congrats on the 3.0 release!

gcobb321 commented 8 months ago

When the calculates the interval based on distance is less than 5-minutes, it uses that. For example when the distance goes below 1-km, the interval is 15-secs. I’ll look at how the Watch interval works this afternoon when I go to see Dune 2.

I base my Home arrive automations on north a zone enter trigger and the distance goes below .2

amaisano commented 8 months ago

When the calculates the interval based on distance is less than 5-minutes, it uses that. For example when the distance goes below 1-km, the interval is 15-secs.

FWIW, i've never seen it at 15 seconds for the Apple Watch and I spend most of my time at the home location.

gcobb321 commented 8 months ago

The 15-sec time would be determined when the watch or other device approached Home zone and is under 1km Away. When you are in a zone, the watches inzone interval determines when the next location update will be done.

The sensor.[devicename]_interval shows what the interval is. Also look at the Event Log for the watch while it is away and approaching Home to see what is actually going on at that time.

peetereczek commented 8 months ago

Are you planning to implement new authentication method for accounts which are protected with passkeys / hardware FIDO keys?

Reason is that traditional MFA with code popup is no longer available

gcobb321 commented 8 months ago

I'd like to and it's on the Feature request list but the web interface that is used to retrieve location data does not support it. I do not see it happening any time soon.

gcobb321 commented 8 months ago

@amaisano I have just released a new v3.0. It does not effect current users so the version is still v3.0. However, I did change the Fixed Interval minimum value from 5-min to 3-min.

The Releases page is here and it should show up on HACS tomorow.

peetereczek commented 8 months ago

I'd like to and it's on the Feature request list but the web interface that is used to retrieve location data does not support it. I do not see it happening any time soon.

So as I understand, that depends actually from Apple?

peetereczek commented 8 months ago

I'd like to and it's on the Feature request list but the web interface that is used to retrieve location data does not support it. I do not see it happening any time soon.

Aha, in iOS 17.4 there is an option to manage web applications which requested passkey authentication. Looks like Apple is preparing to extend functionality. Fingers crossed

gcobb321 commented 8 months ago

I'll keep a look out for it. Post any more info you find.

gcobb321 commented 8 months ago

iCloud3 v3.0.1 (3/20/2024) has been released

Go to the Releases page, download the zip file, unzip it into the icloud3 directory, restart HA and enjoy. --or-- Get it from HACS

pedropombeiro commented 5 months ago

Hi @gcobb321! I'm seeing a behavior with my kid's integration, where it seems to frequently query FamShr for his battery level, even when he's home (which's the case in the picture below), and the trigger says it's at a 2h interval. I even tried pausing updates for his device, but I still see locate requests in the log after that:

image

Any ideas what might be happening here? Happy to open a bug if this warrants it, but just wanted to check first if I'm reading things correctly.

gcobb321 commented 5 months ago

@pedropombeiro When iCloud3 gets location info for one device, info for all devices is returned from iCloud. iCloud3 will update all devices with the location and battery status. When you pause a device, that device will no longer request it’s location but will be updated when others request theirs.

barney34 commented 4 months ago

I have three zones.

Home
Lake
Neighborhood

I want to say if I exit Lake or Neighborhood and I'm moving towards Home do x. But I dont want x to happen if I am moving away from home. How would I write that condition?

thogens commented 1 month ago

I'm new to iCloud3 and I'm wondering if there is any way to dynamically set the minimum interval to save battery on my kids Apple Watch. My idea would be to set interval to 5mins, when usually school is over, so that I get notified "quickly" when my kid goes home. But I don't need 5mins interval over the whole day. That should save a lot of battery consumption, correct? Any idea?

amaisano commented 1 month ago

There used to be a way to do this. I don’t think there is anymore. It’s automatic now I think?

On Wed, Sep 25, 2024 at 12:46 PM thogens @.***> wrote:

I'm new to iCloud3 and I'm wondering if there is any way to dynamically set the minimum interval to save battery on my kids Apple Watch. My idea would be to set interval to 5mins, when usually school is over, so that I get notified "quickly" when my kid goes home. But I don't need 5mins interval over the whole day. That should save a lot of battery consumption, correct? Any idea?

— Reply to this email directly, view it on GitHub https://github.com/gcobb321/icloud3_v3/issues/258#issuecomment-2374612413, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAFICM2VQZHBB54TD4LXG2DZYLSGRAVCNFSM6AAAAABCGAMO7CVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGNZUGYYTENBRGM . You are receiving this because you were mentioned.Message ID: @.***>

thogens commented 1 month ago

What do you mean with "automatic"? I set interval to 2h and the interval goes down automatically to 5mins? But what would trigger this?

amaisano commented 1 month ago

I've set mine to the minimum i can (3 minutes) which is not as fast as it used to be in the older integration, which was 1 minute. I think this is the "in home interval."

If you look carefully at the logs, you'll see the interval change depending on what zone you are in or not in. Most of the time "it just works" where the interval reduces when in a stationary zone that isn't home, and gets more frequent when on the move.

There is also an automation or two the author of this integration suggests for pinging/updating devices when "approaching home."

See my post and Gary's comments above for more info (if you haven't already):

https://github.com/gcobb321/icloud3_v3/issues/258#issuecomment-1973708298

The 15-sec time would be determined when the watch or other device approached Home zone and is under 1km Away. When you are in a zone, the watches inzone interval determines when the next location update will be done.

ctankep23 commented 1 month ago

1) Ive updated/migrated to the latest version, I get stuck in configuration at an error saying mobile app integration is not installed (but it is). What now?

2) A family shared device is missing, and when I press "add device" I get "Unkown error occured". What now?

gcobb321 commented 1 month ago

@ctankep23 The mobile app issue is caused by the mobile app loading after iCloud3 which is causing the ‘Monitor the mobile app’ to be reset if there is a problem when it is checked again after HA starts. The way this works has been changed in the next release ( not available yet). v3.0.5.10 will be released after I get back home. A prerelease is below. There is an error which can be ignored.

Unzip the file below into the icloud3 directory and restart ha. icloud3 v3.0.5.10.zip