iCloud3 v2.0 Device Tracker Released

iCloud3 v2.0 Released for General Availability

Current Version-2.0.5, Updated-12/8/2019

This is a major update to iCloud3 with many new features.

  • (New) Find-my-Friends (FmF) tracking method to locate devices with the iCloud Location Services if you have 2fa on your iCloud account.
  • (New) Family Sharing (FamShr) tracking method to locate devices with the iCloud Location Services if you do not have 2fa on your iCloud account.
  • (New) Integration with the Home Assistant Companion App version 2
  • (New) Use either HA iOS App version 1, version 2 or both on the same device_tracker platform.
  • (New) iCloud3 Event log Lovelace custom card.
  • (Updated) Additional attributes & sensors
  • (New) Customize the list of sensors that are created by iCloud3.
  • (New) Track devices from multiple zones.
  • (New) The iCloud3 documentation has been updated and reorganized to make it easier to reference.
  • (New) Display debug information related to processing the device’s location data reported by the iCloud Location Services and the HA iOS App. This data can also be displayed in the iCloud3 Event Log Card.
  • Many new and updated automations, scripts and Lovelace cards
  • And much more…

There are many breaking changes in this release. Be sure to review the Change Log in the iCloud3 Documentation. The method of specifying how tracked devices are selected has been completely rewritten to support the new Find-my-Friends tracking_method using the track_devices parameter.

  • Complete documentation with all enhancements and breaking changes can be found here
  • Download iCloud3 v2.0 here
  • The iCloud3 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.

  • Extensive documentation with with examples of presence detection, including sample configuration files can be found here
  • Download iCloud3 v2.0 here
  • The iCloud3 Repository is here

iCloud3 is a Home Assistant device tracker custom component that greatly expands the capabilities of the iCloud (and iCloud2) 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.
  • Abilitity 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).
  • 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 v1 or v2 app) to handle device tracking and presence detection (no more Nmap, OwnTracks or router based tracking components).
  • Many new configuration variables, attributes, sensors and Service Calls. A geekster stastic: The lines of code went from 425 to 6500+.
  • And more…

Gary Cobb, aka GeeksterGary

Edited November 17, 2019

3 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?