Google Maps integration & Location Sharing Revisited

Hello!

After couple of days and many many hours or trying to get the Google Maps integration working as per instructions:

  • Sharing the location in Google accounts
  • Getting the cookies with both Chrome and Firefox, both in normal and Private mode etc.
  • And trying all the possible combinations, I still get the:
    “The cookie file provided does not provide a valid session. Please create another one and try again” error.

Could someone confirm that the integration is working as expected with the most recent versions of HASSIO (core-2021.8.8 & supervisor-2021.06.8)?

My aim is to have HA inform me, when my child arrives & leaves home/school/etc. zones. I would prefer using Google Location information, since I already have it through Google Family Link.

It’s working for me.

@koying Thanks for the info. Could you kindly share at least a partial copy-paste/screenshot of your cookie file, so that I could check the format. How did you generate the cookie file? Chrome or Firefox? Private mode or not? www.google.com or .google.com? “Prefix HttpOnly cookies” unchecked or checked?

Just to double-check - if my Google account email address, that I use in configuration.yaml, is of format [email protected], what is the slugified format? xx_yy_zz_gmail_com?

1 Like

.google_maps_location_sharing.cookies.my_email_gmail_com excerpt:

# Netscape HTTP Cookie File

consent.google.com	FALSE	/	TRUE	1627640503	OTZ	<redacted>
.google.com	TRUE	/	TRUE	2146723199	CONSENT	<redacted>
.google.com	TRUE	/	FALSE	1630232508	OGPC	<redacted>
ogs.google.com	FALSE	/	TRUE	1627640508	OTZ	<redacted>
.google.com	TRUE	/	FALSE	1688120521	SID	<redacted>
<more...>

I don’ remember how I generated it at the time, sorry.

@koying Thanks - mine looks more or less the same. Hmm…I just don’t understand what is the problem in my configuration.

OK, now it seems I got this working. The trick for me was:

  • Firefox with all the cache cleaned (<-- this seemed to be the final cure for my problems)
  • Not in Private Mode
  • Cookies for google.com with “Prefix HttpOnly cookies” unchecked
2 Likes

I think the last part is how to test if it’s working at the end?

If anyone reading this topic is interested, I spent quite a bit of time improving the Google Maps integration to address the issues I’ve had with it over the years. At some point I may submit these changes to the standard integration, but for now, it’s available as a custom integration. I also provide detailed instructions for obtaining the cookies file with a few common browsers and make it easier to get the file onto your system.

More information can be found at:

Enhanced Google Maps Integration - Share your Projects! / Custom Integrations - Home Assistant Community (home-assistant.io)