I’ll wait to upgrade until I hear you’ve got iCloud3 working again. iCloud3 is a valued addition to my installation.
iCloud3 Version 1.0.4 released with HA Version 0.94+ support
The latest version of iCloud3 is now available with support for HA Version 0.94+, in addition to several other changes.
Visit the Releases tab on the icloud3 github repository here to download the update.
The full change log includes:
-
Support for Home Assistant version 0.94+.
-
Fixed problem where iCloud Service Calls may not be executed for a device when multiple iCloud3 device tracker platforms were set up for different iCloud accounts.
-
Fixed a problem where the last update, the next update and last located dates were displayed as a UTC time rather than the local time. This has been fixed. It appears that newer installs of Hass.io that are based on the Hass.io Operating System rather than Raspbian are using UTC for log file times rather than the local time. This was effecting the how times are used and reported.
-
Fixed a problem where the Old Location count was being updated twice on the same poll.
-
If a device has an old location, it was repolled every 15-seconds to try to establish a good location. This has been changed to 30-seconds. Every 10th time, the interval will be set to 5-minutes. If the the Old Location counter reaches 41or the last good location is more than 30-minutes old and the Old Location counter reaches 21, the device is put into a ‘Paused’ status and no more polling will be done until it is resumed using the ‘icloud_update resume’ service call. This might happen in large dead zone or when a device is put into ‘airplane’ mode with no wifi coverage.
-
Began preparations for version 2 of the IOS Mobile App.
Hello @gcobb321
Thank you for the update. Just a few questions with some items showing up in my log. Here is the ones I’m seeing related to Icloud3:
Are these related to one issue?
Also for some time time now i have copy of my Iphone in the Integrations/Home Assistant iOS. The one on the right is correct by looking at the battery level state.I have deleted all integrations in the IOS from the UI screen and done a restart but it just returns. Do you have any ideas?
- The 'Time Zone" message was left over from trying to figure out why the time in the log file was UTC time while everything else was local time. Turned out to be something to do with an HA update which appears to have been fixed. You can ignore it. I’ll remove it in the next update.
- The 2 Errors look like they are related and were triggered when HA was started and iCloud3 was authorizing/accessing the iCloud account. No accounts were found which triggered an error. The “self.” error was generated trying to display an error message in the log file that iCloud3 could not find the iCloud account. It will be fixed in the next update and normally would not be encountered.
I’ve updated iCloud3 to v1.0.4a to fix a few errors. It can be found in the prerelease directory here
- I also had several entries on the Integrations page for the same device. It is caused by multiple entries in the .storage/core.device_registry file. I cleaned up mine by changing the name of the wrong devices, editing the core.device_registry file to find and remove the entries with a text editor and then restarting HA. This can be dangerous so make sure you make a copy of the file before you do anything to it.
@gcobb321 -Before I go messing with my settings and “resetting” iCloud3, should an Apple Watch show up as a tracked device? And if so what would the “device type” be? My wife got her watch after iCloud3 was setup so I know I may need to reinitialize it but I didn’t want to mess with it if it won’t show up anyway. Thanks.
The device type is ‘watch’. My wife also has one.
FYI -If you look in the log file after restarting HA … , you will see entries for tracked devices and whether or not the device is being tracked. The device type is listed.
what’s the easiest way to get it to pull the new devices without messing anything up?
You do have to restart HA … That is the only way to get configuration file changes to be recognized. If configuration file changes are not needed (I.e., you just added an iPhone to your account that already had iphone as an include_device_type), you can just do an device_tracker.icloud_restart service call to include it.
oh I see I forgot it won’t even look for it until I add it to the device types… thanks
So another unrelated issue, I’ve added the lost iPhone script, it will work for my device but then I get this for the others… not just the watch but the other phones/ipads
Log Details (ERROR)
Sun Jun 09 2019 22:09:21 GMT-0400 (EDT)
Error executing script script.lost_iphone_amyswatch. Unknown error for call_service at pos 1:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/script/__init__.py", line 173, in async_turn_on
kwargs.get(ATTR_VARIABLES), context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 131, in async_run
await self._handle_action(action, variables, context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 210, in _handle_action
action, variables, context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 299, in _async_call_service
context=context
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 89, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1150, in async_call
self._execute_service(handler, service_call))
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1174, in _execute_service
await self._hass.async_add_executor_job(handler.func, service_call)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/icloud3/device_tracker.py", line 423, in service_callback_lost_iphone
account, devicename)
File "/home/homeassistant/.homeassistant/custom_components/icloud3/device_tracker.py", line 5208, in service_handler_lost_iphone
device.play_sound()
File "/srv/homeassistant/lib/python3.6/site-packages/pyicloud/services/findmyiphone.py", line 137, in play_sound
data=data
File "/srv/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 581, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/srv/homeassistant/lib/python3.6/site-packages/pyicloud/base.py", line 99, in request
raise api_error
Log Details (ERROR)
Sun Jun 09 2019 22:09:21 GMT-0400 (EDT)
Error executing service <ServiceCall script.lost_iphone_amyswatch (c:5a5d6f2f932a47d3b82e418d018baf7b)>
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1159, in _safe_execute
await self._execute_service(handler, service_call)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1172, in _execute_service
await handler.func(service_call)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/script/__init__.py", line 114, in service_handler
context=service.context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/script/__init__.py", line 178, in async_turn_on
raise err
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/components/script/__init__.py", line 173, in async_turn_on
kwargs.get(ATTR_VARIABLES), context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 131, in async_run
await self._handle_action(action, variables, context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 210, in _handle_action
action, variables, context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/script.py", line 299, in _async_call_service
context=context
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/helpers/service.py", line 89, in async_call_from_config
domain, service_name, service_data, blocking=blocking, context=context)
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1150, in async_call
self._execute_service(handler, service_call))
File "/srv/homeassistant/lib/python3.6/site-packages/homeassistant/core.py", line 1174, in _execute_service
await self._hass.async_add_executor_job(handler.func, service_call)
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/homeassistant/.homeassistant/custom_components/icloud3/device_tracker.py", line 423, in service_callback_lost_iphone
account, devicename)
File "/home/homeassistant/.homeassistant/custom_components/icloud3/device_tracker.py", line 5208, in service_handler_lost_iphone
device.play_sound()
File "/srv/homeassistant/lib/python3.6/site-packages/pyicloud/services/findmyiphone.py", line 137, in play_sound
data=data
File "/srv/homeassistant/lib/python3.6/site-packages/requests/sessions.py", line 581, in post
return self.request('POST', url, data=data, json=json, **kwargs)
File "/srv/homeassistant/lib/python3.6/site-packages/pyicloud/base.py", line 99, in request
raise api_error
pyicloud.exceptions.PyiCloudAPIResponseError: Internal Server Error
But either way… wanted to share my little Apple Devices page… iCloud3 is the only way I finally got reliable battery levels… I appreciate all your hard work
The last error:
File "/srv/homeassistant/lib/python3.6/site-packages/pyicloud/base.py", line 99, in request
raise api_error
pyicloud.exceptions.PyiCloudAPIResponseError: Internal Server Error
Shows that Pyicloud caused the crash. That is the interface between the code and the icloud find-my-friends that was written several years ago so I’m not sure what is going on there.
I ran the Lost Phone Alert on my iphone, my wife’s iphone and her iwatch and everything worked fine.
Are all of your ipads, iphones, ipods and iwatches on the same apple account or different accounts. When HA starts and iCloud3 loads, there is a lot of tracking messages as each account is processed for the device types and devices that are included and excluded for each device_tracker.icloud3 platform. Perhaps that will give you some more information as to what is going on.
++++ Breaking News +++++
FYI - It has been reported that Apple changed something on there end that is breaking the pyicloud.py program that sits between HA components and Apple. There is some issue where authorizing the access to the Apple iCloud account fails. It is happening on all versions of HA and on icloud3 (all versions), along with the base icloud component that is part of HA. I’ve tried it on 0.92.0, 0.93.0, 0.93.2, 0.94.0 & 0.94.1.
Everything works, or seems to, until the account needs to be reauthorized. I’m now keeping up with what is going on and am dead in the water until this issue is resolved.
Gary aka GeeksterGary
hmm…hope this is resolved soon. I like this component. BTW, anyone know if the official component is dead too?
Yes, the official component is also dead😟
Well that stinks
Gotta blame apple for this
This seems to get it to authenticate but I’m at work and can’t do much testing… maybe someone else can see if it works for them https://github.com/PeterHedley94/pyicloud/commit/6bf11c87c784fa9b0f94318ea845e441b0937cf5
Going to give it a try now. Just need to find the base.py file.
Found and replaced it with the raw file. Only one error left in the log related to Icloud.
Are you using icloud3 1.0.4a ? Or the regular version. I believe that prerelease version may have fixed that error for me. I have the error too but I’m on 1.0.4. again. This I cloud breaking thing happened in the midst of my python upgrade and 0.94 upgrade so I rolled HA and iCloud3 back to versions I knew was working previously. If I get a chance in a little bit I will go to the prerelease version and see what happens
Edit: same error with 104a… I’m also getting ssl certificate errors… not sure if somehow related
i’m using the Icloud3 1.0.4 version.