Skip to content

Commit

Permalink
iCloud3 v3.0.0, Beta 14
Browse files Browse the repository at this point in the history
  • Loading branch information
gcobb321 committed Mar 9, 2023
1 parent e0084c4 commit 4fd713f
Show file tree
Hide file tree
Showing 32 changed files with 2,979 additions and 862 deletions.
148 changes: 145 additions & 3 deletions ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,156 @@
Beta 11 - mm/dd/2023
Beta 14 - 3/4/2023
~~~~~~~~~~~~~~~~~~~~
1. iCloud Account Authentication - When the iCloud Account is verified using a password, a session access
token is created and stored as a cookie. The password login also generates an email saying someone has
logged into your iCloud account. This beta changes the method of authenticating the account to using
the token first and then using the password if it has expired. This should eliminate or greatly reduce
the login emails generated by Apple.
2. Configuration Wizard > iCloud Account Credentials screen - Updated it to improve readability and make
it easier to set up the account information. Several rare problems were also fixed where (1) logging
into an iCloud Account with an incorrect password would still allow access when there was a valid token
and (2) logging into an iCloud Account with a changed password would not work if the token has expired.
Now, logging in with a new password causes a new 2fa request to be made.
3. Zone enter/leave event for an iCloud3 device_tracker entity - This can now be used as an automation
trigger.
4. Latitude/longitude values - They are now stored as numeric fields in the device_tracker attributes instead
of a string field. They are now displayed with 2-decimal places on a Lovelace device_tracker/attributes
window (an HA limitation). A new gps attribute has been added to display the latitude/longitude with it's
full precision.
5. Passive Zones - Fixed a problem where passive zones could be selected. Also found out that the iOS App
will generate enter/exit triggers for passive zones. These will now be ignored by iCloud3.
6. Configuration Wizard > Sensors screen - Changed it for readability and to list the important sensors
first.
7. Event Log - Made some minor formatting changes. Also added a new icon to the top-right of the Event Log
so you can become an iCloud3 Stargazer. Click it to go to the iCloud3_v2 GitHub repository. Then click
the star in the top-right corner.
8. Distance Sensors:
(1) Changed the distance precision so the distance value is within 6-inches/1-millimeter of the
measurement between the device and the zone center - (4-decimal places for miles, 5 for meters)
(2) Changed the '_moved_distance' sensor to display in feet/meters when less than 1mi/1km
(3) Changed the '_moved_distance' to display the distance from one poll to the next when in a zone
(4) Added attribute to '_moved_distance' to show the from and to location time
(5) Added attribute to all 'zone_distance' sensors - 'meters_distance' shows the distance in meters
to the zone with 5-decimal place accuracy
(6) Added attribute to all 'zone_distance' sensors - 'miles_distance' shows the distance in miles
to the zone with 4-decimal place accuracy if the unit_of_measure is miles.



Beta 13 2/21/2023
~~~~~~~~~~~~~~~~~~~~

-------------------------------------------------------------------------------------------------------------------------
VERY IMPORTANT - HA CHANGED THE WAY SENSORS AND DEVICE_TRACKERS ARE SETUP -
THIS UPDATE MUST BE INSTALLED FOR THE 2023.3.1 HA RELEASE

