Platform Legacy Error - Google Maps

I switched to life360

Any update on a proper fix for this? I know it was an “unofficial” way of grabbing data, but it was still useful.
I have the exact same error lines as the OP and I have done this as a fresh install of HA (using HASS.IO). I do not have an old cookie file to use as a work around.

I think it is a very easy way to do presence detection. I can do this without any extra apps on my phones.

The authentication method used by google keeps changing and breaking locationsharinglib, which is the utility home assistant uses to grab the data from google.

@costas has (rightly) had enough of constantly trying to fix it and has produced another utility which allows you to authenticate manually, using a browser, and then creates the required cookie file which, once copied in to your config folder, allows it to work without having to re-authenticate.

YMMV but it worked for me. Have a look here -

I suspect you’ll need to regenerate the cookie periodically, but once everything’s setup it’s not much effort.

2 Likes

I am happy that things are working for people! The benefit from this method is that the account can have settings, like 2fa and the works because essentially it is a manual authentication and the user can go through everything. The cookie created should be working just fine. As mentioned it should be working with the existing version of HA but that still accepts username and password and will try to authenticate which will break for much of the world. So i think that next step is to bump the locationsharinglib dependency in the component and amend the documentation to mention the above process of retrieving the cookie with the extra tool. Any takers? If not, I will do it but it will be late July since I am going on vacation.

2 Likes

Please have a look at Google Maps Device Tracking Setup? for details.

Hi All
I have just completed a Full Reinstall of Hassio on New SD Cards and now setting up Life360 which was working perfectly fine on Old Install
Where is the Device trackers Gone?

Also Getting this error

Fri Jun 28 2019 08:55:59 GMT+1200 (NZST)
Error setting up platform legacy Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/device_tracker/setup.py", line 76, in async_setup_legacy tracker.see, discovery_info) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/life360/device_tracker.py", line 298, in setup_scanner zones_from_places_interval() File "/config/custom_components/life360/device_tracker.py", line 288, in zones_from_places_interval zones_from_places(api, home_place_name, add_zones, zones) NameError: free variable 'api' referenced before assignment in enclosing scope

Please help, as I really like Life360 I HA and I works perfectly
Cheers all

I did this, and made it custom component. I looked at doing a pull request, but it’s a little daunting for someone new :slight_smile:

1 Like

Hi @dennyreiter, this is great! What did you find daunting to push this to the main line? Is anyone here that feels that he/she could help with this?

Inexperience and lack of time mostly :slight_smile: I intend on working on it. I’ve been trying to build the cookiegetter into a windows executable so it would be easier for people to fetch their cookie but have not succeeded as of yet. Thank you for this and making it possible!

1 Like

What do you mean “windows executable”? if you pip install mapscookiegettercli you will get an executable under your python installation Scripts directory which works just fine on windows just like in linux and Mac. Am I missing something?

No, not at all, I was just trying to make it easier for people who didn’t want to install a python environment on their Windows machine and didn’t have a gui on their linux machine.

I think that you could very easily make a portable exe of this with pyinstaller, not sure what method you are trying. As for the non gui part, it does not really make much sense since if there is no gui there is no browser so there is no interactive log in. Let me know if you need help with making it a windows executable with pyinstaller.

oh and by the way, the latest windows 10 version has python easily installable (finally!!) https://devblogs.microsoft.com/python/python-in-the-windows-10-may-2019-update/

Watching this carefully as my Maps tracking has recently fallen over after a fresh install but am a little clueless reading the guides about how to get the new cookie file (I need an ELI5 - “Explain Like Im 5” version), a windows executable would be fantastic.

@dennyreiter - Is your custom component repository in the custom component store? (or whatever its called, I forget…) would be great to do this as then it’s not so life and death to get the pull request sorted as people can just install your component via the GUI?

I just started looking at how to install hass.io, but I’ll look into the component store.

1 Like

You would need python 3.7 installed on your Windows machine and then you can follow https://mapscookiegettercli.readthedocs.io/en/latest/installation.html to install and https://mapscookiegettercli.readthedocs.io/en/latest/usage.html to use it.

2 Likes

Hi @dennyreiter Thank you for taking the effort to get this solved. I installed your custom component but get this error:
locationsharinglib.locationsharinglibexceptions.InvalidUser: /config/.google_maps_location_sharing.cookies.track_xxx_xx
I am using Gsuite so have my own domain. Should this work too? I created the loocation_sharing.cookies twice without different results.

I use mine with Gsuite, so it does work. Are you renaming the cookie with a slugified email address?

Yes I did rename it. From the error message I get it does find the file but can not find the user. Will try again this evening.