Google Maps Device Tracking Setup?

Made a seperate google account, and shared my map presence with it. 2FA is disabled.
Approved the ‘unknown device’ when Hassio first tried to connect.
The cookie file contents is ‘‘utf-8’ codec can’t decode byte 0x80 in position 0: invalid start byte’. Deleting it and restarting Hassio ends up with the same result.
Log tells me the following once deleted;
ERROR (SyncWorker_11) [locationsharinglib.Service] Could not open pickle file, either file does not exist or no read access.

Any ideas?
Running Hassio 0.73.1

A restart without deleing the cookie file shows the following;
The cookies provided do not provide a valid session.Please authenticate normally and save a valid session again

So i’m stuck with invalid bytes in the cookie file again.

Hmm, i’m lost, i’ve tried the ssh tunnel method via the pi too. Not much luck.
@costas any idea?

Anyone have this working on a raspberry pi with hassio image?

No one able to help? :S

It’s complaining about the pickle file not a cookie? Pickle files are a dynamic database file for python.

EDIT:

For reference, your error is:

So find the pickle file that locationsharinglib is using on your raspi. If that file doesn’t exist, that’s your problem. I would think the install is wrong.

If the file does exist, then that library was installed with the wrong credentials

Hi @kortex, the cookie contents should of course not be that so your cookie file is invalid. Could it be that you are using any weird accented characters in your username or password?

Hi @costas, thanks for replying!

I originally had a password with a symbol in it, figured that might have been the problem and changed the password.

If i put in an intentionally wrong password it does show up in the logs ‘Invalid credentials’.
If the creds are correct the contents of the cookie file are; ‘utf-8’ codec can’t decode byte 0x80 in position 0: invalid start byte
If i delete the cookie file and restart i get Could not open pickle file, either file does not exist or no read access, then when i restart a second time i get ‘utf-8’ codec can’t decode byte 0x80 in position 0: invalid start byte

I tried and changed the password again for shits and giggles but no joy.

Happy to troubleshoot if you have any ideas!

Could you please create an issue on the library’s issue tracker https://github.com/costastf/locationsharinglib/issues with all the details? I will look into it some time during the week. Please try the library directly out of HA context according to it’s documentation http://locationsharinglib.readthedocs.io/en/latest/usage.html. The issue you are describing is not really very possible so something, probably HA is in the way and acting weird.

I also blew away the ResinOS image and now using the new HassOS image, still the same issue.

I’ll look at creating the issue via github shortly.

I’m relatively new to linux so I don’t know how to navigate around the docker image.
I’ve got configurator setup and terminal, so if there’s some update/check commands I can run let me know what they are :slight_smile:
I’m not sure if I’m able to run it on it’s own on HassOS, is it doable?

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