iCloud3 v2.2.1 Device Tracker-Advanced tracking features, iOS App monitoring

So if im right the “track_devices” is replaced by “devices” ?

track_devices:
  - peter_iphone > local/images/person/peter-home.jpg
  - cenkay_xr > local/images/person/kay-home.jpg, noiosapp

become:

devices:
  - device_name: peter_iphone
    name: Peter iCloud3
    picture: local/images/person/peter-home.jpg
    iosapp_suffix: -app

  - device_name: cenkay_xr
    picture: local/images/person/kay-home.jpg
    name: Kay iCloud3
    noiosapp: true

is this correct? I use family share.

- platform: icloud3
  username: !secret icloud_peter_username
  password: !secret icloud_password
  tracking_method: famshr
  config_ic3_file_name: "/config/package/config_ic3.yaml"

EDIT: Test it and seems to work this way… :slight_smile:

@poudenes
iosapp_suffix - This is only needed if you have the iOS app device tracker entities devices several times due to reinstalling. I would remove it. iCloud 3 will find the one to use for you.
name - That is fine but I would only make it ‘Peter’ or ‘Kay’ so it doesn’t take up as much room on the Event Log items.
tracking _method - Only needed to not use iCloud Location Services (fmf and famshr). You could remove this.

But it looks good.

The track_devices is not being removed and will continue to work. It is only being depreciated. However, any device parameters added in the future would only be supported by the new method.

1 Like

I have fixed a misspelled field name (device_field vs device_fields) in v2.3 and have posted an update. It only effected those who specified the ‘name’, ‘email’ or ‘picture’ in the HA configuration file. I updated the v2.3 zip file but did not change the version number in iCloud3. The description of the file in the development-v2.3.zip file does indicate it has been updated to v2.3a.

The error was in the HA log file. You may want to check the HA Sidebar > Configuration > Logs every once in a while to see if any errors are displayed for iCloud3.

1 Like
  • I’m using iCloud3 version 2.2.1 installed from HACS.
  • I just started a fresh install on 2020.12.7, so I don’t have any info from prior releases.
  • It does tell me the entity name, but I’m only tracking one device at the moment so I didn’t think it was relevant.
  • I disabled it and restarted and the error is no longer there.
  • The HA log is where I see “the see service is not supported for this entity device_tracker.garrettsiphone”. There are no other errors related to iCloud3, other than the one saying that it’s a third party component.
  • How would I see if there are any conflicts for the device_tracker entity?
  • I don’t see anything else out of the ordinary and it functions perfectly otherwise, except for that error spamming my log. I get the error about 10 times per second, if that helps.

Here’s my config:

device_tracker:
  - platform: icloud3
    username: [secondaryemail]@gmail.com
    password: [password]
    tracking_method: fmf
    create_sensors: zdis,zon,lzon,bzon,badge,name
    track_devices:
      - garrettsiphone > [email]@gmail.com, garrett.jpg, Garrett

Thank you for your help!

@gcobb321 Hi Gary, I’m seeing an issue with the image of the ‘badge_picture_name’ not showing in my ‘glance’ card. The state is there but without the corresponding picture image, my image is in /local/‘picturename’ and was previous showing with previous RC(s).

Thank you!

PS: I’m following the defined convention below.

@bastero
There was a p problem in the original v2.3 where several fields in the config were not being set. See my posting above. If you see a message in the Configuration > Log about device_field was not found, that is the issue. I fixed it about 5 hours ago. Download the zip file update again, unzip it and see if that fixes the problem.

Hi Gary,

My understanding is that you figured out the Apple ID (2FA) issue, without the need to have the HA app installed in every Apple device?
I hope the answer is yes, because the normal iCloud integration has me one step from deleting 1000 lines of yaml and choosing a different home automation system altogether… (not really but getting a notification from Apple every 30 or so min in 3 devices is no fun!).

Thanks for your hard work. I read your contributions on the 2FA bug on GitHub and they are significant!

George

@gcobb321 Should have mentioned this in my earlier post. I did see your update v2.3a and I loaded it. The issue I’m referring to, is based on your latest update.

The issue persists, thanks for looking into it.

Cheers!

@garrettbeachy
The message is coming from HA and I think it’s generated when there is some type of conflict with the entity name trying to track a device. I would try the following and see what happens:

  1. Remove the *create_sensor * from the parameters.
  2. Check the Event Log initialization and see what the iOS app device tracker entity name is, iCloud3 monitors and the ones it finds during the entity registry scan. The iOS app name must be different than the iCloud3 device name.
  3. Review the HA Sidebar > Configuration integration for the iOS app for multiple entries and conflicting names.
  4. Add ‘noiosapp’ to the parameter to stop iCloud3 from monitoring the iOS app.

