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
164 stars 13 forks source link

iCloud3 v3 - General Questions & Help With Problems #129

Open gcobb321 opened 1 year ago

gcobb321 commented 1 year ago

Use this issue to ask for help with problems. Only v3 questions and problems will be answered here. If you are having a problem or v2 related question or problem, go here.

chintito4ever commented 1 year ago

Spent last two evenings setting this up but failed. It wouldn't let me add a device. Whenever I try to submit in "Update Tracked iCloud3 Device" it auto scrolls up to icloud device tracker identity. Doesn't show any error. I could only add my device, none of the my friendsNFamily member's phone being added. image

chintito4ever commented 1 year ago

I see it could be the issue with Apple's latest change that broke FnF updates.

gcobb321 commented 1 year ago

You need to select the FamIly Sharing List Device and the iOS App device (if the iOS App is installed on it) to add ít. Find my Friends devices are not available due to the Apple change.

A message should have been displayed when all the FamShr, FmF and iOS app devices are None.

gcobb321 commented 1 year ago

I just uploaded beta 16c1 that fixes the problem where error messages in the Update Devices screen were not being displayed. I did net change the version number. It will still read b16c

chintito4ever commented 1 year ago

Do you know if that change by Apple is permanent or not? this basically makes it no use for me currently as I mostly track via FnF method.

gcobb321 commented 1 year ago

I have no idea

thiago-s-medeiros commented 1 year ago

I'm not been able to get airpod battery pencentage... always 0%

gcobb321 commented 1 year ago

Mine are always zero too. The raw data from iCloud is always zero so it looks like Apple is not getting it from them.

2023-05-24 02:25:05 [pyicloud_ic3:1359]  ICLOUD > ──────── FAMSHR DEVICE - OFFLINE/NO LOCATION DATA - <GARY-AIRPODS> ────────
2023-05-24 02:25:05 [pyicloud_ic3:1359]  ICLOUD > {'▶ITEMS◀ (items)': {'id': 'AbrWudzuqf...', 'modelDisplayName': 'Accessory', 'lostModeCapable': False, 'name': 'Gary-AirPods', 'deviceClass': 'Accessory', 'deviceStatus': '201', 'rawDeviceModel': 'AirPods_8212', 'batteryLevel': 0.0, 'deviceDisplayName': 'AirPods Pro', 'prsId': None, 'batteryStatus': 'Unknown', 'location': None, 'deviceModel': 'AirPods_8212-0'}}
pitoganzado commented 1 year ago

image how can i fix this message? thank you

JtwoA commented 1 year ago

Have you done steps noted as 1, 2, and 3?

gcobb321 commented 1 year ago

As John said, your browser needs to be refreshed.

amaisano commented 1 year ago

Hi @gcobb321 ! Loving the updated UI/UX for v3.

One issue though - I can't use my old interval of 1 minute for my Apple Watch.

I have issues when arriving home where it takes 5 minutes for my house to see I'm here, so for 5 minutes I get tons of security alerts "SOMEONE IS BREAKING INTO YOUR HOME" - 1 minute is what I used in v2 and it was perfect -- enough time for me to pull in the driveway and stop the car.

Is is possible to set a lower interval for when I arrive home / am home / leaving home zone?

JtwoA commented 1 year ago

Did you not have enormous battery drain setting the Apple Watch interval to 1 minute?

amaisano commented 1 year ago

I do on my iPhone which is connected to the watch, but the watch itself was fine. made it 2 days.

I go for walks and leave my iphone at home too, which is originally why I wanted to use this component. If i always had my phone with me, i'd just use the Geocoded Location tracker that comes with the ios app which is faster than the 5 minute min for icloud.

Unless you have a better option - like something that instantly switches zones when i cross over, but otherwise keeps the polling at a reasonable level at home...

JtwoA commented 1 year ago

Your use case is exactly mine. I have the cellular Ultra Apple Watch and would love to leave my phone behind for runs/rides.

gcobb321 commented 1 year ago

Here is a preview of beta 18. I'll publish it in a few days if everything looks good and there are no new problems.

The two main big changes are (1) the new 'HA hack' that fixes the problem created when the HA guys changed the recorder log history module history and (2) the additional startup retry methods when missing famshr location data is detected during startup.

Unzip to the custom_components/icloud3 directory. icloud3_v3-beta-18b.zip

Change Log:

Beta 18a/b

  1. Fixed the problem where starting iCloud3 would go into a loop between Stages 4, 5, 6, 4, 5, etc.
  2. Fixed a problem doing a fresh install (missing 'start_ic3.set_icloud_username_password' error message)

Beta 18

  1. Event Log - Fixed a problem where displaying a Nearby Devices message would display the text below the Event Log items window due to a HA Front End change.
  2. iOS App Only - Location requests will be sent to the device when the iOS App is the primary data source just like it is to the iCloud Web Service. This only sends a request to the iOS App. If the device is asleep or the iOS App is running in the background or not loaded, it will not respond and send the location. In this case, another location request will be sent when the next update time is reached.
  3. StatZone - Do not create a Stationary Zone when the current location data is old.
  4. History Recorder - Fixed the problem leading to the '_exclude_e' not being found error while adding iCloud3 HA Recorders sensors to the exclude_entities list.
  5. icloud3_debug_log file - Changed the name to 'icloud3-0.log' since it now contains a lot more info than just debug entries. Three generations of the log file will be kept, indicated by the suffix ('-0'=Today, '-1'=Yesterday, '-2'=Two days ago).
  6. Device Verification during startup - When starting up, device data/location information is used to verify the device. If the iCloud Location Service does not respond with location data for one or more devices during startup, the verification process is now automatically retried several times. If it still fails for one or more devices, a restart is needed message is displayed to try again later. The verified devices will continue to be tracked.
  7. Configuration Wizard - Change the range of the inzone interval parameter values from 5-240 minutes to 1-300 minutes.
JtwoA commented 1 year ago

@amaisano - I'd like to know more how you have your apple watch configured. I bumped mine down to InZone every minute and went for a 12 mi bike ride, coming back in an hour and finding 30% of my battery gone on my Ultra. I was running a workout tracker but I do that every night and it hasn't had that result.

Curious how you're configured in iC3.

gcobb321 commented 1 year ago

I found some HACS configuration problems, have fixed them and v3 is now showing up on my system in the Integrations category (along with v2). I had to readd iC3 as a custom repository, download it and restart HA.

See here for information about adding the custom repository.

marceloaf commented 1 year ago

Cool!! Tks

amaisano commented 1 year ago

Does that mean we can update to newer betas via the UI / and/or get notifications on new versions now?

On Tue, Jun 20, 2023 at 5:06 PM marceloaf @.***> wrote:

Cool!! Tks

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

gcobb321 commented 1 year ago

I hope so. I just updated to b18d to test everything. Will probably know tomorrow. I still can not get the iCloud3 description and info to display when iCloud3 is selected. Looking at the .storage/HACS.repository file, the config I submit does not get updated. I’m going to let HACS run overnight without touching anything to see what happens. If it is still not updated, I’ll be in touch with the HACS guys.

amaisano commented 1 year ago

Hey it's working! I think! I just got this a short while ago and hit "Install" will post once restarted to see if it works...

image

gcobb321 commented 1 year ago

