Google Maps Location Sharing component - still not working

I just upgraded HA to the latest version hoping that Google Maps Location Sharing component would work again but it doesn’t.
Since it changed to the cookie system I don’t get it to work.
I’ve tried with Firefox cookie plugin but it doesn’t work.
I then tried with cookie.txt from Chrome, it works the first time I set the cookie, but it stops working almost immediately. It’s difficult to explain the behaviour but the end is that it doesn’t work.

I’m really curious to know how many persons struggle with this component. Am I the only one that has troubles?

Before the cookie system was introduced (I believe till version 0.80 or so) I didn’t have any problem and I was really happy it.

Marco

1 Like

Hi,

i have the same problem.
i need a tutorial how can i make a new Cookie .

best regards

Martin

It is still working for me, I even didn’t notice that the new cookies system was introduced.

Hello,

i’ve same issue since v0.98 (? or 0.99 … ??)
to resolve it :
Use Firefox, in private mode.
Before, install Export Cookies Plugin
go to https://www.google.com/maps/
connect with your account
Export cookie for google.com, don’t use the “prefix httponly cookies” option !
rename the cookie.txt file with the good name in your config directory.
Don’t forget config in configuration.yaml :

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

Reboot Home Assistant
Enjoy !

4 Likes

and with chrome

It doesn’t work for me with chrome :confused: only with firefox.

Thanks you for your replies, but I think I give up on this integration.

I followed @JB_Marchetti instructions, step by step.
The first time I rebooted it was working fine, and so it did for about 10 minutes. Then I had to reboot again my HA and now I get always the same error:

The cookie file provided does not provide a valid session. Please create another one and try again.

The exact same cookie was working fine just few minutes before.
I even tried to create a new one with the same procedure but now it keeps giving me the error.
It looks like the session expired and there is some kind of cache that “remembers” it.

Bye Marco…

… it work for me …
I don’t understand why it doesn’t for you …

Are you using the 2-step verification ?
You connect to your account in private mode ?

Ok, I didn’t gave up and I made some more test and I think I finally understood my problem.
As long as I set only one account to Google Maps Location Sharing everything works (it worked fine for a full day).
But since I have to track two more accounts I added them today and after few minutes I started to get “Error 429” which means that Google detected too many request and finally banned my ip.

@JB_Marchetti how many accounts are you tracking, one or more?

At this point I’m pretty stuck because I don’t know what to do.

Anyone has this kind of problem?

Bye
Marco…

4 accounts tracked.

Édit : sharing 4 accounts to one account.
I only configure this account in hass.io

1 Like

Good. I didn’t think about it.
I think I’ll give it a try.

Thanks @JB_Marchetti

Personally I’ve had a heck of a time with this as well.

  • Currently I have a separate Google account created and share each my own and my wife’s location with this account (worth noting I do NOT have 2FA on this account - and further that this is the account I’ve setup in configuration.yaml)
  • I downloaded a copy of firefox and installed the cookie getter extension (per instructions here: https://www.home-assistant.io/components/google_maps/)
  • I logged into google w/ the ‘separate’ google account and went to maps.google.com in Firefox.
  • I then used the extension to download the ‘google.com’ cookies.
  • I then saved this file per the instructions and copied into my config directory on my NUC running HA
  • I then rebooted and it came back ok

Fingers crossed that 1) this keeps working for me and 2) that it works for you too!

FYI 2FA works now.

Bingo! Now it works.

I had to just set up one account to monitor 3 accounts position and now I’m not banned by Google Maps.

Thanks to @JB_Marchetti

1 Like

My Google Maps location tracking broke recenlty also. I was using the python google maps cookie getter and one of the recent updates broke it (0.99 maybe?). The only way I could get it to work was using JB_Marchetti’s method of Firefox in private mode. I could not get it to work with Chrome or standard Firefox.

I have 2 phones, and a 3rd account, 3rd account sees the 2 phones on google maps, I see them moving.
Made a cookie file, and for some reason only 1 account is working.
My phone says “source : none”

Any idea why?

Hi JB,
could explain what you mean with “the good name”?
I’m on a clean install, and the “initial” cookie is not being generated due to the same error message, so I cannot copy from there.
Thx

Hello :wink:

The right name … good name in my bad french english … is th cookie name like that :
.google_maps_location_sharing.cookies.[YOUR_MAIL_ADRESS]_gmail_com

Blockquote
Save the cookie file to your Home Assistant configuration directory with the following name: .google_maps_location_sharing.cookies. followed by the slugified username of the NEW Google account. Make sure to use the .com TLD (e.g., maps.google.com), otherwise the cookie won’t be able to provide a valid session.

  • For example: If your email address was [email protected] , the filename would be: .google_maps_location_sharing.cookies.location_tracker_gmail_com .

Mine stopped working, I can’t see the .google_maps_location_sharing.cookies.xxxxx_gmail.com file, it’s seems hidden under my /config folder.

How can I unhide it? I can’t see it using WinSCP nor through Terminal & SSH component in Hassio…

For the Linux ls command, files whose name starts with a period are not listed by default. Try “ls -a”.