@bastero
What does your track_devices parameter look like? Same as before with the track_devices or the new way?
Is it in the HA Configuration.yaml file or in config_ic3.yaml?
The parameters are decoded during Stage 2 of the iCloud3 startup and info is displayed in the Event Log. Does it look correct?

@george_b
Yes, that is correct. I worked with the developer of the 2fa support and it has been incorporated in the soon to be released iCloud3 v2.3… That version is available in the development v2.3 directory of the iCloud3 GitHub repository and will be released shortly after the docs are updated and a few final bugs are worked out regarding the new iCloud3 parameter update.

To use it, install it from HAaCS, then download the zip file and unzip it into the iCloud3 custom components directory.

The code to support 2fa in the iCloud integration has been submitted but I’m not aware if it has been approved by the HA guys or when it will be available. They have very strict guidelines on the code whichi don’t have since iCloud3 is a custom component.

@gcobb321 Thanks Gary, as you mentioned that the legacy method was being deprecated, I decide to change to the new way. I’m running HA 2020.12.2.

The following is in both configuration.yaml & config_ic3.yaml. Everything looks correct in the Event log no errors.

device_tracker:
  - platform: icloud3_23
    username: !secret icloud3_username
    password: !secret icloud3_password
    devices:
      - device_name: iphoneexpress
        email: [email protected]
        name: Express
        picture: JC.jpg
      
      - device_name: garbineiphone
        email: [email protected]
        picture: GU.jpg
        name: Garbine

@bastero
Check the name of the .jpg files. My guess is the file names are gu.jpg and jc.jpg, not GU.jpg and JC.jpg like you defined in the parameters. In linux, case matters.

EDIT (20:42) the problem was in config_ic3.yaml

Some lines had " " instead of ’ '
Strange, because HA doesn’t care about that.

Changed now to ’ ’ and the errors are gone.

Ater reboot HA (at this moment) I get this error:

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 2643, in _polling_loop_15_sec_icloud
    self._update_device_icloud('iCloud/FmF Reauth', update_via_other_devicename)    #Retry update devices
UnboundLocalError: local variable 'update_via_other_devicename' referenced before assignment
2021-01-05 20:29:51 ERROR (SyncWorker_15) [custom_components.icloud3.device_tracker] '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 2698, in _update_device_icloud
    and self.next_update_secs.get(devicename_home_zone) > self.this_update_secs):
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2021-01-05 20:29:51 ERROR (SyncWorker_15) [custom_components.icloud3.device_tracker] âºINTERNAL ERROR-RETRYING (_update_device_icloud:OverallUpdate-'>' not supported between instances of 'NoneType' and 'int')
2021-01-05 20:29:55 ERROR (SyncWorker_9) [custom_components.icloud3.device_tracker] '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 2698, in _update_device_icloud
    and self.next_update_secs.get(devicename_home_zone) > self.this_update_secs):
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2021-01-05 20:29:55 ERROR (SyncWorker_9) [custom_components.icloud3.device_tracker] âºINTERNAL ERROR-RETRYING (_update_device_icloud:OverallUpdate-'>' not supported between instances of 'NoneType' and 'int')
2021-01-05 20:30:00 ERROR (SyncWorker_18) [custom_components.icloud3.device_tracker] '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 2698, in _update_device_icloud
    and self.next_update_secs.get(devicename_home_zone) > self.this_update_secs):
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2021-01-05 20:30:00 ERROR (SyncWorker_18) [custom_components.icloud3.device_tracker] âºINTERNAL ERROR-RETRYING (_update_device_icloud:OverallUpdate-'>' not supported between instances of 'NoneType' and 'int')
2021-01-05 20:30:00 ERROR (SyncWorker_18) [custom_components.icloud3.device_tracker] '>' not supported between instances of 'NoneType' and 'int'
Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 2512, in _polling_loop_15_sec_icloud
    and self.next_update_secs.get(devicename_zone) > self.this_update_secs):
