Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/t0mer/locationsharing
A Docker container to retrieve coordinates from an google account that has been shared locations of other accounts and add it as a device tracker to Home Assistant. The container publishes the info using mqtt auto discovery without the need of special configuration on the Home Assistant side.
https://github.com/t0mer/locationsharing
docker docker-compose home-assistant home-automation location location-tracking mqtt python3
Last synced: 22 days ago
JSON representation
A Docker container to retrieve coordinates from an google account that has been shared locations of other accounts and add it as a device tracker to Home Assistant. The container publishes the info using mqtt auto discovery without the need of special configuration on the Home Assistant side.
- Host: GitHub
- URL: https://github.com/t0mer/locationsharing
- Owner: t0mer
- License: mit
- Created: 2023-01-31T13:26:36.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-09T06:35:50.000Z (over 1 year ago)
- Last Synced: 2024-10-02T08:07:07.635Z (about 1 month ago)
- Topics: docker, docker-compose, home-assistant, home-automation, location, location-tracking, mqtt, python3
- Language: Python
- Homepage: https://hub.docker.com/r/techblog/locationsharing
- Size: 29.3 KB
- Stars: 2
- Watchers: 1
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# locationsharing
A Docker container to retrieve coordinates from a google account that has been shared with locations of other accounts and add it as a device tracker to Home Assistant. The container publishes the info using mqtt auto discovery without the need for special configuration on the Home Assistant side.## Install
Use the following docker-compose file for the container installation:```yaml
version: "3.6"
services:
locationsharing:
image: techblog/locationsharing
container_name: locationsharing
restart: always
environment:
- EMAIL_ADDRESS= #Google account email
- COOKIES_FILE_NAME= #Cookies file name (File name without path)
- MQTT_HOST= #MQTT Host address
- MQTT_PORT= #MQTT Port,Default is 1883
- MQTT_USERNAME= #MQTT Username
- MQTT_PASSWORD= #MQTT Password
- UPDATE_INTERVAL=1 #In minutes
volumes:
- ./locationsharing/cookies:/app/cookies
```### *cookies.txt* file
* You must sign out and manually sign into your Google account. Then browse to google.com/maps and extract from your "google.com" cookies and save it as cookies.txt
* Checkout [this chrome extension](https://chrome.google.com/webstore/detail/get-cookiestxt/bgaddhkoddajcdgocldbbfleckgcbcid/related?hl=en) to help export such file very easily.
* Once cookies.txt is created, if the Google account is signed out, it will invalidate the cookies.
* Create the **./locationsharing/cookies** volume and place the cookies file inside it.
* Next, set all the Environment variables and run docker-compose up -d to set up the container.The container will run two scripts:
1. The location-sharing script that creates the device_tracker and updates the information.
2. The second script is responsible for refreshing the cookies and keeping is up to date.