iCloud3 v2.0 Device Tracker - Advanced tracking features with HA iOS App integrated monitoring (Updated)

@ghstudio Some additional information:

  1. The different Zone Sensors are described here
  2. The last_zone sensor is set to the value of the zone sensor before the zone sensor is changed. It is not formatted like _name1 & _name2. Rather than using {{states.sensor.doug_iphone_last_zone.state}} in a message, use the from trigger state {{trigger.from_state.state}}. That will give you the value of doug_iphone_zone_name1 before it was changed.
  3. I probably need to review the sample automations & scripts to make sure they are current. I may have included this as an example earlier but this is what I use for leaving a zone:
#--------------------------------------------------------------
#   Gary leaves a zone
#--------------------------------------------------------------
- alias: Gary Leaves Zone
  id: gary_leaves_zone
  trigger:
    - platform: state
      entity_id: sensor.gary_iphone_zone_name1
      to: 'Away'
      
  condition: 
    - condition: template
      value_template: '{{trigger.from_state.state != "Home"}}'
      
    - condition: template
      value_template: '{{states.sensor.gary_iphone_distance.state | float > 0}}'
    
    - condition: state
      entity_id: input_boolean.ha_started_flag
      state: 'on'    
  action:
    - service: script.gary_leaves_zone
        
    - service: script.notify_gary_iphone
      data_template:
        title: 'Gary Leaves Zone'
        message: 'Zone: {{ trigger.from_state.state }} --> {{ trigger.to_state.state }}, Distance: {{ states.sensor.gary_iphone_distance.state }}' 

Is it possible to exclude creation of all the sensors? Either a parameter in the icloud3-component or by commenting out a block of code.

I succesfully slimmed down the number of entities/sensors/switches in my HA setup but icloud3 added so much sensors that is increased my total entitities by 300%. This is an issue as I am using the /dev-state page often.

Also all sensors are automatically logged which makes the database grows, unless all sensors are manually entered as recorder exlusions.

Btw: icloud3 works flawlessly with HA 0.94.4!

1 Like

@rs443 Will give it some thought. Right now, my priority is reconnecting with Apple’s icloud Location Service.

2 Likes

Gary
thank you for your focus on getting the icloud link working. I’m lost without it.

(sorry
couldn’t resist)

Anything we (I) can do to help get this working? I have some free time this weekend and am really missing this functionality.

I have an error:
Error returned from pyicloud: (‘Invalid email/password combination.’, PyiCloudAPIResponseError(‘Failed to validate the credentials from cookie’,))
but email and passed are OK.

hey,

always i get Battery State: Charging but my iphone not charging, i have iphone 6
in past he used to show me when to charge when I was not charging.
How do you fix it?
thanks

iCloud3 v1.1.0 has been updated to track devices with Find-My-Friends. I’ve uploaded the new code to the beta directory on the iCloud3 github repository Go here for the modules (device_tracker.py & pyicloud_ic3.py). The ChangeLog lists the ‘breaking changes’ and how to set it up.

I want to do some more testing before issuing a formal release (probably next week) so let me know if you see anything weird or it it seems to work fine.

I haven’t tested it with multiple accounts being used at the same time but don’t expect any issues.
Gary

There is one other thing I omitted from the instructions.

FmF uses an ID code (“MTg2Djk7ODEq”) to identify contacts (friends) with the location data. During initialization, iCloud3 matches the email address in the devicename’s tracked_devices parameter with the email address in the FmF accounts contacts/friends record to tie the FmF ID code to the devicename. You have to set up a contact in the Contacts App while logged into the FmF iCloud account. If you don’t, error messages are displayed during initialization and no devices will be tracked.

The minimum amount of information you need to enter into the Contacts app is the First Name, Last Name and email address.

I’ve just updated iCloud to v1.1.0 beta 2. Get it here

Since I can’t tell how many people are trying the beta, I’d appreciate any feedback on the installation instructions (easy to follow, not enough detail, missing steps, etc.), set up issues (parameter explanations, not enough examples, better or more configuration samples, etc.) and if you run into any problems using it.I want to make the instructions as clear as possible to minimize questions and problems.

Thanks
Gary

@gcobb321 came across this for the first time, and I am must say I am blown by the extensive documentation and the work you have done. Thank you. Do you recommend that a first time user of this custom component should try the beta version or the stable version

I would use the beta. It’s stable. The big difference is the added ability to use Find-my-Friends to the locate the phone and other devices. If you’ve followed the above posts, you’ve seen that Apple is now sending notifications when logging into an iCloud with 2fa to use the Find-my-phone location services, which is very annoying. The docs are not up to date but the ChangeLog does have the instructions on setting it up. There will be a few more betas in the next few days as things get checked out. Let me know how the install goes and if the instructions need to be changed to make it easier.
Gary

1 Like

Do I need to establish a separate fmf account for each “real” AppleID I’m trying to track? Lots of this:

2019-07-12 17:47:18 ERROR (MainThread) [homeassistant.components.device_tracker] The see service is not supported for this entity device_tracker.gary

I’ve just updated iCloud to v1.1.0 beta 3. Get it here .

  • It corrects crashes if the username/password are invalid
  • Added a new base_zone parameter to select a zone other than the ‘home’ zone to be used as the basis for distance and time calculations.
  • Changes the way a day number is displayed to see if iCloud3 will run under Windows
  • Displays a warning if the track_devices parameter is configured incorrectly.
  • Verified that Find-my-Friends works when it has several platforms in the device_trackers configuration file all logged into the same or different icloud accounts. For example:
    • Platform: icloud3, username: [email protected], password: pw, accountname: gkstr1, track_devices: gary_iphone
    • Platform: icloud3, username: [email protected], password: pw, accountname: gkstr2, track_devices: lillian_iphone
    • Platform: icloud3, username: [email protected], password: pw, accountname: jonny, track_devices: jonny_ipad

The device_tracker.py file and the pyicloud_ic3.py file were updated.

2 Likes

@gcobb321 Thank you for your update using the “FmF account” It seems to work but I have some errors.

These errors i get
Error processing FmF data, Operation Aborted

â–șâ–șINTERNAL ERROR-RETRYING (_update_device_icloud/OverallUpdate-_save_event() missing 1 required positional argument: ‘log_text’)

save_event() missing 1 required positional argument: ‘log_text’
Traceback (most recent call last):
File “/config/custom_components/icloud3/device_tracker.py”, line 1850, in _update_device_icloud
self._save_event(devicename, )
TypeError: _save_event() missing 1 required positional argument: ‘log_text’

Maybe you can use these error messages to further improve the component.

Thanks. Fixed in the next beta. Probably available sometime tomorrow.

1 Like

Hello
I am on the latest beta version and I have following issues:

  • Units are imperial instead of metric

  • Battery status is 0/None
    What changes should I make to fix thses

image

Don’t suppose there is an easy way to use hacs with the beta :blush:

  1. Documentation (here) describes configuration file parameters. See unit of measurement.
  2. Battery info is picked up from HA 
 ios app or iCloud. All iCloud3 is pass it along. If 0, then the info not available.

No. V1.1.0beta4 will be out tomorrow, (Saturday), 7/20. Final out shortly if no surprises. Documentation updates complete and will be on beta also.