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

@Allistah

  1. The stationary zone is reset to your location when you haven’t moved for a while and you are not in a zone. If you are already in a zone (e.g., home), it will remain at its base location 1km north of home.
  2. You do not have to do anything to use Waze.
  3. I’m the only one who has written the code. I’ve had a lot of suggestions over the past few years for features and a lot of people have helped test it. At over 9000 lines of code, it does do a lot of things.

Some things I’ve found out/confirmed - The FmF data from iCloud contains the people you are following and the people following you. You cannot share your location with yourself so you are not in the following table so, internally, your location is not available. However, if someone else is following you, you will be in the The data as being followed and your location is available. I hope that makes sense. In other words, if your wife follows you on the FindMy app, your location is available and can be retrieved by iCloud3. If you don’t have anyone following you, your location is not available. At least until I find a way around this problem.

The current version (rc5) only looks at the people you are following. I have changed iCloud3 to also look at the people following you and will update it to rc7 tomorrow. Have her follow you, update to rc7 and let’s see what happens.

I understand the stationary zone the way the manual reads and what you’ve described. Is there a benefit to having it way out there to the side like that versus just having the stationary marker at home with me?

On Waze, thanks - I’ll just use it then.

Nice on the code, you’ve clearly done a lot of work on this - so thank you.

I understand the whole FmF thing. I’ll test it later. She is leaving now so I’ll be doing some tests with the Family Plan. Once things are working I’ll try out the FmF thing once RC7 is out.

I made a page that has all the iPhone parameters so I can see how things work when my wife is out and about.

Do I have to have an entry into my HA machine from outside the home for everything to work? I currently don’t have any way for the HA app to get to the server if it’s not on the home WiFi.

@Allistah
I’ve tried overlaying the stationary zone with the Home zone and it lead to all kinds of conflicts identifying zone locations, zone sizes, zone enter/exits triggered by the iOSapp. Lots of problems and benefits.

I use the duckdns HA integration to use the iOSapp on the phone and ipad when away from home. I set it up years ago so I won’t be able to help but there is lots of info on what to do in the HA duckdns integration docs. I also have HA 2fa enabled and use letsencrypt (part of duckdns) for encryiption.

Shouldn’t the details in the red box be updating? I see the updates happening as she is out driving showing up the event log on the right. I would think it would not say “In Zone” for her.

I also noticed that the Located and Last Update times aren’t changing even though I’m seeing updates on the right. Seem like these stats are frozen as if she is still in the zone called Home.

UPDATE:
It seems that the info in this box updated once she reached a zone I had set up for where she was going. It also seems that Direction always stays at “In Zone”.

I also don’t have any driving flag entities. Is that something I have to create myself? If so, how do I link that into iCloud3 so it gets updated?

I made a page that shows all the stats of her phone in a big list. It shows that her phone’s geocoded location is still the address here at home even though she is gone and has reached another zone.

Another Update:
She has left the zone and is now at a store - since she called me with a question. Her icon still shows that she is at the zone she was in a bit ago and the Direction still says In Zone. Guessing I must not have something set correctly or something or maybe a bug? How can I figure this one out?

Posting some images so help troubleshoot this:


Screen Shot 2020-12-12 at 12.52.10 PM

@Allistah
Make sure you have the iOS App set up on her phone with the same settings as your. Also review the entities (and their suffixes) listed iOS App Monitoring list in Stage 3 of the iCloud3 Initialization messages in the Event Log to make sure they are correct.

iCloud3 Release Candidate 7 is now available.

iCloud3 now works with the Apple Verification ID Code and support 2-factor-authentication

This is significant update to iCloud3. It supports true 2fa verification using the 6-digit Apple ID Verification Code sent from Apple when you log into iCloud. Go here for more information about verifying your Apple account.

Download the zip file from the development-v2.2.2 directory here , unzip it into the icloud3 directory and restart HA.