TypeError: '>' not supported between instances of 'NoneType' and 'int'
2021-01-05 20:30:00 ERROR (SyncWorker_18) [custom_components.icloud3.device_tracker] iCloud/FmF API Error, will reauthenticate and retry
2021-01-05 20:30:01 ERROR (SyncWorker_18) [custom_components.icloud3.device_tracker] local variable 'update_via_other_devicename' referenced before assignment
Traceback (most recent call last):
  File "/config/custom_components/icloud3/device_tracker.py", line 2512, in _polling_loop_15_sec_icloud
    and self.next_update_secs.get(devicename_zone) > self.this_update_secs):
TypeError: '>' not supported between instances of 'NoneType' and 'int'

Schermafbeelding 2021-01-05 om 20.36.23

###########################################################################################
# CONFIG FILE FOR ICLOUD3 YOU CAN CHANGE THIS RESTART ICLOUD TO MAKE IT ACTIVE
# https://gcobb321.github.io/icloud3/#/chapters/2-config-parms
###########################################################################################
devices:
  - device_name: peter_iphone
    name: Peter
    picture: local/images/person/peter-home.jpg
  - device_name: cenkay_xr
    picture: local/images/person/kay-home.jpg
    name: Kay
    noiosapp: true

###########################################################################################
# General Parameters
###########################################################################################
# group: family
event_log_card_directory: "/log"
unit_of_measurement: km

###########################################################################################
# Zone/Tracking Parameters
###########################################################################################
inzone_interval: "60 min"
max_interval: "4 hrs"
center_in_zone: true
stationary_inzone_interval: "30 min"
stationary_still_time: "8 min"
stationary_zone_offset: 1, 0
travel_time_factor: .6

###########################################################################################
# Accuracy Parameters
###########################################################################################
gps_accuracy_threshold: 75
ignore_gps_accuracy_inzone: true
old_location_threshold: "3 min"

###########################################################################################
# Waze Parameters
###########################################################################################
distance_method: waze
waze_region: EU
waze_min_distance: 1
waze_max_distance: 1000
waze_realtime: false

@gcobb321 That’s why you do what you do! Thank you very much Gary, that was the fix!
Cheers.

PS: Gary, for completeness, in the previous definition of the track_devices parameter the usage of capitalized (jpg) names worked per below.

track_devices:
      - iphoneexpress > [email protected],/local/JC.jpg, _app
      - garbineiphone > [email protected],/local/GU.jpg, _app

@poudenes
I was stripping single quotes (’…’) but not double quotes("…") from the parameter line. That bug has been there for several years and is now taken care of.

Cloud3 v2.3b is now available

I’ve updated the v2.3 development version to fix a few bugs that have been reported. As always, download and install the zip file into the icloud3 directory.

  1. Fixed a bug where the last device_name in the devices list was not added to the list of tracked devices if it was the last one and there were no parameters after the devices parameter. This didn’t happen if there was another parameter after the ‘devices:’ parameter or the parameters were in the HA configuration.yaml file
  2. Fixed a bug caused by a misspelled variable name (device_field vs device_fields).
  3. Added error checking to prevent a crash during startup if there were any delays in retrieving location data from iCloud before everything had been set up. (hopefully)
  4. Fixed a bug were quote marks ("…") were not being stripped from values in the config_ic3.yaml file. This one has actually been around for several years.
1 Like

Even though I couldn’t find anything about it in the logs, I manually changed the entity_id of device_tracker.garrettsiphone and it seems to have cleared it up. Thanks for your help!

@gcobb321 Hi Gary, installed RC2.3c and seeing the following error in the Event log. I’ve moved the config_ic3.yaml file to /config/config_ic3.yaml as described in the error message.

Can you advice what needs to be done to address what’s been called out in the error message regarding the device_tracker handling? Thank you!

config_ic3.yaml

device_tracker:
  - platform: icloud3_23
    username: !secret icloud3_username
    password: !secret icloud3_password
    devices:
        - device_name: iphoneexpress
          email: [email protected]
          name: Express
          picture: jc.jpg
        
        - device_name: garbineiphone
          email: [email protected]
          picture: gu.jpg
          name: Garbine

@bastero
The config_ic3 file is a second file that is used only by iCloud3 for it’s parameters. It does not define the HA device tracker platform.

The statements device_tracker, platform, username & password belong in the HA configuration.yaml file, not in the config_ic3.yaml file.

In configuration.yaml

device_tracker:
  - platform: icloud3_23
    username: !secret icloud3_username
    password: !secret icloud3_password

In config_ic3.yaml::

devices:
  - device_name: iphoneexpress
    email: [email protected]
    name: Express
    picture: jc.jpg
        
  - device_name: garbineiphone
    email: [email protected]
    picture: gu.jpg
    name: Garbine