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
498 stars 52 forks source link

iCloud3 v3.0.rc10.4 (2/18/2024) is now available #305

Open gcobb321 opened 4 months ago

gcobb321 commented 4 months ago

This release fixes a few bugs with the Fixed Interval parameter introduced in rc10.1. It also simplifies access to NearBy device distance attributes and cleans up some code.

Gary

Important Links

Installing using HACS - iCloud3 is not available on HACS unless you have set it up as a custom repository. See here for instructions on how to do that and then install it. If you just go to HACS and do the installation, you will be installing v2.4.7, not v3. Manual Download and Install - Go to the iCloud3 Releases page here. Scroll down past the notes, then select Assets, then select icloud3.zip. Download the zip file and unzip it into the /config/customcomponents/icloud3 directory. Then restart HA. **Migrating from v2.4. - See here for instructions on migrating from from an older version. iCloud3 v3 Documentation** - It is still in process, does not include the latest updates to iCloud3 and can be found here

Change Log

  1. FIXED INTERVAL -

    1. Normally, when a device is getting close to Home, the location interval changes to 15-secs to be able to update the Home distance very quickly. This lets automations fire when approaching Home in addition to when entering the Home zone. When a Fixed Interval was being used, the Fixed Interval was overriding the short interval time iCloud3 calculated based on distance from Home so iCloud/FamShr locates were never being done. Additionally, a locate request would not be done if the Old Location Threshold was greater or the same as the Fixed Interval value and old locations were being accepted.

      Now, iCloud3 will calculate the interval using the distance from Home as it normally does. If that value is less than 5-minutes, it will be used. Otherwise, the Fixed Interval will be used if it is set.

    2. Fixed a problem where the results from one device with a Fixed Interval was being used for another nearby device that was not using a Fixed Interval.

    3. The minimum Fixed Interval is still 5-minutes.

  2. TRAVEL TIME INTERVAL AND NEXT LOCATION UPDATE MULTIPLIER - (Configure Settings > Tracking Parameters screen) - This value (.1 to .8) is used to determine the Interval and when the Next Location Update should be made using the travel time to Home. For example, if the travel time is 8-mins and the multiplier is .5, the next update will be done in 4-mins. This has been changed from entering a decimal value (.1 to .8) to a drop down list that goes from Shortest Interval Time, to Shorter Interval Time, to Average, Longer and Longest. It defaults to Average (.5*TravelTime) and you will probably never change it.

  3. HOME_DISTANCE & ZONE_DISTANCE SENSOR - Changed the way the zone and devices distances are displayed to provide better accuracy and make it easier to display them on a dashboard screen entity card. The iCloud3 documentation > Sensor Attribute chapter was updated to provide screenshots and example code that will help explain how to do this.

  4. OTHER STUFF - Fixed a few other bugs. Cleaned up some code.

Dekadinious commented 4 months ago

@gcobb321 Does this mean that the lowest possible update interval is 5 minutes? So I could not trigger the garage opening when 200 meters from home, because that is just 15 seconds from home?

gcobb321 commented 4 months ago

@Dekadinious No. If the calculated interval is less than 5-min, then that value is used. If it is greater than 5-min, then 5-mins will be used. I’m using the enter Home zone or _home_distance below .20 mi to trigger my ‘arrive home zone’ automation.

Dekadinious commented 4 months ago

Thanks for the answer! :)

I will try to implement it!

gcobb321 commented 4 months ago

@Dekadinious There is a’ Sample Automations chapter in the iCloud3 docs that shows what I am running

Dekadinious commented 4 months ago

Thanks! I already have an automation for myself and my Android. It was straightforward to set up with all the standard functionality of the HA app and high accuracy tracking etc. Sadly with my wife's iPhone, I seem to be getting nowhere. I updated to the newest RC and I am stuck getting the location even to update. She is just stuck at home. The last update was when I updated the integration yesterday at 15:00. It says the next update should be yesterday at 17:00. She is now on a little drive and has been for the last 40 minutes, but it still says she is at home.