1. Updated the initilization routines to use the new device_tracker and sensor entity creation methods required by HA
for the 2023.3.0 release.
-------------------------------------------------------------------------------------------------------------------------
2. Battery entity - The battery sensors are not created if the device only uses the FmF tracking method (FamShr and
iOSApp are not used). The FmF tracking method does not report battery information.
3. iCloud Interface - There are 4-steps to set up the iCloud Account interface - Setup, Authentication, FamShr, and FmF.
Made some changes to this process to better report the steps (in the Event Log) that had not been completed, what was
in process and what still needed to be done when finalizing the set up process in Stage 4.
4. Changed the device's Info sensor to add details showing when the device left the Last Zone and arrived at the Current
Zones:
At-Home-10:23:00a (2 hrs ago),
Left-School-3:45:50p (10 mins ago).
Changed the dir_of_travel sensor for Towards, AwayFrom and InZone to show the zone's name. Examples:
Towards: `ᗒ Home`, `ᗒ School`,
AwayFrom: `Home ᗒ`, 'School ᗒ',
InZone: `@Home`, `@School`
5. Added options to the way the Device_Tracker state value is set on the Format Settings. It now includes the zone entity
name, the zone's friendly name, and the iCloud3 reformatted names based on the entity id.
6. There are some issues with the source of the zone's friendly name. It is stored in the zone definition file
(.storage/zone) and in the entity registry for the zone. These two areas are sometimes not in sync, particulary when
the name has been changed. iCloud3 not gets the friendly name from the zone file, not the entity registry.
7. Fixed a problem with overlaping zones. When a device is in two zones, the smaller one will now be picked.
8. Changed the Configurator screen on menu page 1 from `Event Log Parameters` to `Format Settings` since that is what it
really is. Also moved the Event Log directory which never gets changed to the Other Parameters screen.
THIS WILL REQUIRE A BROWSER REFRESH when using the configuration screen.
9. Adjusted the distance values when using metric values. The distance is now displayed in meters when it is less
than 1 km.
10. Fixed a problem when the device could be put into a passive zone. They are still displayed in the Zone's list when
starting. Now, an indicator shows it is not used.
11. The display option and the device_tracker state values for each zone are displayed in the Event Log during Stage 2
when starting.
12. Tweaked sone setting in the Event Log card and bumped the version to 3.0.5.
THIS WILL REQUIRE A BROWSER REFRESH.



Beta 12 2/10/2023
~~~~~~~~~~~~~~~~~~~~
1. iCloud3 Configurator - The HA 2023.2.2 seems to have disabled the time entry fields (hh:mm:ss) used
to enter a lot of parameters (inZone Interval, Stationary Still Time, Old Location adjustment, etc).
The screens display but none of thse fields are showing. This may be a HA bug that needs fixing or
they are removing it from HA. In any case, all of the configuration parameter entry screens have
been modified to use another method of entering the parameters. It actually works better, is easier
to use and takes up less screen real estate. The fields can be entered using the keyboard or through
a numeric slider.
THIS WILL REQUIRE A BROWSER REFRESH AFTER DISPLAYING ONE OF THE CONFIGURATOR SCREENS
2. New 'locate' Service call - Added the 'locate' Action to the icloud3.action Service Call. This action
lets you locate a device (or all devices) immediately or in after a specific time has elapsed.
This replaces the set_interval service call in v2.
The following examples explains how it can be used:
Calling method:
service: icloud3.action
data: {action: locate xx min, device_name: xxx}

Examples:
- Locate gary_iphone in 4 minutes: {action: locate 4 min, device_name: gary_iphone}
- Locate gary_iphone immediately: {action: locate, device_name: gary_iphone}
- Locate all phones in 4 minutes: {action: locate 4 min}
- Locate all phones immediately: {action: locate}
2. Event Log > Action - Added the above 'locate' to the Action command manu to locate a specific device or
all devices using the FamShr or FmF methods. Also tweaked the debug/rawdata logging text color on the
heading lines displayed when an update is started or completed. It is now black.
YOU WILL GET A NOTIFICATION TO REFRESH YOUR BROWSER
3. Passthru Zone - Tried to fix the problem with the passthru zone enter delay. A device that was
not using the iOS App (Watch) would set up the passthru zone enter delay when entering a zone but
the next update time was never getting triggered so the zone enter delay was never be cleared.
This stopped the device from being tracked and updated. On a trial run, the passthrou zone delay did
not work but the Watch was tracking without any issues. It is disabled in this beta until I get it
working and have given it a comprehensive test. It should be available in beta 13 next weekend.


Beta 11 - 2/5/2023
~~~~~~~~~~~~~~~~~~~~
1. Added a Stationary Zone name parameter on the Update iCloud3 Devices parameter screen - Each device
can now have it's own Stationary Zone friendly name. This overrides the generic friendly name on the
Special Zones screen for the Stationary Zone.
NOTE: A BROWSER REFRESH WILL/MAY BE NEEDED IF THE FIELD DOES NOT DISPLAY

