Google Maps Device Tracking Setup?

Thanks, that worked!

1 Like

Earlier in the week I set things up to track my location. It seemed to be working nicely at the time. Yesterday I had my wife share her location with the new tracking account but it didn’t seem to show up as a known device. I then realized it was no longer tracking my location, either. I think the tracking account was entirely failing to log in. I went ahead and upgraded to .99.0 (I should know better than to change more than one thing at a time, but I was at a loss for why it wasn’t working).

I regenerated my formerly pickle now cookies file with the cookie.txt chrome extension and I’m now seeing a second device tracked but it’s tracking my location and my original known device is just “away” with no indication of where it is. The original known device was google_maps_[21 digit number] but the new one is google_maps_[sluggified username of the tracking account]. The old one also pulled in my google account icon but the new one has no icon. I’m concerned that means it’s only possible for one location to come through the tracking account now…

I have confirmed logging into the tracking account in a web browser does show both shared locations on google maps.

snip from my config:

device_tracker:
  - platform: google_maps
    username: [new tracker account name]@gmail.com
    new_device_defaults:
      track_new_devices: true

Any suggestions on what I might be doing wrong and/or how to get the second shared account tracked?

Thanks in advance!

I was in .99 and upgraded to 99.2 , follow the Firefox process and it’s working just fine, with viewing of all devices that are being monitored .
thank you.

btw, I just exported the google.com cookie and not the www.google.com

Hi Josh, I’ve had a similar issue when setting up the integration recently.

It seems a little hit-or-miss to me - sometimes I can run initial setup and it only picks up my partner’s GPS, other times it will pick up both of us.

What I’ve done with some success is if I setup the component and only my partner’s GPS is tracked, I delete the google devices from known_devices.yaml and restart HA. At the same time, I have google maps open on my phone with the location sharing menu open and displaying both our locations. When HA restarts it then usually picks up both devices.

No idea if having location sharing open actually helps but has worked for me on 2/2 occasions where initial setup of the google maps tracker had only listed one device!

1 Like

Hi,

I have it working apart from that I no longer get battery level or charging status, is anyone else getting these?

if you have problem with your cookie file, make shure you are on google.com (not .something else) when you get the cookie, i had the same problem

many thanks
worked for me.
0.99.2

  • comment previous google_maps_******* in known_devices.yaml
  • restart HA
  • log in on firefox, only with one google account
  • goto https://www.google.com/
  • export google.com only cookie to HA
  • restart HA
1 Like

Thanks for the suggestion. I tried your approach both with my new HA maps account up via the web or the actual maps app on my phone but it is still only reporting a single user. I actually think it’s only reporting the new/HA account and not the locations that are being shared with that account: I stopped sharing my location (so only my spouce’s location was shared) but the only tracked device is showing my location…

Hello everyone

I´m having the same issue here. I had the disgrace of changing my password, so I had to update the cookie file. I´ve been through mapscookiegetter and the cookie.txt, and finally got it working, but for my dismay it only shows the location of the fake_google_account

I´m on Hassio 0.99.3, and still thinking on reinstalling everything (sigh)
@costas, is there anything on this?

Cheers

Yeah, based on feedback from people, if you used Windows to get your cookies, use either a mac or a linux box because the cookies created on Windows don’t seem to give access. Give that a try.

Thanks!

Strangely, it gives access, but only to the base “fake” account itself, not to the shared locations… I´ll install a VM and give it a try! (and report back)

Multitude of issues and it seems to me, somewhat of a noob yes but a logical enough person to see that, seemingly, different people with exactly the same problem cannot find a single solution that works.

I, for the life of me, cannot get Google Maps tracking to work on a, relatively, new install. I don’t even have a known_devices.yaml file and not matter what I do, whether I create one myself or not… nothing is ever created or populated into the file.

It is clear to me that with the changes being made to the Hassio UI, trying to put more functionality into the front-end rather than via direct edditing of yaml code, it seems to introduce problems for people. I’m not sure what the answer is but it’s clear some answers simply no longer work for some people…

Hi again @costas

I just created a linux mint VM, installed and updated things for an hour, and succesfully created the cookie file with cookiegettercli. No joy, it keeps telling me the cookie file ¡does not provide a valid session (but, I got the google account alert…). The only thing that half work is the Chrome extension, though the session created only finds the same user that logged in.
I´m a t a loss here…

Hi Augusto,

Cookiegetter should not be used. Can you please try the mozilla add-on to retrieve the cookies since there have been reports that the chrome one does not work on Windows, so it might not work correctly on mint either.

I do have the very same issue. Were you able to fix it?

Reporting back: TOTAL SUCCESS!

Step by Step:
Oracle VM, download and install any linux distro.
Open firefox and install add-on(export cookies).
Browse to google maps and sign in.
Click add-on and download cookie.
Change name of cookie as described and copy to Hassio config folder.
Restart HA
Voilá

@costas, thanks a lot.

PS: DON´T use Chrome

I’d be interested in knowing the format and the sort of information that is saved in this cookies file you export?

Also, when you get the option to export the cookies is there 2 or 3 different ‘types’ of cookies export options? I know when I have tried through Firefox on my Windows machine I’ve always had multiple options (and have tried them all with no success). The information content of the different export options is clearly different.

Here’s what I’ve had success with in the past: Google device tracker and cookies

Just going to comment as Im having the same issue as the rest here.
If anyone finds a solution please send me a holler.

My setup worked when location sharing made the cookie. You now know how long it has been since I messed with location sharing. I am interested in making another run at presence detections and would like to get location sharing working again. I am on version 0.100.3
This is the most recent thread I could find I may be building my cookie file wrong, but I think my issue is naming the file. No matter what I named the file I get the same error message

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

So my next step was to just delete the file, expecting a file missing and maybe glean the name from doing that. Still, get the same message.

So if I use an example log in of [email protected]. I would expect the name to be

.google_maps_location_sharing.cookies.locatexxxx44_gmail_com

Is that correct?

Once I know that then I can move with confidence that I am doing the file wrong.

Edit
My mistake was adding _gmail_com. My user name was locatexxxx44, but in my configuration, I did not have the @gmail.com.
I copied the google_maps into my custom directory and added the file name to the error log. That was my clue to what went wrong. I am posting this in case someone else runs across the same issue.