Google Maps Device Tracking Setup?

I have this problem too, but on github they closed the tread and indicated this discussion

Home Assistant release with the issue:
0.76.0b1

Last working Home Assistant release (if known):
None

Operating environment (Hass.io/Docker/Windows/etc.):
Hass.io (HassOS)

Component/platform:
google_maps

Description of problem:
The problem is that the component can not create the file known_devices.yaml

in the log there are these two errors:

2018-08-14 11:30:46 ERROR (MainThread) [homeassistant.components.device_tracker] Unable to load /config/known_devices.yaml: Config file not found: /config/known_devices.yaml

2018-08-14 11:31:53 ERROR (SyncWorker_7) [locationsharinglib.Service] Could not open pickle file, either file does not exist or no read access.

Configuration is:

device_tracker:
   - platform: google_maps
      username: [email protected]
      password: password
1 Like

I have as well the same issue than @rwgamer on a fresh install of Hassio.
The thing I noticed is that I do no see any alerts on the “Recently used devices” on the new google account I created for this. It seems that it does not even try to login.

I access the account but then it’s as if I did not because the raspberry is not among the devices that have accessed the account

Could everyone with issues with the component please create an issue on the librarie’s issue tracker https://github.com/costastf/locationsharinglib/issues after having tried the library independent of HA as mentioned here https://locationsharinglib.readthedocs.io/en/latest/usage.html? I will have some time during the weekend to look into it.

anyone found a solution ?

I just successfully integrated the google maps device tracking component on HASS 0.76.x
Updated to 0.78.x still works.
Please note that for me:

  • I had to reboot twice to let it generate the cookie.
  • It took google 30 minutes to tell me that an unknown device tried to login to my account.
  • The content of /config/.google_maps_location_sharing.cookies says: “‘utf-8’ codec can’t decode byte 0x80 in position 0: invalid start byte”

I have this error on Hassio 0.80.3
Have anybody experienced such issue?

Error setting up platform google_maps

Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/__init__.py", line 184, in async_setup_platform
    disc_info)
  File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 46, in setup_scanner
    scanner = GoogleMapsScanner(hass, config, see)
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 66, in __init__
    self._update_info()
  File "/usr/local/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 78, in _update_info
    for person in self.service.get_all_people():
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 459, in get_all_people
    people = self.get_shared_people() + [self.get_authenticated_person()]
  File "/usr/local/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 421, in get_shared_people
    for info in output[0]:
TypeError: 'NoneType' object is not iterable

I tried to set up google_maps tracking as well and directly run into exactly this issue.
I’m on 80.3 currently

I’m having the same issue and found that its an issue with the locationsharinglib dependency that the google maps tracker uses. There is an open issue for this here: https://github.com/costastf/locationsharinglib/issues/42

I have 2 home assistant with 2 different setup and 2 @gmail.com email to track devices. One works flawless since the first time I made it, the second one never worked (even with the login/pass from the first account).

First working system:
raspberry pi3 b+ and hass.io 0.83.2 (tracking 2 users)

Second system not working:
microserver hp n36l, openmediavault 0.4 (it is a debian 9 stretch), docker-ce, hass.io 0.83.2 (tracking 1 user).

They share the same identical configuration.yaml into the device_tracker section with different @gmail.com login/pass (a fritz device tracker and google maps tracker).

I don’t see any log-in inside the activity for the second not working email. The @gmail.com have the same configuration.

I don’t really know what to check more…

1 Like

Hello

Do i need ti install addon first or only adding to configration.yaml

1 Like

It seems that I missed this thread, so posting here too.
Hi all, I have created an alpha of a cookiegetter project that drives a browser through selenium and saves the cookies. Please look at https://github.com/costastf/mapscookiegettercli/blob/master/USAGE.rst for usage (it is quite simple :slight_smile: ) and report issues at the tracker.

2 Likes

Thanks, I was able to get location tracking working again using this method!

Thank you very much! I tried so many thing and already gave up. Today I just looked through my bookmarks and decided to look inside. And it worked! Amazing.

How Can this be followed using hassio

This is something that you would install on your workstation with a gui. It will pop up a browser, you log in Google and it will create a valid cookie file for you. You copy that cookie file over to your hassio installation with any method you like and configure the add-on to use that cookie file.

1 Like

Hi @costas, i did install python 3.7 32 bits on my station . Runned the installer and executed the command put in my credentialls but the browser won t close and just sits there.

2019-06-14 17:33:18 Mihai-PC chrome.bootstrapper[12948] INFO Deleting all cookies
2019-06-14 17:33:18 Mihai-PC chrome.bootstrapper[12948] INFO Returning driver
2019-06-14 17:33:18 Mihai-PC cookiegetter.CookieGetter[12948] INFO Starting interactive login process.

is there anything i am doing wrong ?

and if i close the browser manually i get :slight_smile:
[4360:13980:0614/180456.743:ERROR:browser_process_sub_thread.cc(221)] Waited 33 ms for network service
Traceback (most recent call last):
File “C:\Users\mihai\AppData\Local\Programs\Python\Python37-32\Scripts\maps-cookie-getter-script.py”, line 11, in
load_entry_point(‘mapscookiegettercli==0.1.1’, ‘console_scripts’, ‘maps-cookie-getter’)()
File “c:\users\mihai\appdata\local\programs\python\python37-32\lib\site-packages\mapscookiegettercli\mapscookiegettercli.py”, line 92, in main
getter.run()
File “c:\users\mihai\appdata\local\programs\python\python37-32\lib\site-packages\mapscookiegettercli\library\cookiegetter.py”, line 177, in run
while LOGGED_IN_HEURISTIC not in driver.page_source:
File “c:\users\mihai\appdata\local\programs\python\python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 679, in page_source
return self.execute(Command.GET_PAGE_SOURCE)[‘value’]
File “c:\users\mihai\appdata\local\programs\python\python37-32\lib\site-packages\selenium\webdriver\remote\webdriver.py”, line 321, in execute
self.error_handler.check_response(response)
File “c:\users\mihai\appdata\local\programs\python\python37-32\lib\site-packages\selenium\webdriver\remote\errorhandler.py”, line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.WebDriverException: Message: chrome not reachable
(Session info: chrome=75.0.3770.90)

Hi, definitely not anything wrong from your side. I guess it is a local issue.there is an open mr on the project that might handle that. I will look into this during the weekend.

i’m on latest freshly installed hassio image.

without doing anything other than enabling the the google_maps component.
first boot: “type Error: Nonetype object is not iterable” .google… cookie file is created.
second boot" “invalid Cookies: the cookies provided do not proved a valid session…”. known_devices entry was never created.

used the mapscookiegettercli (nifty code) to generate a cookie. moved it over to /config… “cookie does not provide valid session” error again.

upgrade locationsharinglib in ha to 4.0.1 (was 3.0.x in base image) same error.

tracing the call i could see it failed out at self._session.get(self._login_url, verify=no DEBUG). it threw an exception because the page it got back contained $SIGN_IN_MESSAGE string, indicating the response page was the login prompt.

i pulled the latest locationsharinglib git and observed the same behavior via cli as well. so it seems like the problem is with the component rather than something weird hass.io is doing. i’m at a lost of what it could be tho.

hope you smarter guys can figure out what’s really going on. this is a great component. such a shame that it’s broken for so many people. :frowning: