A service that polls Google Find My Device for location data and forwards it to a Traccar server using the OsmAnd protocol.
- Periodically polls all devices registered in your Google Find My Device account
- Sends location updates to Traccar via the OsmAnd protocol
- Configurable polling interval
- Flexible device name to Traccar ID mapping
- Docker support for easy deployment
- Dry-run mode for testing
-
On your server, create a directory and download the compose file:
mkdir trachs && cd trachs curl -O https://raw.githubusercontent.com/derenrich/trachs/main/docker-compose.prod.yml curl -O https://raw.githubusercontent.com/derenrich/trachs/main/.env.example mv .env.example .env
-
Copy your
secrets.jsonto the server:scp /path/to/secrets.json yourserver:~/trachs/secrets.json -
Edit
.envwith your configuration:TRACCAR_URL=http://your-traccar-server:5055 DEVICE_MAPPING={"Pixel 8 Pro": "mypixel", "Tag": "mytag"} -
Start the service:
docker compose -f docker-compose.prod.yml up -d
-
Copy the example environment file:
cp .env.example .env
-
Edit
.envwith your configuration:# Required: URL of your Traccar server TRACCAR_URL=http://your-traccar-server:5055 # Optional: Map device names to Traccar device IDs DEVICE_MAPPING={"Pixel 8 Pro": "mypixel", "Tag": "mytag"}
-
Ensure your
secrets.jsonis in place: The secrets file should be at./src/Auth/secrets.json(or updateSECRETS_FILEin.env) -
Start the service:
docker compose up -d
# Build locally
docker build -t trachs:latest .
# Or use docker compose
docker compose buildAll configuration is done via environment variables:
| Variable | Default | Description |
|---|---|---|
TRACCAR_URL |
http://localhost:5055 |
URL of Traccar's OsmAnd protocol endpoint |
SECRETS_PATH |
/app/secrets.json |
Path to secrets.json inside container |
POLL_INTERVAL_SECONDS |
900 |
How often to poll for locations (15 minutes) |
REQUEST_TIMEOUT_SECONDS |
60 |
HTTP request timeout |
DEVICE_MAPPING |
{} |
JSON mapping of device names to Traccar IDs |
AUTO_GENERATE_DEVICE_IDS |
true |
Auto-generate Traccar IDs from device names |
TRACCAR_ENABLED |
true |
Set to false for dry-run mode |
LOG_LEVEL |
INFO |
Logging level (DEBUG, INFO, WARNING, ERROR) |
PUID and PGID |
1000 |
User and group IDs to run as |
You can explicitly map Google device names to Traccar device IDs:
DEVICE_MAPPING={"My Phone": "phone001", "Pebblebee Tag": "tag001"}Or enable auto-generation (default) which creates IDs by lowercasing the device name and removing non-alphanumeric characters:
- "Pixel 8 Pro" →
pixel8pro - "My Tag (Blue)" →
mytagblue
- In Traccar, create a device for each tracker you want to monitor (make sure to note the unique IDs you set)
- Set the device's "Identifier" to match either:
- The value in your
DEVICE_MAPPING, or - The auto-generated ID from the device name
- The value in your
- Ensure port 5055 (OsmAnd protocol) is accessible from trachs
The secrets.json file contains authentication tokens for Google Find My Device. See the original GoogleFindMyTools documentation for instructions on generating this file.
# Install dependencies
uv sync
# Set environment variables
export TRACCAR_URL=http://your-traccar-server:5055
export SECRETS_PATH=./src/Auth/secrets.json
# Run
uv run python ./src/main.pyThe Docker image is automatically built and published to GitHub Container Registry on every push to main. For that case you should use the prod docker-compose yaml.
Pull the latest image:
docker pull ghcr.io/derenrich/trachs:latestThis is distributed under GPL-3.0 license
Uses work from https://github.com/leonboe1/GoogleFindMyTools which is also under GPL-3.0 license