The HACS repository file that stores the config may not get updated automatically. If after you select iCloud3 v3, all you see at the top is text with the version and my GitHub user ID (v3.0.0-beta-18c, @gcobb321, ### ,###) with a blank screen below that, you need to force HACS to do an update.

To update the iCloud3 HACS config:

If iCloud3 v3 does not show up, you will need to readd it to HACS as a custom repository:

gcobb321 commented 1 year ago

@Snuffy2 Some files for you with the new recorder_prefilter.

Places files - recorder_filter & sensor

icloud3_v3-beta-19.zip

places-ha-log-new-r_p.py.log.zip

Snuffy2 commented 1 year ago

This looks great and, on initial testing, seems to work well. Thanks!

gcobb321 commented 1 year ago

@Snuffy2 I've done some code cleanup and updated some of the logging. Also redid the docs.

The latest and final is now on GitHub in the recorder_history_prefilter repo here

Snuffy2 commented 1 year ago

Perfect! I'm going to add it as a git submodule to places.

amaisano commented 1 year ago

@JtwoA the 5 minute interval on my watch allowed me to use my watch for about 24 hours, full to empty.

However I noticed this past week since I was able to change the interval to 1 minute, it's been reduced to more like 16 hours.

AND STILL i'm getting reported as an intruder by my home automations when I return home, because 1 minute is still not accurate enough to detect me as home between parking the car and opening the doors.

Here's the issue:

image

You can see the storm door is opened between being "Away" and "Home" on the iCloud3 watch tracker. The iOS companion app is the fastest and is basically instantaneously showing me as home before I even get out of the parked car.

@gcobb321 is there something I can configure to make the -to-home-zone transition snappier?

If not I'll likely create a node-red sensor that uses my iOS companion location if certain criteria is met. 75% of the time I have both my iPhone and Watch on me, so the companion app is good.

It's the 25% of the time I go out for walks and runs WITHOUT my phone that i need/use the iCloud3 tracker for.

JtwoA commented 1 year ago

I've been testing this and have been able to run the full day plus a bit with my Ultra (running beta WatchOS 10).

I, too, carry the phone probably 90% of the time. It's bike rides locally and quick trips to workout that it's Watch-only.

------- Original Message ------- On Friday, June 30th, 2023 at 10:33, Adamo Maisano @.***> wrote:

@.***(https://github.com/JtwoA) the 5 minute interval on my watch allowed me to use my watch for about 24 hours, full to empty.

However I noticed this past week since I was able to change the interval to 1 minute, it's been reduced to more like 16 hours.

AND STILL i'm getting reported as an intruder by my home automations when I return home, because 1 minute is still not accurate enough to detect me as home between parking the car and opening the doors.

Here's the issue:

image

You can see the storm door is opened between being "Away" and "Home" on the iCloud3 watch tracker. The iOS companion app is the fastest and is basically instantaneously showing me as home before I even get out of the parked car.

@.***(https://github.com/gcobb321) is there something I can configure to make the -to-home-zone transition snappier?

If not I'll likely create a node-red sensor that uses my iOS companion location if certain criteria is met. 75% of the time I have both my iPhone and Watch on me, so the companion app is good.

It's the 25% of the time I go out for walks and runs WITHOUT my phone that i need/use the iCloud3 tracker for.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>

gcobb321 commented 1 year ago

@amaisano

There are some sample automations you might want to look at in the iCloud3 docs. The one I use for opening my garage door checks if I’m entering the Home zone OR if the home distance sensors is less than .2. There is also a check to make sure I was driving and had gone 3 more than miles from home. You will never get a fast enough response with just a zone enter because of delays responding to internet location requests, iosapp polling delays, gps accuracy, etc. When you get within 1 mile from home (it may be less), iCloud3 goes to a 15-secs polling interval so you don’t really need a 1-min interval all the time. Follow the events in the Event Log to see what is going on.

JtwoA commented 1 year ago

@gcobb321 , which of these are you referring to by "home distance sensor is less than .2"?

image

gcobb321 commented 1 year ago

I use the gary_iphone_home_distance sensor. See here for my Automation to open my garage door.

DJBenson commented 1 year ago

@gcobb321

I've installed the latest beta from HACS and am getting the below error for all my devices and my device_tracker entities are all showing away;

image
gcobb321 commented 1 year ago

Check the icloud3-0.log and home-assistant.log files for other error messages before that one. There must have been some others during startup up. Turn on debug logging in Event Log > Actions > and restart HA. If problem continues, email the icloud3-0.log file to geekstergary@gmail.com.

DJBenson commented 1 year ago

The icloud3.log file is spammed with the same error message. In the home-assistant.log file I see this;

(MainThread) [homeassistant.components.device_tracker] Platform icloud3 does not generate unique IDs. ID icloud3_myphone is already used by device_tracker.myphone - ignoring device_tracker.myphone

image image

For context I migrated from v2 to v3 so not sure if this is related.

JtwoA commented 1 year ago

@gcobb321 why does my Watch, set to 1 minute, take 3 minutes when I'm arriving home to discover I'm arriving home? My phone was with me and picked right up on it.

I'm using home_device_sensor on both set to .1MI.

image

gcobb321 commented 1 year ago

Because your direction of travel was Away. If distance is < 2km and going Away, the interval is set to the ‘old location thresholds’ value in your config (3 min). The ‘Method’ field in the Event Log Results shows how the interval is calculated. It’s been that way for a long time.

Away is set by comparing the distance of this update with the previous one. If greater than Away. If less than Towards. That is based on the gps from your iCloud account. Maybe previous was old or had poor gps accuracy.

JtwoA commented 1 year ago

Interesting as I had been gone from Home and in another zone completely for over half an hour.

smarthomefamilyverrips commented 1 year ago

Hello @gcobb321

I did install the integration manualy using the b19.2 version but it not shows me the battery percentage of my Iphone 14 PRO .... it stays on 0% ..... any idea how to solve this? Thanks upfront!

gcobb321 commented 1 year ago

@smarthomefamilyverrips

  1. The iosapp battery sensor I is checked every 5-secs. The sensor that is checked is shown in Stage 5 of the startup process. Make sure that is the correct sensor entity and it’s value is changing.
  2. It is also updated from the FamShr data when the device’s location is updated. It is displayed the Results line. If it is correct there but not correct on the sensor.[devicename]_battery state value on the Lovelace dashboard, the wrong sensor name is probably being used. Check the Developer Tools > States screen and Devices z& services > Entities screen for an incorrect or duplicate entity name.
  3. Check the Attributes of the battery sensor on the Lovelace Dashboard screen. There is some info on when it was last updated.
  4. Check the HA Log file for any errors related to the battery.
smarthomefamilyverrips commented 1 year ago

@gcobb321

@smarthomefamilyverrips

  1. The iosapp battery sensor I is checked every 5-secs. The sensor that is checked is shown in Stage 5 of the startup process. Make sure that is the correct sensor entity and it’s value is changing.

You are referring to the HA IOS app?

  1. It is also updated from the FamShr data when the device’s location is updated. It is displayed the Results line. If it is correct there but not correct on the sensor.[devicename]_battery state value on the Lovelace dashboard, the wrong sensor name is probably being used. Check the Developer Tools > States screen and Devices z& services > Entities screen for an incorrect or duplicate entity name.

I only find one battery entity with unique name giving value 0

  1. Check the Attributes of the battery sensor on the Lovelace Dashboard screen. There is some info on when it was last updated.

Seems like not get updated at all

data_source: iCloud3 sensor_updated: '2023-07-15 12:52:31' battery_status: '' battery_data_source: '' battery_level_updated: '00:00:00' device_class: battery state_class: battery unit_of_measurement: '%' friendly_name: Lory Iphone New Battery

  1. Check the HA Log file for any errors related to the battery.

No errors related to battery nor integration in logs

gcobb321 commented 1 year ago

The sensor for the ios battery App that is monitored is shown in Stage 5. An example is in the iCloud3 docs here.

At the bottom of the screen Image for _Tracked Device: garyiphone (Gary/iPhone) shows that the _Battery: gary_iphone_app_batterylevel . That is the iOS app sensor that is being monitored and it is created and updated by the iOS app. Verify that that sensor exists and is being updated. If not, refer to the iOS App docs regarding that.

Also look on the Event Log screen to see if the Battery level shows there. It’s value in listed on the Results line below the red line that shows the zone, travel time and distance when a device is tracked.

smarthomefamilyverrips commented 1 year ago

@gcobb321

I have a entity battery level that is reported by the HA app but this not updates regularly now is on 64% while phone is on 62%

I now did add the device also at Family Share field and now get a value at battery, it only not updates the value... it stays on 63% while phone already jumped to 62% ..... only when I reload the integration the battery level get updated

Also where I find event log screen?

gcobb321 commented 1 year ago

@smarthomefamilyverrips The iOS App battery_level sensor is monitored every minute, the FamShr is only updated when the device is located,

You can find info on the Event Log here and here and here

smarthomefamilyverrips commented 1 year ago

@gcobb321

After some trying and tweaking HA app it seems all is working as expected.... Thank you for your help!

gcobb321 commented 1 year ago

I'm glad you got it working. Also, I'm working on a FAQ for the iCloud3 docs and would like to include what you did to get it working. Then, next time someone runs into the problem, I could just point them to that answer.

Thanks.

smarthomefamilyverrips commented 1 year ago

@gcobb321

The problem with not having any value and state for battery entities ( 0% / -----) was solved with choosing the iPhone as device in FamShare field in device config of integration

To have more frequently updates I did change the update interval when present in a zone from the standard 120 minutes to 5 minutes.

Also I used the "IOS ShortCuts App" (https://support.apple.com/guide/shortcuts/welcome/ios) to set some automations to trigger sensor updates of IOS HA App (ex. when open Facebook App then Update HA Sensors)

These settings and tweaks made it work for my use case of the iCloud3 V3 integration.

strickersuk commented 1 year ago

Is there a maximum of 10 items at the top of the event log?

gcobb321 commented 1 year ago

@strickersuk Yes. The max is 10 devices for the Event Log and Configurate Settings > Update Devices screen

smarthomefamilyverrips commented 1 year ago

@gcobb321 if I first did manual copy the folder in to custom folder can I then now use repository in HACS to update to latest release? Or should I again copy the folder manually?