This is an ioBroker-adapter that can retrieve the location data of users that are sharing their location via google shared locations. It can not retrieve the location of the user that is used to access google.
Circularly shaped geofences can be defined in the adapter config. These geofences can be associated with users, i.e. that a state is toogled if the user enters or leaves a geofence.
The adapter can receive and process a bunch of messages, please have a look at main.js for details.
Because the adapter won't retreive any information about the user logged in, it is advised to create a new user dedicated for ioBroker.
- Create a new Google account for iobroker. I will call it "iobroker-Google-Account" later in the document.
- Log in with different Google accounts on all smartphones that should be tracked and start location sharing in Google Maps App.
- Open a "private browsing" window in your Web browser and log into google.com/maps with your iobroker-Google-Account. You should now see a bunch of people with their locations on the map.
- Copy the Cookie as described below.
- Close the window, do not log out of the session!
Currently login via the adapter is not possible. In future versions the adapter might create a proxy server and you'll have to login via the browser once, similar to the alexa2 adapter. But currently you'll have to enter the cookie in the configuration page manually in order to login. For this, do the following:
- Open a private browsing window (if not done already)
- Log in to google.com/maps (.com is important!) with your ioBroker-Google-Account (if not done already)
- Open Developer Tools of your browser (ctrl+shift+I)
- Navigate to network analysis
- select any successful (Status = 200) GET (method) Request from google.com (Host column) (if the window is empty, hit F5 in the browser)
- In the headers window copy all contents (ctrl+a then ctrl+c) from the line Cookie.
instance indicator is green but no location data is received or instance indicator is yellow and the log says "please login manually"
In this case check the google account of the user that is used by the google-sharedlocations adapter. Log in with a browser and check if google blocked some logins. Click on a blocked login and confirm to google that this was you. Additionally check that two factor authentification is turned off.
If you still experience problems please open an issue. Please set the adapter level to debug and publish the log there. Otherwise I have no change to help.
If this project helped you to reduce developing time, you can give me a cup of coffee or a bottle of beer via PayPal(chvorholt@gmail.com) :-)
- update cookie info also on position updates (Garfonso)
- fix adapter stays green even without updates (Garfonso)
- improve cookie update (Garfonso)
- fix crash on get users that prevents saving options (Garfonso)
- call account page at least every day now. (Garfonso)
- major rework of async logic (Garfonso)
- add call to account page in order to get longer lasting cookie (Garfonso)
- replace now unsupported request-library (Garfonso)
- fixed 500 errors (Garfonso)
- fixed warnings from wrong object fields - fences (Garfonso)
- enforced min_polling_interval (Garfonso)
- improved error logging (Garfonso)
- fixed warnings from wrong object fields (Garfonso)
- removed authentication and allowed user to copy in cookie (Garfonso)
- user groups are no longer created
- updated npm package dependencies
- integrated adapter core from Apollon
- fence was not updated correctly
- changed location of trigger poll state
- states are now members of named groups.
- added GPS position accuracy
- adapter should be more robust against datagram changes
- fixed places adapter support
- fixed translation issue with polling
- fences id can be determined by the user
- fences are properly added and removed now
- locations poll can be triggered by a state or by sending a message ("triggerPoll") to the adapter
- added state showing battery level and timestamp (solves #11)
- fixed roles
- Fixed installation problem
- Preparations for publishing the adapter
- Users can be simply selected in the admin config, i.e. userid need not to be entered manually
- Current address of the users is stored in a state
- Code cleanup
- Moved authentification to its own module
- Added support for Admin3.
- Google makes it hard to mimic a user login. Improved login procedure.
- Minimum polling interval must be greater than 30s.
- Added support for ioBroker.places adapter
- Fixed error that occurs when no fences exist
- Adapter does no longer crash if location data of a user has not been updated for a long time
- google had changed something in their authentification routine that made some changes necessary
- several bugfixes
- improved descriptions
- several bugfixes
- basic features tested
- objects for fences have to be deleted manually when they are removed in the admin interface
I am not in any association with Google.
The MIT License (MIT)
Copyright (c) 2017-2019 Christian Vorholt chvorholt@gmail.com
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.