I don't even know where to start troubleshooting. I have looked through all the docs, but it all just seems so complicated when there are no updates on the tracker and I can't fathom why.

gcobb321 commented 4 months ago

Do this: Event Log > Actions > Start Debug logging Event Log > Actions > Restart iCloud3 Let it run until it tries to locate your wife’s phone but doesn’t Email the icloud3-0.log file to geekstergary@gmail.com and I’ll look at it to see if I can spot what is going wrong.

I suspect you have several old phones you are no longer using still in your iCloud Family Sharing List and have selected one of those in the Configure Settings > Update Devices screen for her install of her real phone. All l of the devices in the list are displayed in the Event Log Stage 3 when iCloud3 starts.

peetereczek commented 4 months ago

Custom card is moved to wrong place, as per lates changes in HACS it should be under /config/www/community/icloud3/icloud3-event-log-card.js so it can be defined as lovelace resource /hacsfiles/icloud3/icloud3-event-log-card.js

gcobb321 commented 4 months ago

iCloud3 puts the .js file in the www/icloud3 directory on a new install or where it was if v2 was previously used. It is not trying to put it where HACS puts a custom card.

You can put it in that directory if you want, set the resources to how you have configured your setup. The Configure Settings > Tracking and Other Parameters screen lets you indicate the directory you have assigned and will use that directory for any Event Log .js file updates.

peetereczek commented 4 months ago

iCloud3 puts the .js file in the www/icloud3 directory on a new install or where it was if v2 was previously used. It is not trying to put it where HACS puts a custom card.

You can put it in that directory if you want, set the resources to how you have configured your setup. The Configure Settings > Tracking and Other Parameters screen lets you indicate the directory you have assigned and will use that directory for any Event Log .js file updates.

Right, thanks for the hints, found the setting

amaisano commented 3 months ago

Hi there, very confused about the new v3 release(s).

I've been using the v3 dev version for months since it was available, but recently an update was made to make the interval minimum 3 minutes instead of 5, and not matter what I do I cannot get that setting updated.

I've tried re-downloading the HACS v3 integration ("iCloud3 v3, Developers Version") but it doesn't include that change.

I see there are other branches I can switch to there, but I'm A) Afraid to lose all my settings and B) not sure which one I'd pick anyway. Main? rc4?

Just a bit bewildered, since until now, all the updates to v3 just popped up as a normal update in HA, now nothing. Please advise.

gcobb321 commented 3 months ago

I posted v3.0.1 about 1-hour ago with this change. It was slid into one of the v3.0.1 beta versions. The v3.0 and v3.0.1 beta release was not posted to the iCloud3 repository, only to the iCloud3_v3 development repository.

Also, you will not lose any config settings during an update. They are all in the config/.storage/icloud3/configuration file.

amaisano commented 3 months ago

OK, thanks. So we should keep using the v3 Dev repo, and pick the latest release tags in HACS? Or enable Beta for the main v2 repo, and use something there?

Are updates manual now (meaning, can't be done with the HA UI)? I saw your note about .zip in the other thread.

gcobb321 commented 3 months ago

Updates take a day or so to show up in HACS unless you know about them and refresh the HACS/iCloud3 info. The dev repo is always updated first. It had been on v3.0 for 2-weeks while it proved itself, leading to v3.0.1. After a bunch of installs without any issues showing up, I’ll release it to the iCloud3 general repo for everyone to use.

amaisano commented 3 months ago

I have 3.0.1 now which has the interval change, but the config UI is unable to allow me to set the inzone interval lower than 5 minutes (field turns red and i can't Submit):

image

gcobb321 commented 3 months ago

Only the Fixed Interval was changed to 3 minutes. The Inzone Interval is still 5 minutes.

amaisano commented 3 months ago

Oh. Well i can't set either of these to 3. Only 5:

image

gcobb321 commented 3 months ago

The slider step is 5. To enter 3, move the cursor to the minutes entry field, delete the value in that field and type 3.

amaisano commented 3 months ago

Ok, that worked, but the minutes input field was still underlined in a red error state. It did let me submit however. Seems like a UI bug? Thank you.