I have activated the google maps tracking feature. But the service is failing always after some time and I have to restart the home assistant. I am using newest Hassio System:
2018-06-02 12:39:14 ERROR (MainThread) [homeassistant.core] Error doing job: Future exception was never retrieved
Traceback (most recent call last):
File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 99, in _populate
self._latitude = data[1][1][2]
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 67, in _update_info
for person in self.service.get_all_people():
File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 393, in get_all_people
people = self.get_shared_people() + [self.get_authenticated_person()]
File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 361, in get_shared_people
people = [Person(info) for info in output[0]]
File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 361, in <listcomp>
people = [Person(info) for info in output[0]]
File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 91, in __init__
self._populate(data)
File "/usr/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 107, in _populate
raise InvalidData
locationsharinglib.locationsharinglibexceptions.InvalidData
Now even a restart does not solve this problem. I dont get any updates any longer. Any idea? I am not even getting error messages now. The .google…cookie file is still created when I delete and restart the system.
Error setting up platform google_maps
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/locationsharinglib/locationsharinglib.py", line 109, in _populate
self._charging = data[13][0]
TypeError: 'NoneType' object is not subscriptable
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/__init__.py", line 184, in async_setup_platform
disc_info)
File "/usr/lib/python3.5/asyncio/futures.py", line 380, in __iter__
yield self # This tells Task to wait for completion.
File "/usr/lib/python3.5/asyncio/tasks.py", line 304, in _wakeup
future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/concurrent/futures/thread.py", line 55, in run
result = self.fn(*self.args, **self.kwargs)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/google_maps.py", line 46, in setup_scanner
scanner = GoogleMapsScanner(hass, config, see)
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/google_maps.py", line 66, in __init__
self._update_info()
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/device_tracker/google_maps.py", line 78, in _update_info
for person in self.service.get_all_people():
File "/srv/homeassistant/lib/python3.5/site-packages/locationsharinglib/locationsharinglib.py", line 459, in get_all_people
people = self.get_shared_people() + [self.get_authenticated_person()]
File "/srv/homeassistant/lib/python3.5/site-packages/locationsharinglib/locationsharinglib.py", line 451, in get_authenticated_person
None,
File "/srv/homeassistant/lib/python3.5/site-packages/locationsharinglib/locationsharinglib.py", line 95, in __init__
self._populate(data)
File "/srv/homeassistant/lib/python3.5/site-packages/locationsharinglib/locationsharinglib.py", line 113, in _populate
raise InvalidData
locationsharinglib.locationsharinglibexceptions.InvalidData
I found that just deleting the component and re-installing it didn’t work, the only way to get it to work was to manual run the command as in the post I linked too. I find I have to do it about every 3/4 weeks.
Deleted, then installed location sharing lib in virtual enviroment pip install --upgrade locationsharinglib
Manually upgraded the google maps lib from the author srv\homeassistant\lib\python3.5\site-packages\homeassistant\components\device_tracker\google_maps.py
Edited google_maps.py and overwrite the password section to my password and username.
Deleted cookies file from .homeassistant .google_maps_location_sharing.cookies
And restarted HA (deleting cookie file was not enough, had to upgrade everything to the same version)
the problem is with the function that returns all people,
it returns shared people + authenticated person:
people = self.get_shared_people() + [self.get_authenticated_person()]
the problem with that is the authenticated person returns None at array index [13] which fails it,
to fix it updated google_maps.py to use get_shared_people instead of get_all_people