The default name is 'Stationary'. It can be customized on the Special Zones screen to [name]StatZone
(GarStatZone, LilStatZone). It can now be set by device (GaryZone, LillianZone).
2. Fixed a problem where 'Statioary' was always used for the device_tracker state for a Stationary Zone
2. Fixed a problem where 'Stationary' was always used for the device_tracker state for a Stationary Zone
instead of the friendly name that was set up on the Special Zones/Stationary Zone screen. Also set the
Stationary Zone state to 0 when it was created so the person counter would work.
Stationary Zone state to 0 when it was created so the person counter would work (maybe).
3. Because of the way iCloud location data is processed, Device updates are handled serially. Only one
Device can be updated at a time, the next in line must wait until the previous one is complete. The
method used to control this process was changed to ensure iCloud3 tracking would not hang in up waiting
for one device update to finish when an unknown error occurred or it was taking a very long time to
get location data from the iCloud account. Now, everything is reset if one device has been in an
update process for more than 3-minutes.
[LET ME KNOW IF YOU HAVE ANY PROBLEMS WHERE TRACKING STOPS FOR ALL DEVICES OR ICLOUD3 SEEMS TO BE HUNG UP]
4. Changed the way the Next Update Time is displayed when the update will be done in 90-secs. For example,
the time was formatted as '9:35:15a -45s' indicating the update would be done in 45-secs. This will
break in a future HA release. Now, only the time until the next update will be displayed (45 secs)
when the update will be done within 90-seconds.
5. Added a new configuration screen to change the order the devices are tracked and displayed on the
Event Log. They are processed in the order they were first added to iCloud3 and listed on the iCloud3
Devices List screen. This new screen lets you change this order. Select `Change Device Order` on the
iCloud3 Devices List or the Event Log Parameters screens.
6. If there is an error reading the configuration file when iCloud3 starts, the backup configuration file
is read and the configuration file with the error is overwritten. The configuration file with the
error is now saved with a timestamp before it is overwritten.
7. Fixed a problem where the latitude/longitude values for the Device were not being restored when iCloud3
was starting. The latitude/longitude was set to 0/0 rather than the last known position, putting it in
Atlantic Ocean on the equator off the coast of Africa on the HA map until the device's location was
updated
8. Fixed the problem where the battery would go from a valye to 0 and back to the value during startup.
Again. Really, I think I have it this time, no battery = 0 in my debug logs.


Beta 10a - 1/29/2023
~~~~~~~~~~~~~~~~~~~~
Expand Down
75 changes: 62 additions & 13 deletions custom_components/icloud3/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,50 @@
Beta 13
Beta 14 - 3/4/2023
~~~~~~~~~~~~~~~~~~~~
1. iCloud Account Authentication:
- When the iCloud Account is verified using a password, a session access token is created and stored
as a cookie. The password login also generates an email saying someone has logged into your iCloud
account. This beta changes the method of authenticating the account to using the token first and
then using the password if it has expired. This should eliminate or greatly reduce the login emails
generated by Apple.
- Did a lot of code cleanup in the account authentication routines to insure the 2fa-code is requested
when needed, to be able to reauthenticate and log into the current account with a new password and to
be able to log into a different account in the Configuration Wizard.
2. Configuration Wizard > iCloud Account Credentials screen - Updated it to improve readability and make
it easier to set up the account information. Several rare problems were also fixed where (1) logging
into an iCloud Account with an incorrect password would still allow access when there was a valid token
and (2) logging into an iCloud Account with a changed password would not work if the token has expired.
Now, logging in with a new password causes a new 2fa request to be made.
3. Zone enter/leave event for an iCloud3 device_tracker entity - This can now be used as an automation
trigger.
4. Latitude/longitude values - They are now stored as numeric fields in the device_tracker attributes instead
of a string field. They are now displayed with 2-decimal places on a Lovelace device_tracker/attributes
window (an HA limitation). A new gps attribute has been added to display the latitude/longitude with it's
full precision.
5. Passive Zones - Fixed a problem where passive zones could be selected. Also found out that the iOS App
will generate enter/exit triggers for passive zones. These will now be ignored by iCloud3.
6. Configuration Wizard > Sensors screen - Changed it for readability and to list the important sensors
first.
7. Event Log - Made some minor formatting changes. Also added a new icon to the top-right of the Event Log
so you can become an iCloud3 Stargazer. Click it to go to the iCloud3_v2 GitHub repository. Then click
the star in the top-right corner.
8. Distance Sensors:
(1) Changed the distance precision so the distance value is within 6-inches/1-millimeter of the
measurement between the device and the zone center - (4-decimal places for miles, 5 for meters)
(2) Changed the '_moved_distance' sensor to display in feet/meters when less than 1mi/1km
(3) Changed the '_moved_distance' to display the distance from one poll to the next when in a zone
(4) Added attribute to '_moved_distance' sensors:
- '_moved_from' shows the from location time
- '_moved_to' shows current location time
(5) Added attribute to all 'zone_distance' sensors:
- '_meters_distance' shows the distance in meters to the zone with 5-decimal place accuracy,
- '_meters_distance_to_zone_edge' shows the distance in meters to the edge of the zone
(6) Added attribute to all 'zone_distance' sensors:
- '_miles_distance' shows the distance in miles to the zone with 4-decimal place accuracy if the
unit_of_measure is miles.