Changes in Release Candidate 7

  • More improvements to the iCloud Interface Program (pyicloud_ic3.py) that include a more efficient authentication and verification process, reduction in the internet calls that should increase response time, further reduction in the emails from Apple about someone has logged into your account and other internal updates.
  • Reformatted various Event Log messages.
  • Fixed a problem that occurs when the devicename is “iPhone”.
  • Fixed a problem where zone changes were being detected when there was no change. This seemed to occur if there were spaces and underlines in the zone name.
  • Improved scanning the FmF device data returned to iCloud3 to better support phone identification. iCloud now scans the people you are following and also the people that are following you. This addresses the problem where you want to only track yourself and the FindMy App will not let you share your location with yourself, causing an error during initialization indicating the phone information can not be found. The current solution is to have someone else track you. This will (should) add your phone information to the data being returned and allow your phone to be tracked by iCloud3.
  • Other internal code changes.
  • Updates to the iCloud3 documentation.

This update mainly focusses on further enhancements to the pyicloud_ic3.py interface module. This module is now very stable and is reaching a production level. When that occurs, probably in the next week, iCloud3 will be updated to v2.2.2.

Thank you for trying it out and reporting any issues you encounter.

Gary Cobb
[email protected]

I was running icloud3 2.2.1a and getting the trusted device popups many times during the day. I copied in the icloud3-v2.2.2rc7.zip files and I have only gotten one popup so far (at startup), but it has stopped tracking my own device.

Configuration:

device_tracker:
  - platform: icloud3
    username: [email protected]
    password: !secret icloud_rod
    tracking_method: fmf
    track_devices:
      - rod_iphone > [email protected]
      - pams_iphone > [email protected]
      - toms_iphone > [email protected], noiosapp
    create_sensors: info

The log says this:

iCloud3 Error for Rod (rod_iphone) > The email address 
`[email protected]` is invalid or is not in the FmF 
contact list and will not be tracked.

As an unrelated side note, would it be simple to also remove “'s” (the “s” along with the apostrophe) when forming the name from device names like “Pam’s-iPhone”, or is that something that would also need to be changed in the iOS app?

@rodpayne
I’ve updated the iCloud3 documentation with the steps necessary to get around this problem. They are here.

Basically, you create another “iCloud Tracking Account” that contains the people you want to track, including yourself. Log into that account, add them to the contacts and use the FindMy app to Share My Location. Then accept the sharing invitation in your real account and use this new account in the username/password in the iCloud3 username/password parameters.

I’d appreciate it if you could take a look at the documentation and see if the outlined steps are easy to understand and follow, not to mention complete and gets everything working again. Let me know if you have any questios or problems.

Thanks, I will do some more experimenting, hopefully later tonight after work.

If I create another iCloud account and share with my friends, won’t that require them to accept an invitation from a “strange” account? If they turn around and track that new account, are they going to see me, or would they just see a stationary account or an account with no devices? For either of those cases, I would have some explaining to do.

I find it odd that it stopped working when I did the update from 2.2.1a to 2.2.2rc7. I think that it was finding it because one of them is tracking me.

Thanks for the help. I may go back to the iCloud integration for my own devices once they work out the authentication problem, but continue using iCloud3 for my friends on other accounts.

@rodpayne

  1. The iCloud account name is your email address. You could use your current email address and just add another number or ‘-fmf’ or ‘-track’ or something else. Then you and your friends would know it is really you.
  2. If they track that account in the FindMy app, it will show as lo location information since your phone will be logged into your real iCloud account, no one will actually be logged into your new account.
  3. That is odd that it was working before. The data returned from iCloud for fmf did not change. In v2.2.1a, it was scanning the ‘following’ data to link the email address with the location while in v2.2.2rc7, I added scanning the devices ‘following me’ to try to get the ‘My Device’ information (without success). Do you show up in the list of phones in the fmf data in Stage 2-3, List of Friends in FmF data that can be located? Select Event Log > Restart iCloud3 to get the list if you have not started iCloud3 for a while.

You can always use the FamShr tracking method which locates the devices in your family sharing list. And, the native iCloud integration does not support the FmF tracking method, it uses the Family Sharing tracking method only.

