Google device tracker and cookies

Me neither but I thought it behaved exactly as normal, it just didn’t save anything when it closed it’s session. Be that as it may it didn’t work for a second time so I’m going to try the Firefox route…

Well… surprise, surprise using Firefox worked!! (I should have listened to @JB_Marchetti at the beginning!)

I did download all cookies though not just google.com and I seem to have one from doubleclick. net. And all I did was go to google maps!!!

I’ll try again just downloading the google.com ones…

Thanks everyone.

2 Likes

FWIW, it worked on Chrome for me, even with an account that uses 2FA. Not sure why you ran into trouble, but I’ve been noticing many people having problems with this recently. Who knows!

I suspect no-one! :slight_smile:
Oh well, that’s 2 hours of my life I’ll never get back, but at least I have Firefox on my PC now. And I’ve been reading a lot of good things about it recently, privacy-wise. Maybe I’ll give it a go…

I just did an experiment. I opened a Chrome incognito window on a freshly installed VM (and just for grins made sure all history, including any cookies, were deleted.) I went to the Google Maps site and logged in. I clicked on the cookies.txt icon and it said there were no cookies for google.com and only offered to download “all cookies”, which I did. The file was basically empty (only comment lines.) So, maybe it really won’t work with a Chrome incognito browser.

1 Like

Well, I just had to go through the process to get the cookie file again.
Is it going to be a regular requirement?

Goodmorning everyone
I hung up following the guide to integrate the tracking on google maps but I can’t make it work. I have the following error:

2020-05-07 15:28:10 ERROR (SyncWorker_1) [homeassistant.components.google_maps.device_tracker] The cookie file provided does not provide a valid session. Please create another one and try again.
2020-05-07 15:28:11 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy

I logged in google chrome with the second account, went to the google maps application and with the addon export cookies.txt I downloaded the cookies.txt file. I renamed it like this:

.google_maps_location_sharing.cookies.pippo_pluto_gmail_com

and I copied it to the homehassistant folder (I have hassio on docker on synology server) where there are also the configuration.yaml, script.yaml files. I entered the following code in configuration.yaml:

device_tracker:
  - platform: google_maps
    username: [email protected]

Then I rebooted several times, but it doesn’t work. In the log I have that error and in the known_devices.yaml file I have nothing about google maps.

Please can someone help me?

Thanks so much.

With best regards

Andrea

The problem I faced was the “.txt” was still there on the file.
Make sure you see the .txt and remove it. It’s a setting in Windows since win 7 I believe to not show the extension of known file formats.
Make sure you change that setting

Hi Hellis81, thanks for reply but the file doesn’t has .txt i’m sure because the type of file is “pippo_pluto_gmail_com” and not “file TXT”. I see that in the windows 7 directory.

thanks

hai risolto?

Ciao, no, ma ho abbandonato l’uso di google maps, questo sistema alla fine non faceva per me.

But it looks like the number of requests to google is limited… Response code: 429

For anybody coming back to this issue, it worked fine for me in firefox (not private mode) by grabbing the google.com cookies and make sure you do not save the cookies at TXT type!! Change the type to any before clicking save.

2 Likes

someone needs to update the guide for the integration to specify that you need to save it as *all files and NOT as *TXT

I’ll add my solution here in case it helps someone else.

I was using another extension for Firefox, also called “Export Cookies”. This one doesn’t have an option to untick Prefix HttpOnly Cookies.

My cookies file had a handful of entries like this:

#HttpOnly_.google.com   TRUE    /       TRUE    1667274397      AEC     AapniGMFlcZZXbiJOL4LAx5UsIvatmNqkJJbLSVmi6cYDvXA6T

So I removed the “#HttpOnly_” from the start of each of these lines, to look like:

.google.com   TRUE    /       TRUE    1667274397      AEC     AapniGMFlcZZXbiJOL4LAx5UsIvatmNqkJJbLSVmi6cYDvXA6T

and restarted HA. It’s all working now.

The correct extension (that allows unselecting Prefix HttpOnly Cookies) is: Export Cookies – Get this Extension for 🦊 Firefox (en-US)

2 Likes

Thanks all for commenting in this post! Thanks to your feedback/input i got mine Google Maps integration working!

Thanks for this info… Much happier with firefox then google but same old sesssion error…Should there be an entry for maps.google.com??

Logger: homeassistant.components.device_tracker
Source: components/device_tracker/legacy.py:308
Integration: Device tracker (documentation, issues)
First occurred: 9:54:34 AM (1 occurrences)
Last logged: 9:54:34 AM

Error setting up platform legacy google_maps

2022-10-28 09:54:33.736 ERROR (SyncWorker_1) [homeassistant.components.google_maps.device_tracker] The cookie file provided does not provide a valid session. Please create another one and try again

2022-10-28 09:54:34.028 ERROR (MainThread) [homeassistant.components.device_tracker] Error setting up platform legacy google_maps

you found solution for this error? i have same problem…

That is a good question I did several things. _ I went to the firefox approach getting the cookie mentioned by JB_Marchetti above. I made sure a pulled the cookie for my “travellng” personality (the google account I created for the phone) Those together seemed do it… Which one idid. am not sure. Oh and I cleared my caches before grabbing te new version of the cookie

thank you! i now looked more carefully what jb wrote and i found official guidelines are not correct.
Google Maps - Home Assistant here is written:
Opera Snapshot_2022-11-12_013519_www.home-assistant.io
and jb said
Opera Snapshot_2022-11-12_013440_community.home-assistant.io
so cookie file for me worked without “location_tracker_” part