Noticed that it stoped working and when checking the logs its full of:
if self.any_device_being_updated_flag:
AttributeError: 'Icloud' object has no attribute 'any_device_being_updated_flag'
2019-06-14 13:40:35 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/jrechena/.homeassistant/custom_components/icloud3/device_tracker.py", line 1088, in _polling_loop_5_sec_device
if self.any_device_being_updated_flag:
AttributeError: 'Icloud' object has no attribute 'any_device_being_updated_flag'
2019-06-14 13:40:35 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib64/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/jrechena/.homeassistant/custom_components/icloud3/device_tracker.py", line 1088, in _polling_loop_5_sec_device
if self.any_device_being_updated_flag:
AttributeError: 'Icloud' object has no attribute 'any_device_being_updated_flag'
The significant change is tracking devices when the iCloud Location Service is unavailable using the notifications from the HA ios app v1.5x. You will have to use the include_devices configuration parameter to specify the devices to be tracked. The include_device_type will not work since it is used to scan the iCloud account which is not available. The Change Log describes how it works in more detail.
More information is in the Change Log here
It can be downloaded from the iCloud3 github repository here.
@Dayve67 That is correct. It only works with ios app v1.5. I’ve had the v2.0 beta and made some coding changes to support it but I need it to settle down and get closer to a finalized state before getting back into it.
Remember, the iCloud Location Service is down so iCloud3 is not polling. It will only update it’s information when the ios app sends location notification to HA .
@rechena That is normal. iCloud3 still tries to authenticate the iCloud account when it starts, which will generate the error if it can’t be authenticated. When this happens, it then goes into the “iCloud Disabled” mode.
@gcobb321 Looks like the auto generated sensors go away if it can’t authenticate. Can you confirm this? I’m using sensors as part of my node-red automations and breaks all of them.
@InstigatorX Did you put the device names in the config file using the include_devices parameter? That must be done so iCloud3 knows what devices to track since the iCloud account can’t be scanned. The sensors are created from the devices you specify.
2019-06-16 17:46:27 ERROR (SyncWorker_13) [pyicloud.base.http] Failed to validate the credentials from cookie
2019-06-16 17:46:27 ERROR (SyncWorker_13) [custom_components.icloud3.device_tracker] Error authenticating iCloud Service for [email protected]/steve_icloud
2019-06-16 17:46:27 ERROR (SyncWorker_13) [custom_components.icloud3.device_tracker] Error returned from pyicloud: (‘Invalid email/password combination.’, PyiCloudAPIResponseError(‘Failed to validate the credentials from cookie’))
2019-06-16 17:46:27 ERROR (SyncWorker_13) [custom_components.icloud3.device_tracker] iCloud location service has been disabled
2019-06-16 17:46:27 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy
Traceback (most recent call last):
File “/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py”, line 76, in async_setup_legacy
tracker.see, discovery_info)
File “/usr/local/lib/python3.7/concurrent/futures/thread.py”, line 57, in run
result = self.fn(*self.args, **self.kwargs)
File “/config/custom_components/icloud3/device_tracker.py”, line 428, in setup_scanner
waze_region, waze_realtime, waze_max_distance, waze_min_distance)
File “/config/custom_components/icloud3/device_tracker.py”, line 581, in init
if self.restart_icloud():
File “/config/custom_components/icloud3/device_tracker.py”, line 669, in restart_icloud
self.device_type[devicename] = user_name[1]
IndexError: list index out of range
@ InstigatorX I assumed that devicenames would have an underscore (’_’) in them separating the name from the type (i.e., name_type). Your devicenames didn’t follow that format.
I have made the changes to iCloud3 to accept your devicename format and have posted it on the github repository. You can download it here.
Thanks for the reply, but I must be doing something wrong has I have no icloud entities created
Do I need to clean something to force them to be recreated?
I don’t fully understand some of the fields in icloud3. At your suggestion, I am using sensor.doug_iphone_zone_name1 as my trigger.
For testing, I’m using notify to send the following message:
‘Doug has left {{states.sensor.doug_iphone_last_zone.state}} and is now at {{states.sensor.doug_iphone_zone.state}}’
the last_zone_state seems to vary between: not_home, doug_iphone_stationary or a zone name. Is there one sensor I could check that would always say away if I wasn’t in a zone or do I have to deal with not_home and that weird stationary value?. All I want to do is to figure out if I want to say doug is leaving states.sensor.doug-… or doug is arriving at states.sensor.doug…
I also see that using your trigger suggestion, I apparently get triggered and both doug_iphone_last_zone and doug_iphone_zone are “not-home”. What’s triggering sensor.doug_iphone_zone_name1?? I don’t think it’s my phone IOS.
Maybe I just need some help understanding what values are in zone, zone1, zone2, zone3 and last_zone, last_zone1,… and when they change.
“The solution to eliminating this problem is to not trigger automations based on device state changes but to trigger them on zone changes. A zone and last_zone template sensor, updated by iCloud3, is used to do this. These template sensors are only updated by iCloud3 so they are not effected by incorrect device state changes. See the example gary_leaves_zone automation in the sn_home_away_gary.yaml sample file where the sensor.gary_iphone_zone is used as a trigger.”
I can’t seem to find the example…it’s not in configuration_files.zip on github.