@gcobb321
Along the way in testing things out, I (sort of accidentally) ended up deleting the Find My Friends connections on the phones. When I tried to re-create the connections, they did not receive the invitations. So as long as I was creating things over again, I gave up and set it up with Family Sharing. This is working pretty well at this point and avoids the “impersonation” problems that a separate tracking account would introduce.

  1. One of the things that I wanted to get out of the iCloud integration was the locations of all of my devices, rather than just the one device that fmf tracks. With famshr, this can be accomplished with iCloud3 and I will now use it instead of iCloud.
device_tracker:
  - platform: icloud3
    username: [email protected]
    password: !secret icloud3_rod
    tracking_method: famshr
    track_devices:
      - rod_iphone > [email protected]
      - rod_ipad > [email protected]
      - rod_old_iphone_se > [email protected]
      - pams_iphone > [email protected]
      - toms_iphone > [email protected], noiosapp
  1. I struggled with iCloud3 being able to match up names when I had my second iPhone named Rod-iPhone-SE because the integration saw “-SE” as a suffix to the app name rather than part of the phone’s name. This gave me two entries named Rod-iPhone. I got around it by renaming the phone to Rod-old-iPhone-SE. Maybe you could make the device type part of your matching? (I saw the iOS App device_tracker entity name or suffix to be monitored configuration parameter later, so I didn’t get a chance to try it.)
  2. What I can’t configure in the new setup is Tom's iPhone. It is still in my Find My Friends and can’t be added to the family because it has a different family. (Unlike people, an account can’t be in two families.) Is there any possibility that a future version could track a selected device as fmf, kind of like there is a noisoapp parameter now?
  3. A problem that I still have in the iCloud3 Event Log card is that the names rod_iphone and rod_ipad are given the same names (Rod) in the buttons on the card. If you click either of the buttons, the event log listing flickers back and forth for a while. Maybe you could use the friendly_name instead? (I found the user's name parameter in the documentation and that makes it all better.)

Here are some notes for the documentation.

Under “Family Sharing Tracking Method and the Settings App”, these may be talking about an earlier iOS version, so I would suggest adjusting it something like:

Family Sharing list is part of your iCloud account and is set up in the Settings App.

  1. Open the Settings .
  2. In the setting at the top that has your profile picture and name, select Apple ID, iCloud, Media & Purchases.
  3. This will open Your Apple ID Profile screen.
  4. Select Family Sharing to open the Family Sharing screen.
  5. Select Set Up Your Family and set up the family it has not yet been set up.
  6. Select Invite People to open the Invite via iMessage popup window.
  7. Select Invite via iMessage. They will be added to the Family Sharing List after they accept the invitation. Verify that Location Sharing is turned on on their iPhone.

Under “Find-My-Friends Tracking Method and the The FindMy app”:

  1. Have the person open the email requesting approval and then Accept the Invitation.
  2. Verify that Location Sharing is turned on in their iOS device.

Under “Problems with tracking only yourself or tracking only one phone with Find-my-Friends”:

Maybe this whole section should go to the troubleshooting page so that readers don’t get the idea that they need to do this if it does not apply to them. Maybe just a note here that the integration can’t find your own device in Find-My-Friends unless one of them is tracking you.

Thank you for the great integration and for listening to my use cases.

@rodpayne
I’m in the middle of redoing the whole fmf and famshr tracking methods and am working on combining them so it looks at the iCloud fmf people and tracks them with the fmf method and anyone else gets tracked with famshr. It’ls like having a tracking method at the device level rather than globally. And it’s all automatic so you don’t have to specify a tracking method and the documentation gets a lot simpler. I hope to have it done next week so stay tuned.

Thanks for the documentation feedback.

Matching phone names with the iOS app device tracker entities has always been a challenge. I’m glad you found a way to do what you needed.

3 Likes

I am looking forward to the new version! What would you think of entering the tracking devices with parameter names to make it more specific about which optional parameters are being included? That was where most of my confusion came in. Instead of:

device_tracker:
  - platform: icloud3
    username: [email protected]
    password: !secret icloud3_rod
    tracking_method: famshr
    track_devices:
      - rod_iphone > [email protected], Rod-iPhone
      - rod_ipad > [email protected], Rod-iPad
      - pams_iphone > [email protected], Pam
      - toms_iphone > [email protected], Tom, noiosapp

Something like this:

device_tracker:
  - platform: icloud3
    account: [email protected]
    password: !secret icloud3_rod
    track_devices:
      - device_name: rod_iphone
        email_address: [email protected]
        name: Rod-iPhone
      - device_name: rod_ipad
        email_address: [email protected]
        name: Rod-iPad
      - device_name: pams_iphone
        email_address: [email protected]
        name: Pam
      - device_name: toms_iphone
        email_address: [email protected]
        name: Tom
        noiosapp: true

The single line method could be kept for backward compatibility.

iCloud3 Release Candidate 8 is now available.

iCloud3 now works with the Apple Verification ID Code and support 2-factor-authentication

The fmf and famshr tracking method have been combined into a single icloud tracking method and now operates on a per device basis. See below for more information.

Download the zip file from the development-v2.2.2 directory here , unzip it into the icloud3 directory and restart HA.

Change Log:

  1. The Find-my-Friends (fmf) and the Family Sharing (famshr) have been combined into a single tracking method (icloud) and operates on a per device basis. When iCloud3 starts, the FindMy People list is analyzed for devices to be tracked, followed by the FindMy Me selection (this device is My Location), followed by the Family sharing list. You no longer need to assign a tracking method to use iCloud Location Services. Each device you are tracking will automatically select the appropriate tracking method based on how it is set up in your iCloud account.
  2. Changed the list in Stage 2 of iCloud3 initialization to show all the people and devices in the FindMy app and all the devices in the Family Sharing list. A check mark is next to the track_device in your configuration parameters indicating the tracking method selected for that device.

See the v2.2.2rc8.txt file for the complete list of changes.

@gcobb321 Hi Gary, I updated to RC8 and I’m getting the following iC3 error in the event log that indicated that neither iC3 tracking method is being selected, also I’m not getting any requests for 2FA.

What would you suggest I do to reinitiate Apple re-authentication?

I’ve followed the instructions to restart iC3 and refresh cache, however I’m still getting the same error.

@bastero
Hey Juan,
I wonder what is going on. There are check marks next to the devices so they were identified and matched. Then they didn’t pass the ‘no devices’ test later on. Yes, reinstall rc7 and you should be ok.

Can you tell if your devices being located by fmf and it’s just the error message that displayed by mistake? Or are they not located at all?

But before you do, I’d like a log file to see what is going on. Can you add log_level: debug+rawdata to your iCloud3 configuration file, delete the home-assistant.log file and then restart HA. Then send the home-assistant.log file to [email protected].

Edit: I’m looking at the code now. The message is generated when there is no data returned when getting your Family Sharing list from your iCloud account. Do you have anyone in your Family Sharing list?

Thanks.
Gary

@gcobb321 Ok I’ll reinstall RC7.

Regarding your question on whether the devices are being located by fmf… I’m not really sure, on the one hand the event log states that the updates are being received via iOS App however I do see the correct state for iC3 Zone.

I’m including both the Event log and the home-assistant.log in the email I’m sending.

Cheers

@bastero
Juan,
Since iCloud3 now checks both the Friends list and the Family Sharing List when it starts, there was a bug when no entries were found in either list. You do not have any entries in your iCloud Family Sharing list and that was generating the error message.

I suspected that when looking at how the error message was generated and your files confirmed it. Thanks. Don’t forget to remove the log_level:debug+rawdata from your iCloud3 configuration.

I’ve updated to v2.2.2rc8a which fixes the problem. It’s ready to download, install and run.

Gary

1 Like

Thanks Gary, well done! RC8a shows no errors, tracking is via FmF as configured.

Hi Gary,

After update R8 I get this error. But later in log it seems to be working.