Here is a custom_component, icloud2.py, that fixes the issues with the current component. It will only update the device based on the calculated interval, and will also filter the devices on your iCloud account to only track phones.
To use, put icloud2.py in your /custom_components/device_tracker/ directory
EDIT: icloud2 v1.1 update (links updated above too, there was a bug from when I was prepping it for release, that stopped it from updating location on each interval update.
I would like to try the icloud custom_component. I would like to ask about account_name
device_tracker:
- platform: icloud2
username: !secret icloud_username
password: !secret icloud_password
account_name: !secret icloud_descriptive_name <== this can be any name or has to match the phone name?
filter_devices: 'phone'
account_name (Optional): The friendly name for the account_name. If this isn’t given, it will use the account_name of the username (so the part before the @ in the email address).
Basically, once you restart Ha the first time, you will get the popup on your phone to allow, click ok and then you phone will give you a code, disregard the code.
Next go to Ha, click the Ha icloud configure and put in 0 and submit ( the number Zero or Zed )
You’ll then get a txt message on your phone with a code, ( or a call with a code) , use that code and input it in the Ha icloud configure that should now be asking for a code.
2018-02-06 19:58:52 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File “/usr/lib/python3.5/concurrent/futures/thread.py”, line 55, in run
result = self.fn(*self.args, **self.kwargs)
File “/home/ha/.homeassistant/custom_components/device_tracker/icloud2.py”, line 321, in keep_alive
if (self.filter_devices in devicename):
TypeError: ‘in ’ requires string as left operand, not NoneType
I have my wife’s phone integrated into my HA and it continues to work with this new component.
I used to have her as a separate instance but she didn’t like when I made a change and the verification needed to be completed again.
Then I noticed that as we have our locations shared through “share my location” (settings - privacy - location services) that her phone and watch are tracked through the HA component also. Her watch does not appear to be tracked with the new instance, I assume this is due to the filter for ‘phone’. I don’t use her watch for any automations so it works for me.
You need to have iCloud family sharing turned on and have her device named something like “Wife’s Phone” that matches the filter. FMF (Find my Friends) is not currently supported by the underlying library, pyicloud.