Skip to main content

Google Find My Device smart home integration, free and open source

Google Find My Device integration for Gladys Assistant

Locate and ring your Android phones and Find Hub trackers from Gladys.

Overview​

This integration brings the devices of your Google Find My Device (Find Hub) account into Gladys: Android phones and tablets, and the Bluetooth trackers of the Find Hub network (Chipolo, Pebblebee, Moto Tag, earbuds…).

For each device, Gladys gets:

  • Location: the place name or the coordinates of the last position;
  • At home: 1 when the device is within the home radius, 0 otherwise;
  • Distance from home (km) and Position accuracy (m);
  • Ring: a switch that makes the device ring at full volume, even in silent mode.

It also adds:

  • three scene triggers: A device has a new position, A device arrives home, A device leaves home (with the device name, coordinates, distance and a Google Maps link as variables);
  • three scene actions: Locate a device (returns the position), Ring a device, Stop a device ringing;
  • a dashboard widget listing your devices with Locate and Ring buttons.

Positions are end-to-end encrypted by Google: the integration decrypts them inside your Gladys, with your own keys. They never go anywhere else.

Prerequisites​

Google offers no public API for Find My Device. This integration uses the same private API as the Find My Device app, as reverse-engineered by the open-source project GoogleFindMyTools. Google can change it at any time.

Signing in needs a real Chrome window, so it is done once, on a computer:

  1. Install Python 3 and Google Chrome on a computer.
  2. Download GoogleFindMyTools, then in its folder run pip install -r requirements.txt and python main.py.
  3. Sign in to your Google account in the Chrome window that opens.
  4. When the device list appears, choose a device to locate: the tool asks for the screen lock PIN (or pattern) of one of your Android devices. This unlocks the encryption key of your locations (owner_key). Without this step, the positions cannot be decrypted.
  5. The tool writes the file Auth/secrets.json. Open it with a text editor and copy all of its content.

Your Gladys house must have a location (Settings → Houses) for presence and distance.

Configuration​

  1. In Gladys, install the integration, then open its Configuration tab.
  2. Paste the content of secrets.json in Content of secrets.json and save.
  3. Optional: choose the Home house, the Home radius (150 m by default) and how often to Locate every (15 minutes by default, 0 = only on demand). Each locate request wakes the devices: very short intervals cost battery.
  4. Click Test the connection: it shows the account, the number of devices and the push channel state.
  5. Go to the Devices tab and add the devices you want.

secrets.json gives access to the devices of your Google account: keep it private. It is stored in a secret field of Gladys (hidden in the interface) and never written to the logs. Use a dedicated secrets.json for Gladys: if the same file runs elsewhere (Home Assistant…), both compete for the same push channel.

Troubleshooting​

  • "secrets.json is incomplete": run GoogleFindMyTools again until it lists your devices, then paste the new file.
  • "Positions cannot be decrypted: secrets.json has no owner_key": in GoogleFindMyTools, locate one device (step 4 above), then paste the updated file.
  • "Google refused the account token (BadAuthentication)": the token was revoked (password change, account security check). Delete Auth/secrets.json, run GoogleFindMyTools again and paste the new file.
  • A device never answers: it must be switched on, online, with Find My Device enabled. A tracker is only located when an Android phone passes nearby.
  • "Push channel down" badge: Gladys cannot reach mtalk.google.com on port 5228 (TCP). Open this outgoing port on your firewall.
  • No presence nor distance: give your Gladys house a location, or pick it in Home.

Configuration settings​

These are the settings Google Find My Device asks for in its configuration screen in Gladys.

SettingTypeRequiredDescription
Getting startedsectionNoGoogle offers no public API for Find My Device. On a computer with Chrome, run GoogleFindMyTools once (python main.py), sign in, then locate one of your devices: it asks for the screen lock PIN of one of your Android devices to unlock the encrypted locations. It then writes Auth/secrets.json: paste its whole content below.
Content of secrets.jsonsecretYesThe whole file, from { to }. It gives full access to your Google account's devices: keep it private.
HomeselectNoThe Gladys house used for presence and distance. Empty: the first house with a location.
Home radius (m)numberNoA device closer than this to the house is at home.
Locate every (minutes)numberNoAutomatic locate requests, 5 minutes minimum. 0: only on demand. Each request wakes the devices: keep it reasonable for their battery.

How to install Google Find My Device in Gladys​

  1. In Gladys, open Integrations: Google Find My Device appears in the catalog, next to the native integrations, with a community badge.
  2. Click Install. Gladys pulls the Docker image (ghcr.io/prohand/gladys-googlefindmydevice:0.0.1), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration).
  3. Open the Configuration screen of the integration, fill in the settings, and save.
  4. You can also install it directly from its repository URL: https://github.com/prohand/gladys-googlefindmydevice.

Google Find My Device requires Gladys >=5.3.0. The catalog inside Gladys refreshes every hour, so a new version becomes available at most one hour after its release.

Not running Gladys yet? It is free and open source: follow the installation guide to get started.

About external integrations​

Google Find My Device is an external integration: a community integration packaged as a Docker container and published on GitHub, that Gladys installs in one click and runs in a sandbox isolated from its core. It is published and maintained by prohand, not by the Gladys core team.

Subscribe to the Gladys Assistant newsletter

A few emails per month about new releases and project news. Sent by Pierre-Gilles Leymarie, founder of the project. Unsubscribe anytime 🙂