Google Maps entities not showing up / Confusion

There are topic similar to this but not exactly. The closest is in feature request and was closed because the thread moved from feature request. I was guilty of asking questions. It said to post in either configuration or bug tracker. I starting here to make sure I my configuration is correct. Two things I would like to validate.

  1. Is my configuration correct?
  2. When google_maps.py is working, if I go to states tab, should it show up as an entity?

In my config/packages directory is my presence.yaml. Here it is:

device_tracker:
  #- platform: owntracks
  - platform: google_maps
    username: !secret locator_paul_username
    password: !secret locator_paul_password
sensor:
  - platform: google_geocode
    name: Paul
    origin: device_tracker.test_mqtt_paul_cell
    options: street_number, street, city
    display_zone: display
    gravatar: [email protected]
    api_key: !secret google_map_api

I assume once I know the name of the entity I can update my sensor origin: section.
I was using owntracks without issue, hence the comment name.

The error I am getting …
Log Details (ERROR)
Tue May 29 2018 15:09:14 GMT-0500 (Central Daylight Time)

Error setting up platform google_maps
Traceback (most recent call last):
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/__init__.py", line 183, in async_setup_platform
    disc_info)
  File "/usr/lib/python3.6/concurrent/futures/thread.py", line 56, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 40, in setup_scanner
    scanner = GoogleMapsScanner(hass, config, see)
  File "/usr/lib/python3.6/site-packages/homeassistant/components/device_tracker/google_maps.py", line 58, in __init__
    hass.config.path(CREDENTIALS_FILE))
  File "/config/deps/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 367, in __init__
    cookies_file=cookies_file)
  File "/config/deps/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 193, in __init__
    if cookies_file and self._validate_cookie(cookies_file):
  File "/config/deps/lib/python3.6/site-packages/locationsharinglib/locationsharinglib.py", line 220, in _validate_cookie
    raise InvalidCookies(message)
locationsharinglib.locationsharinglibexceptions.InvalidCookies: The cookies provided do not provide a valid session.Please authenticate normally and save a valid session again

you should see a file in your configuration directory called .google_maps_location_sharing.cookie delete that and restart to see if it fixes it. also make sure you are on the latest home assistant version too

I am on .70. Can’t remember exactly, but been trying since like .68.

Been trying that since the start also. I am doing it again so I can post the message exactly.

Log Details (ERROR)
Tue May 29 2018 16:38:25 GMT-0500 (CDT)

Could not open pickle file, either file does not exist or no read access.

But if I take an ls, the file is there.
I am using hass.io version 103.3. I just notice there is a 105 version. Will try it, but not holding out too high of hope. Also the host is “Resin OS 2.3.0+rev1”.

Main thing, does the yaml look correct? I have tested the credentials from a browser. Also I have approved HA as a approved app. That makes me think I have them typed in correctly.

I will report back if updating the hass.io supervisor helps.
EDIT: Updating to 105 did not fix it. What strange, I got the same “pickle file does not exist” message.

device tracker yaml looks good, try to go on the components github page and see if any of the bug discussions are helpful. If not create a bug so they can get it resolved.

Thanks, before I posted a bug, just wanted to make sure I was not doing something dumb. It’s hard for me to think I am the only one having the issue.

So, if it was working, should I be able to see an entity?

It seems to be a hit or miss for people honestly. Once you setup the platform you should see device_tracker.google_maps_xxxxx entities in the states panel for each account you shared.

Thank you. That is what I was expecting.

I have seen that. For me, I have never hit yet. :slight_smile:
Also, I think a lot of the hit or miss that I have read on the forums, has to do with two factor authentication. Right now I am not using 2FA.

I think my issue is hass.io and resin OS. There are a lot posts about test to run, but right now I am not familiar with docker. I hacked google_maps.py and changed the version from 2.0.2 to 2.0.7, no change. I wonder if my sharing lib is correct.

Anyway that answers most of my questions. I feel as good as I can that it is not my issue now. I will post on the tracker now.

1 Like

It worked.
Here is deal …
I went to post on the tracker. As I said before I approved the device as part of my setup, but I have not checked it in a while. So I thought I would make sure. Sure enough, it said a login attempt was blocked yesterday. So I approved the device again. I started thinking, the time was about yesterday when I deleted the cookie. My reboots this morning was not being tracked. So I deleted the cookie, rebooted, and connected. :slight_smile:

Sometimes in troubleshooting you just have to have the confidence so mind WILL look elsewhere.
The bad thing, now I don’t know for sure what fixed it.

it sounds like a combination of those things :slight_smile: deleting cookies, checking the account itself and restarting.

I think you are right.
I was getting ready to start testing automation with owntracks when I switched to google and got off in the weeds. Now back to it. Oh, and I need to figure out how to change the entity.
But that is for another thread. :smile:

I think someone already asked about the entity and it was not possible yet :frowning:

Thanks, I was going to google. Saved me some time. I seen a pull request to update the version (2.0.7). Maybe that ability will not be far behind.

Also, listening to the latest podcast (.70), Aaron talked about using Alexa in his car. One was instead of depending on presence detection, he would tell Alexa.
I have android auto, looks it now supports “google assistant”. https://assistant.google.com/platforms/cars/ I have not played much other than “ok google call xxxx” or directions. Can I control Home Assistant with it? Do I have to have the cloud? Oh so much to learn… But for another thread. :smile:

Not that I’m going to use but it might help the community if they are troubleshooting.

Where did you get this component?

sensor:
  - platform: google_geocode

Is that a custom component?

Component google_travel_time looks similar

sensor:
  - platform: google_travel_time

It has been awhile. Now that you mention it, it is custom.

https://community.home-assistant.io/t/google-geocode-custom-component-gps-to-street-address/22233

Looks like one just reports location, the other travel time, which needs the location.
I just wanted more than home/away.

Cool. Looks interesting, nice component to add. :slight_smile:

Thanks for sharing.

The last post was half a year ago, so I’m not sure if I’m necro-ing here. If so; apologies. My intention is to continue the discussion about the same issue in one place, instead of creating a duplicate thread.

Centrally, on my home assistant, there’s a map. Right now it shows my car (which is cute, but not useful), and the idea is that this shows the location of me and my partner. Once I got this data in there, I expect to do something similar as penright in generating ETAs and such. I’m also missing the relevant entities, though.

I initially followed the guide for this component, which suggests it works with three lines of code. I set up a dummy google account without 2FA, and have used this password as well as a device password without any luck. I’ve tried cloning the locationsharinglib (which seems to be built-in, so pip install shouldn’t be needed) to use the CLI to generate a cookie, but I’m getting a python error (line 349, something about an argument needing to be a type, not a classobj).

Am I missing something, or is this functionality broken somehow?