iCloud3 v3 iDevice Tracker - Version 3

Hey Gary - hope you’re doing well! :slight_smile:

Do you happen to know how to increase the area for the home zone? I have announcements happening when people enter/leave zones and I would like them to come a bit earlier than they do. I thought one way to solve that would be to increase the size of the Home zone. I couldn’t find a way to do that. Maybe I should move the real “Home” zone somewhere else, and create my own custom home zone where I want it and of the size that I want. Does that seem reasonable and would there be any issues with iCloud3 from doing that?

@Allistah
I am doing good and finally getting to work on some other things after getting v2.3 done. You can specify the home zone parameters in the configuration.yaml file. Mine looks like:

zone:
  - name: Home
    radius: 100
    icon: mdi:home
    latitude: !secret home_latitude
    longitude: !secret home_longitude

Hope that helps.

1 Like

Perfect, thank you! I’ll give that a try. Hope you have a great weekend!

You can also customise the radius in Configuration => Customisations, if you prefer to keep configuration.yaml small and tidy.

2 Likes

I recently upgraded to v2.3 and noticed that two devices don’t receive IC3 zone updates. The UI reports both with “NotSet”. The info part in Lovelace repeats “Locating device via iCloud” with “May be offline No location” and nothing happens. If i check via the “Find my” app, all devices can be located.

My configuration

- platform: icloud3
  username: !secret icloud_name
  password: !secret icloud_password
  tracking_method: famshr

and the config_ic3.yaml file

# for us europeans
unit_of_measurement: km
time_format: 24
waze_region: EU
devices:
  - device_name: swaiPhone
    name: Stefan
    picture: swa.jpg
  - device_name: jphone
    name: Julia
    picture: julia.jpg
  - device_name: iphone_von_anna
    name: Anna
    picture: anna.jpg

@swa72

  1. Check the Event Log for any errors.
  2. Check the HA Configuration > Logs for any errors.
  3. Did the Apple ID Verification for 2fa code entry request display with the 6-digit code? Are any HA Notifications pending?
  4. Any authentication errors?
  5. Can you open the HA iOS App on the ‘offline’ phone.
  6. Go to Event Log > Actions > Update All Locations and see if that gets it tracking again.
    7 Go to Event Log > Actions > Restart iCloud3 and see if it now starts tracking.

I have seen my phone display offline for 30-seconds or so while my wife’s phone was located. It would then go to a normal status and everything would be fine. The device status code of ‘offline’ is returned from iCloud when a location request is
received.
.
Edit: I just had an issue where iCloud3 had paused my phone from location tracking. It also displayed ‘Requesting New iCloud Location’ over and over again. Looking at the HA Log file, an Error 401 was displayed many times. This error has to do with a failed authentication retry response from Apple. I selected Event Log > Actions > Resume and everything started again and things are normal.

Hi Gary,

I think that I have done 1 thru 7 a couple of times by now ;-). I see no errors in stages 1 thru 4 in the logs. It completes successfully in about 7s. The only error I could spot (not sure whether it is related is …

Logger: aiohttp.server
Source: components/websocket_api/http.py:81
First occurred: 5:08:09 PM (1 occurrences)
Last logged: 5:08:09 PM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 42, in get
    return await WebSocketHandler(request.app["hass"], request).async_handle()
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 233, in async_handle
    await self._writer_task
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/http.py", line 81, in _writer
    await self.wsock.send_str(message)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_ws.py", line 300, in send_str
    await self._writer.send(data, binary=False, compress=compress)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 687, in send
    await self._send_frame(message, WSMsgType.TEXT, compress)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/http_websocket.py", line 656, in _send_frame
    await self.protocol._drain_helper()
  File "/usr/local/lib/python3.8/site-packages/aiohttp/base_protocol.py", line 87, in _drain_helper
    await waiter
  File "/usr/local/lib/python3.8/asyncio/selector_events.py", line 935, in _write_ready
    n = self._sock.send(self._buffer)
BrokenPipeError: [Errno 32] Broken pipe

The recent event log for one phone shows no location data repeatedly.

swaiphone	17:14:28	Home	-	5 min	-	-	Service Call Command Received > `resume`
swaiphone	17:14:28	Home	-	5 min	-	-	FamShr update started (Resuming)
swaiphone	17:14:28	Home	-	5 min	-	-	Requesting New iCloud Location > LastLocTime-Never (Initial Locate)
swaiphone	17:14:29	Home	-	5 min	-	-	Refreshed FamShr iCloud location data
swaiphone	17:14:30	Home	-	5 min	-	-	Discarded Results: Home > CurrZone-not_set, GPS-(0, 0), Interval-5 min, NextUpdt-17:19:30, OldLocPoorGpsCnt-#9, UpdateErrorCnt-#74, InfoMsg-May be Offline, No Location (#9)
swaiphone	17:14:30	Home	-	5 min	-	-	Discarded > No location data (#9) > GPS-(0.0, 0.0), LocationTime-Never, NextUpdate-17:19:30, OldLocThreshold-1.5 min
swaiphone	17:14:35	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (31s ago), State-home@17:09:57 (4m38s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:14:35	Home	-	5 min	-	-	Device Monitor > UpdateMethod-ICLOUD, UpdateReason-Initial Locate, State-not_set, Trigger-Initial Locate, LastLoc-17:14:29, Zone-not_set, HomeDist-0m, inZone-True, GPS-(49.420803, 8.759997), StateThisPoll-not_set, StateLastPoll-not_set
swaiphone	17:14:40	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (36s ago), State-home@17:09:57 (4m43s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:14:45	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (41s ago), State-home@17:09:57 (4m48s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:14:50	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (46s ago), State-home@17:09:57 (4m53s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:14:55	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (51s ago), State-home@17:09:57 (4m58s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:17:00	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (2m56s ago), State-home@17:09:57 (7m3s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:17:05	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (3m1s ago), State-home@17:09:57 (7m8s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:14:25, WillUpdate-False, Already Processed
swaiphone	17:19:30	Home	-	5 min	-	-	FamShr update started (Initial Locate)
swaiphone	17:19:30	Home	-	5 min	-	-	Requesting New iCloud Location > LastLocTime-Never (Initial Locate)
swaiphone	17:19:31	Home	-	5 min	-	-	Refreshed FamShr iCloud location data
swaiphone	17:19:32	Home	-	5 min	-	-	Discarded Results: Home > CurrZone-not_set, GPS-(0, 0), Interval-5 min, NextUpdt-17:24:30, OldLocPoorGpsCnt-#10, UpdateErrorCnt-#75, InfoMsg-May be Offline, No Location (#10)
swaiphone	17:19:32	Home	-	5 min	-	-	Discarded > No location data (#10) > GPS-(0.0, 0.0), LocationTime-Never, NextUpdate-17:24:30, OldLocThreshold-1.5 min
swaiphone	17:19:35	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (5m31s ago), State-home@17:09:57 (9m38s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:19:30, WillUpdate-False, Already Processed
swaiphone	17:19:35	Home	-	5 min	-	-	Device Monitor > UpdateMethod-ICLOUD, UpdateReason-Initial Locate, State-not_set, Trigger-Initial Locate, LastLoc-17:19:31, Zone-not_set, HomeDist-0m, inZone-True, GPS-(49.420803, 8.759997), StateThisPoll-not_set, StateLastPoll-not_set
swaiphone	17:19:40	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (5m36s ago), State-home@17:09:57 (9m43s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:19:30, WillUpdate-False, Already Processed
swaiphone	17:19:55	Home	-	5 min	-	-	iOSApp Monitor > Trigger-Periodic@17:14:04 (5m51s ago), State-home@17:09:57 (9m58s ago), GPS-(49.420563, 8.759925)/15m), LastiC3UpdtTime-17:19:30, WillUpdate-False, Already Processed

@swa72
Export the Event Log (Event Log > Actions > Export Event Log) and email the /config/icloud-event-log.txt file to [email protected]. I’ll look at it and see if I notice anything.

Hi,

I’m completely noob, wasn’t even known what yaml or python were a few days ago, and obviously missing something!

I haven’t installed the HA app for the moment, wanted icloud3 firstly.
I’ve installed HACS on my HA supervisor, and immediatly icloud3.
I’ve created a www/custom_cards file, put icloud3-event-log-card.js in it and restart HA.

I became no notification for 2 factors authentification and have an error message when I try to install the card in Lovelace.

I’ve tried lot’s of things, a community file instead of the custom_cards file too, but always had the same result: this error message

Logger: frontend.js.latest.202012291
Source: components/system_log/__init__.py:193
First occurred: 13:28:23 (4 occurrences)
Last logged: 13:28:24

    http://192.168.178.****:8123/local/community/icloud3/icloud3-event-log-card.js:1541:9 TypeError: hass.states['sensor.icloud3_event_log'] is undefined
    http://192.168.178.****:8123/local/community/icloud3/icloud3-event-log-card.js:1463:9 TypeError: hass.states['sensor.icloud3_event_log'] is undefined 

What am I doing wrong?

Thank you

@romain7
The Lovelace editor will not highlight the Enregistrer button for you wo save the card until you have an entity item.

When you add the card, also add the sensor: icloud3_event_log after the type…

type: 'custom:icloud3-event-log-card'
entity: sensor.icloud3_event_log

Then click Save/Enregistrer at the bottom and you should be all set.

Thank you for your answer.

I’m able now to save. But I still doesn’t have the notification for the 2 FA and I’ve always the error message

Logger: frontend.js.latest.202012291
Source: components/system_log/__init__.py:193
First occurred: 13:28:23 (4 occurrences)
Last logged: 13:28:24

    http://192.168.178.****:8123/local/community/icloud3/icloud3-event-log-card.js:1541:9 TypeError: hass.states['sensor.icloud3_event_log'] is undefined
    http://192.168.178.****:8123/local/community/icloud3/icloud3-event-log-card.js:1463:9 TypeError: hass.states['sensor.icloud3_event_log'] is undefined 

Just before saving the card, I’ve this message :

@romain7
That sensor is created by iCloud3 and the error means you do not have iCloud3 running. You have to set up the platform: icloud3 parameters in the configuration file and restart HA. See the iCloud3 docs here for more information about configuring and starting iCloud3.

I’d tried lot’s of time, comitting (obviously) errors, but now it seems to work!

I’ll customize later.
Thank for your help and job

I’ve sucessfully gotten iCloud3 running and have the appropriate sensors for myself and 2 family members via Family Sharing. I’m using the Home Assistant iOS app but the other 2 family members are not. Additionally, the other 2 family memvbers are currently our other house, not the one with Home Assistant. I have Zones setup in HA for the other house and some other nearby areas. There are no erros in the HA Logs or iCloud3 Event Logs.

The issue is that the location for these 2 other family members is not upading in iCloud3, sometimes until hours later. If I look in “Find My,” it will sohe correctly, but iCloud3 does not. If I manually trigger an update once via the iCloud3 Event Log, nothing typically happens. But, if I manually trigger an update, wait ~1 min and then manually trigger another update, iCloud3 will then properly show their location.

Any ideas how to improve the responsiveness or further debug?

@Snuffy2
What is your configuration.yaml or config_ic3.yaml?

configuration.yaml

[...]
device_tracker:
  - platform: icloud3
    username: my_appleid
    password: my_appleid_password
    event_log_card_directory: 'www/community/icloud3'
[...]

config_ic3.yaml

devices:
  - device_name: my_iphone
    email: my_appleid
    name: my_name
    iosapp_suffix: '_app'
  - device_name: wifes_iphone
    noiosapp: true
    name: wifes_name
  - device_name: sons_iphone
    noiosapp: true
    name: sons_name

@Snuffy2
You can set the devices to track to the other house in config_ic3.yaml using the track_other_zone parameter. Using that, it will track the ‘other_house’ and the ‘home’ zone

devices:
  - device_name: my_iphone
    email: my_appleid
    name: my_name
    iosapp_suffix: '_app'
  - device_name: wifes_iphone
    noiosapp: true
    name: wifes_name
    track_other_zone: other_house
  - device_name: sons_iphone
    noiosapp: true
    name: sons_name
    track_other_zone: other_house

One issue is not using the iOS App on the other devices. You will not get zone enter/exit and any location update triggers from the iOS App. When you leave a zone, the exit is not recognized until the next polling interval which could be 2-hours later. See here for more info.

I could not find script.gary_leaves_zone in the example docs. Also could you please provide your code for input_boolean.ha_started_flag in the example docs. Thanks, Stefan.

Thanks for the clarifications. I had missed the info in the documentation that you linked to.

As for track_other_zone, I had tried that previously and again when you mentioned it and I can’t seem to get it to work. It always throws an error.

iCloud3 Error decoding `/config/config_ic3.yaml` parameters > The following parameters can not be handled: track_other_zone: other_house

I’ll private message you the actual log and config files with the real names as well.

#swa72
It’s in Chapter 3.2 Sample Automations & Scripts here