Beta 13 2/21/2023
~~~~~~~~~~~~~~~~~~~~

-------------------------------------------------------------------------------------------------------------------------
Expand All @@ -13,26 +59,29 @@ THIS UPDATE MUST BE INSTALLED FOR THE 2023.3.1 HA RELEASE
3. iCloud Interface - There are 4-steps to set up the iCloud Account interface - Setup, Authentication, FamShr, and FmF.
Made some changes to this process to better report the steps (in the Event Log) that had not been completed, what was
in process and what still needed to be done when finalizing the set up process in Stage 4.
4. Changed the device's Info sensor to add details showing when the device left the Last Zone and arrived at the Current Zonea
4. Changed the device's Info sensor to add details showing when the device left the Last Zone and arrived at the Current
Zones:
At-Home-10:23:00a (2 hrs ago),
Left-School-3:45:50p (10 mins ago).
Changed the dir_of_travel sensor for Towards, AwayFrom and InZone to show the zone's name. Examples:
Towards: `ᗒ Home`, `ᗒ School`,
AwayFrom: `Home ᗒ`, 'School ᗒ',
InZone: `@Home`, `@School`
5. Added options to the way the Device_Tracker state value is set on the Format Settings. It now includes the zone entity name,
the zone's friendly name, and the iCloud3 reformatted names based on the entity id.
6. There are some issues with the source of the zone's friendly name. It is stored in the zone definition file (.storage/zone)
and in the entity registry for the zone. These two areas are sometimes not in sync, particulary when the name has been changed.
iCloud3 not gets the friendly name from the zone file, not the entity registry.
5. Added options to the way the Device_Tracker state value is set on the Format Settings. It now includes the zone entity
name, the zone's friendly name, and the iCloud3 reformatted names based on the entity id.
6. There are some issues with the source of the zone's friendly name. It is stored in the zone definition file
(.storage/zone) and in the entity registry for the zone. These two areas are sometimes not in sync, particulary when
the name has been changed. iCloud3 not gets the friendly name from the zone file, not the entity registry.
7. Fixed a problem with overlaping zones. When a device is in two zones, the smaller one will now be picked.
8. Changed the Configurator screen on menu page 1 from `Event Log Parameters` to `Format Settings` since that is what it really is.
Moved the Event Log directory which never gets changed to the Other Parameters screen.
8. Changed the Configurator screen on menu page 1 from `Event Log Parameters` to `Format Settings` since that is what it
really is. Also moved the Event Log directory which never gets changed to the Other Parameters screen.
THIS WILL REQUIRE A BROWSER REFRESH when using the configuration screen.
9. Adjusted the distance values when using metric values. The distance is now displayed in meters when it is less than 1 km.
10. Fixed a problem when the device could be put into a passive zone. They are still displayed in the Zone's list when starting. Now,
an indicator shows it is not used.
11. The display option and the device_tracker state values for each zone are displayed in the Event Log during Stage 2 when starting.
9. Adjusted the distance values when using metric values. The distance is now displayed in meters when it is less
than 1 km.
10. Fixed a problem when the device could be put into a passive zone. They are still displayed in the Zone's list when
starting. Now, an indicator shows it is not used.
11. The display option and the device_tracker state values for each zone are displayed in the Event Log during Stage 2
when starting.
12. Tweaked sone setting in the Event Log card and bumped the version to 3.0.5.
THIS WILL REQUIRE A BROWSER REFRESH.

Expand Down
Loading

0 comments on commit 4fd713f

Please sign in to comment.