iCloud3 v2.1 Device Tracker - iCloud3 v2.2 has been released (10/10/2020)

iCloud3 v2.2 has been released. The forum for v2.2 can be found here.

The iCloud3 device tracker custom component is a major advancement over the iCloud component that is part of Home Assistant. It monitors the iOS App for location information and zone changes, uses the Waze route tracker for travel times, supports multiple zones, works with the Family Sharing and Find-my-Friends iCloud Location Services tracking methods, solves the false zone exits caused by gps wandering problem and much more.

Review the feature below and the extensive documentation to see how iCloud3 can be used to monitor your devices to provide you with presence detection that is accurate, responsive and timely.

Current Version-2.1, Updated-3/22/2020

  • Extensive documentation with with examples of presence detection, including sample configuration files can be found here
  • Download the latest release of iCloud3 here
  • The iCloud3 GitHub Repository is here

General Description of the iCloud3 Device Tracker Custom Component

iCloud3 is a device_tracker custom_component for iPhones, iPads and iWatches. It is tightly integrated with the HA IOS App, uses the Waze Route Tracker for distance and time information, creates Dynamic Stationary Zones when you are stationary, supports device include/exclude filters, minimizes battery usage, and much more.

iCloud3 is a Home Assistant device tracker custom component that greatly expands the capabilities of the iCloud HA component. It exposes many new attributes, provides many new features, is based on enhanced route tracking methods, is much more accurate, and includes additional service calls.

Some of these features include:

  • A variable polling interval based on the Waze route mapping service (drive time and distance rather than just a calculated straight line distance).
  • Immediate status update on zone change notification from the bridge IOS App. (enter and exit).
  • Sensor templates that are used in automations, in scripts and on Lovelace cards are created and updated automatically.
  • GPS wandering that changes the device’s state from home to not_home randomly is eliminated.
  • Ability to track your location from multiple zones.
  • Short 15-second polling when less than 1 mi/km from home (reliably trigger automations based on an accurate distance).
  • Ability to include or exclude devices or device types (filters for devices you want to track).
  • Event Log Lovelace card that displays tracking events, device and authentication error messages, iOS app triggers, etc.
  • Dynamic Stationary Zones (conserve battery life when stationary).
  • Old location data and GPS accuracy are automatically discarded.
  • Additional service call commands (setting intervals, pausing and resuming polling, zone assignment, etc.)
  • No longer need any other program (other than the HA iOS companion app) to handle device tracking and presence detection (no more Nmap, OwnTracks or router based tracking components).
  • And more…

Gary Cobb, aka GeeksterGary

Edited March 22, 2020

5 Likes

Any chance of adding to HACS?

(you might want to renumber pycloud version just to be consitent with V2.0)

Yes please adding to HACS will help a lot with installation

Just add gcobb321/icloud3 as a custom repository in HACS, and it will be available.

I will be adding it to HACS in the next few days.

But first, I need to reinstall HACS on my Pi. I had it installed a while ago but HACS was scanning for changed components every time I started HA, which is every time I made a change to the code.

And I will fix the version number in pyicloud-ic3.py.

1 Like

Confirmed. That works :grin:

Many thanks for the excellent work.
I have one question regarding using this tracker without HA iOA app, but with find-my-friends method. I see in the iOS13 “Find My” app, there is option to create notification for entering / leaving locations. Is it possible to use this as zone enter/exit in the iCould3 device tracker?

@suan No this is not possible. Those notifications are probably push notifications that go from phone-to-phone. The notifications from the HA app go from the phone to the device running Home Assistant.

Thanks for this work. I always used version 1 with quite good succes. Now I am trying to update but it is not working. I am using HA 0.101.3 in docker. I first just replaced the icloud3 folder in custom_components with new version of icloud3. Then changed the configuration.jaml for use with FmF. Then I got an error like: track_devices: invalid config. After restart I also saw that the previously used device trackers of the iphone were still using version 1.06.

Then I completely deleted the icloud folder and restarted HA. Then I tried again by using again the folder of icloud version 2. No config errors this time but when I restarted HA I got an error like: Setup failed for device_tracker: No setup function defined.

Any idea how to solve this?

Post your device_tracker.yaml file so we can see your config.

device_tracker:
  - platform: icloud3
    username: [email protected]
    password: xxxxxxxx
    track_devices: 
      - iphonetom > [email protected]
      - iphonemartine > [email protected]

It sees at startup that a custom component is used for devicetracker:

2019-11-19 21:13:34 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for device_tracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.

And then error:

Tue Nov 19 2019 21:13:35 GMT+0100 (Midden-Europese standaardtijd)

Setup failed for device_tracker: No setup function defined.

To use the FMF tracking method, provide the FMF account credentials. Use 2FA account emails for the track_devices as you’ve shown. Add tracking_method: fmf to specify the method.

Adding tracking_method : fmf did not help.

Is it not strange that

“WARNING (MainThread) [homeassistant.loader] You are using a custom integration for device_tracker which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.”

does not report that it is icloud3 as custom integration? All my other custom integration are called by name. Maybe somehow icloud3 in the custom components is not read by home assistant?

@tomdh76 Actually, the iCloud3 tracking_method defaults to ‘fmf’ so it is not really needed. Do you have all of the files in the custom_components/icloud3 directory (init.py, manifest.json, device_tracker.py, pyicloud_ic3.py)? I’ve googled ‘no setup function defined’ and most fixes are related to the configuration.yaml entries. You might also google that and see if anything is similar to your setup.

Yes I have all the files in custom_components/icloud3 folder (and also services.yaml). I see that something is happening in that folder because after a restart folder pycache is created. Just to be sure: the device name is the same as found in the ios app as device id?

@tomdh76 It is if you are using v1 of the iOS app. If you’re using v2, the devicename is the beginning of name set up in the entity registry. More info on that is in the docs.

Yes I have IOS v1.
I have no idea where to look further.

If I replace the folder icloud3 v2 with folder icloud v1.06 and not changing the config of device_tracker.yaml, I at least get again my device_tracker.iphonetom back (from the IOS app). Only a couple of expected errors like track_devices is not supported.

If I then replace folder icloud3 v1.06 with v2 the whole device_tracker component fails (and the IOS component).

Do you have any further suggestions or should I return back to v 1.06?

Rename the current icloud3 folder to icloud3_x and create a new icloud3 folder. Reinstall the 5 files again from the iCloud3 repository and let’s see what happens. Starting with an empty folder will prevent anything from v1.0.6 from getting in the way. If it works, delete the icloud3_x folder in a few days.

Same problem.

Using the icloud3 v1.06 folder and restarting HA I get the devicetracker component to work. If I then rename the folder to icloud3_X and put into custom components the new icloud3 folder the whole devicetracker component fails to load.

Maybe it is an issue with later HA? I use 0.101.3 do you also use that version otherwise I could try to downgrade?

I am on the latest version myself so that’s not the issue. Does this account have 2FA enabled? If so you need to create a dummy account without it and add it to the family/FMF.

Can you try adding it through HCAS?