Gadgetbridge smart home integration, free and open source

Steps, heart rate, sleep and battery of your watch, from the Gadgetbridge export. No cloud.
Brings the data of your watch or band into Gladys through Gadgetbridge, the free Android app that talks to watches without the cloud of their manufacturer: steps of the day, heart rate, resting heart rate, sleep of the night, battery and the date of the last data, for each watch.
Gadgetbridge has no network interface: the integration reads the database export that Gadgetbridge writes on a schedule, synced to the machine of Gladys by Syncthing, Nextcloud or any other tool. Everything stays at home.
Developed without the hardware: feedback welcome. The reader was tested against databases built from the Gadgetbridge schema (Mi Band and Amazfit, Xiaomi, Bangle.js, Pebble), not against your watch.
Requirements
- Gladys Assistant 5.1 or later.
- Gadgetbridge on an Android phone, paired with your watch or band.
- A way to copy a file from the phone to the machine of Gladys, on a schedule: Syncthing (recommended), Nextcloud, a Samba share…
- Access to the machine of Gladys, to put the synced folder in place.
Configuration
1. Turn on the auto export in Gadgetbridge
In Gadgetbridge, open the side menu, then Settings → Automations, and
turn on the database export (not the ZIP export: the integration reads
the SQLite database). Choose a folder of the phone that your sync tool
shares, and an interval: every hour is a good balance. The Run AutoExport
now button writes a first export at once. The file is called
Gadgetbridge, without extension. See the
Gadgetbridge documentation.
2. Bring the export into the folder of the integration
Gladys gives each integration a single folder of its machine, and the integration cannot open any other one. With a standard installation, the export goes in:
/var/lib/gladysassistant/external-integrations/ext-guim31-gladys-gadgetbridge/gadgetbridge
It is created at the first start of the integration. Point the receiving end
of the sync at it (a Syncthing folder whose path is this one), or bind mount
the folder where your tool drops the file, read-only:
mount --bind -o ro /srv/sync/phone /var/lib/gladysassistant/external-integrations/ext-guim31-gladys-gadgetbridge/gadgetbridge,
then restart the integration. A symbolic link to a folder outside does not
work. The integration runs as user 1000: the file must be readable by it.
3. Configure the integration
- Export file: empty, the newest SQLite file of the folder (and of its
sub-folders, one level down) is read. Name a file (
Gadgetbridge,phone/Gadgetbridge) when several phones export there. - Daily step goal: used by the scene trigger and the widget.
- Export late after: without a new export for that long, the widget warns and the "Export late" trigger fires.
- Language of the feature names: the names given to the features when a watch is added, and the language of the dates.
Then press Check the export: the answer says which file was read, how many watches it holds and the date of the newest data.
The devices
Each watch or band of the export appears in Discover, under the name given in Gadgetbridge. Add the ones you want. Devices without health data (headphones, lights…) are left out. Each watch has:
| Feature | Value |
|---|---|
| Steps today | since midnight, in the time zone of Gladys |
| Heart rate (bpm) | the last valid measure, under 24 h old |
| Resting heart rate (bpm) | as computed by the watch, last three days |
| Sleep last night | hours asleep, from 18:00 the day before to noon |
| Battery | percent |
| Last data received | date of the newest data of the watch |
A value the export does not hold (no heart sensor, sleep not readable for that family) stays empty: never a wrong zero. The export is looked at every minute and read again only when it changed, and at midnight.
Widget
Watch summary: steps (green once the goal is reached), sleep of the night and heart rate as tiles, then the watch with its battery, the goal progress, the resting heart rate and the date of the last data. Settings: the watch to show (empty: the first one), and a switch to hide the detail lines. A warning line says when the export is late or unreadable.
Scene triggers
- Gadgetbridge: step goal reached: today's steps of a watch reached the goal. Once a day per watch, known at the next export. Filter: the watch. Variables: watch, steps today, step goal.
- Gadgetbridge: export late: no new export for the delay of the configuration (the phone may no longer sync). Once per export. Variables: hours since the export, date of the last export.
Configuration action
Check the export reads the export at once and answers with the file, the number of watches and the date of the newest data, or in red with the reason (no file, not an SQLite database, not the one of Gadgetbridge, unreadable).
Scene examples
- "Step goal reached" → send "Well done {{watch}}: {{steps}} steps today" on Telegram.
- "Export late" → send a message: "No Gadgetbridge export for {{hours}} h, check the phone".
- Every morning at 9:00, if "Sleep last night" of the watch is below 6 h → dim the lights in the evening.
Troubleshooting
- "No Gadgetbridge export in the export folder yet": the folder is empty, or the file is still in a hidden temporary name of the sync tool. Check the path above and press "Run AutoExport now" in Gadgetbridge.
- "Not an SQLite database": the ZIP export was chosen, or another file. Turn on the database export.
- "The export file cannot be read": give read rights to user 1000.
- A watch is missing: it has no step, heart rate or sleep data in the export yet; sync it in Gadgetbridge first.
- No sleep figure: the integration reads the sleep of Xiaomi (new protocol), Mi Band 2 and later, Amazfit, Bangle.js and PineTime. Other families keep the feature empty.
- Steps lag behind the watch: they are those of the last export, which only holds what the watch synced to the phone.
Limits
- Data is as fresh as the export: an export every hour means figures up to an hour old, plus the time the watch takes to sync with the phone.
- Steps and heart rate are read for every family that stores activity samples (Mi Band, Amazfit, Xiaomi, Huawei, Garmin, Pebble, Bangle.js, PineTime, Fossil…). The sleep is read for Xiaomi (new protocol), Mi Band 2 and later, Amazfit, Bangle.js and PineTime only: Gadgetbridge computes the sleep of the others with its own analysis, which the integration does not reproduce. Its figure may differ a little from the one of the app, which can refine sleep stages.
- The sleep of the night counts the time asleep from 18:00 the day before to noon: a nap in the afternoon is not counted. Before noon, the night counts once its last sleep ends after 04:00; until then the night before stays.
- Large databases (hundreds of MB) are copied at each new export: keep an eye on the disk of Gladys.
Privacy and data
- Health data stays at home: phone, sync tool, Gladys. No cloud, no account.
- The export is only read, never modified. The integration reads a private
copy of it, kept in its own folder (
cache/export-copy.db) and replaced at each new export; uninstalling the integration removes it. - The logs never hold a health figure nor the address of a watch.
- Gadgetbridge, Syncthing and Nextcloud are trademarks of their owners; this integration is not affiliated with the Gadgetbridge project.
Configuration settings
These are the settings Gadgetbridge asks for in its configuration screen in Gladys.
| Setting | Type | Required | Description |
|---|---|---|---|
| Before you start | section | No | In Gadgetbridge (Settings → Automations), turn on the database export, every hour, to a folder synced with the machine of Gladys (Syncthing, Nextcloud…). Gladys gives this integration one folder of its machine: put the export in its “gadgetbridge” sub-folder, /var/lib/gladysassistant/external-integrations/ext-guim31-gladys-gadgetbridge/gadgetbridge. The file is only read, never modified. The documentation gives every step. |
| Export file | string | No | Name of the file in the gadgetbridge folder. Empty: the newest SQLite file of the folder. |
| Daily step goal | number | No | Used by the “Step goal reached” scene trigger and by the widget. |
| Export late after | select | No | Without a new export for this long, the widget warns and the “Export late” scene trigger fires. |
| Language of the feature names | select | No | Names given to the features when a watch is added to Gladys, and language of the dates. |
How to install Gadgetbridge in Gladys
- In Gladys, open Integrations: Gadgetbridge appears in the catalog, next to the native integrations, with a community badge.
- Click Install. Gladys pulls the Docker image (
ghcr.io/guim31/gladys-gadgetbridge:1.0.0), starts it in a sandbox isolated from the core, and generates the integration's interface (devices, discovery and configuration). - Open the Configuration screen of the integration, fill in the settings, and save.
- You can also install it directly from its repository URL: https://github.com/guim31/gladys-gadgetbridge.
Gadgetbridge requires Gladys >=5.1.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
Gadgetbridge 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 guim31, not by the Gladys core team.
- Browse all integrations, native and community
- Build and publish your own external integration
- Source code on GitHub — source of this documentation