@nicx You both will want to enable debugging and then look though your home-assistant.log for "custom_components.device_tracker.icloud2] Updating device "
The way the component is currently written if you have a matching device that is offline the calculated interval will stay at one minute, and you’ll drain the battery on all of your devices quickly.
Just so I am clear on this, tracking any device that’s off, causes all other devices to drain the battery as well? Does that mean individual devices are not tracked, but every device is tracked every time any device location is requested?
Yes, that is the way the component and the underlying library, pyicloud, is written. Anytime the component interval evaluates true, a find my iPhone call is made to all devices on that iCloud account. It’s not ideal but I didn’t see any way to improve from the icloud2 component level with just a cursory look through pyicloud.
You can also see with the current iCloud device tracker component that is in the HA release that if you have say four devices you will be polling each device four times a minute! Crazy battery drain!
When you add the icloud email, password, name to show in HA / your iphone will say somewhere has try to login to use icloud. The step for icloud to authorized your accounts to HA is on post #8 Mr.VladTepz
I set up icloud2 but I do not see any new device in the list. I have nmap enabled so devices are being tracked by it. I do not see any new device connected to icloud2 anywhere. What am I doing wrong ?
for iphone you have to allow Settings > iCloud > Share My Location.
for nmap enable, this is for local connection same network.
If your network didn’t find any new devices (iphone). Check at known_devices.yaml in your home assistant config folder.
If there isn’t any new device in known_devices.yaml, then manually add them in
devicename: <=== this normally is the name you given according to your iphone Setting>General>about>name> then the name your iphone use
name: Friendly Name <== name display in HA
mac: EA:AA:55:E7:C6:94 <== iphone mac address
picture: /local/****.jpg <== ****.jpg file locatedin www folder in your homeassistant folder
track: yes
hide_if_away: no
Thank you for your help .
My iCloud “Share My location” is always on. I do know that nmap scans my network and gets all devices on my LAN using MAC address: After activating icloud2 and going through apple verification, I still don’t see any new devices added to my know_devices.yaml file.
I have tried all HA presence detection components. I think Geofency work best for me so I will stick with that for now. Again thanks for help.
I wanted to try and save batteries a bit and trigger the icloud tracking only by other events, never periodically. E.g. magnetic door sensor: when front door is opened, check if a family member’s location changed from not_home to home --> turn on lights and TV. Or vice versa, door opens, one minute delay, some family member from home to not_home AND all family members now not_home, turn off all lights. Or, door opens, all family members status stays at not_home --> alarm.
I just couldn’t find how to make this manual triggering of icloud tracking in automation. Is it possible?
What sort of timeline are you thinking it will get added to the main component? I’m using the iCloud component currently and wondering if i try holding out using that or consider moving over to your battery friendly version
Thanks for the useful component. However, even putting the configuration as explained, all my iCloud devices are listed and not only my iPhone. How can I fix this?