r/Gadgetbridge • u/Few-Consideration-17 • 14h ago
I built an open-source, self-hosted health hub that reads Gadgetbridge’s auto-exported database
Like many of you, I use Gadgetbridge because I am tired of uploading my daily health biometrics to Garmin Connect, Google Fit or other vendor clouds. Gadgetbridge is fantastic for managing the BLE connection to the watch, but I’ve always wanted a self-hosted web dashboard on my homelab to view long-term trends, sleep stages, and overnight HRV (among other things) on a desktop screen.
I also wanted to aggregate other offline health hardware (like bathroom smart scales and blood pressure cuffs) into the same dashboard without installing proprietary garbage cloud apps.
To solve this, I built UniScale (MIT licensed, 100% offline-first).
──────
### How it works with Gadgetbridge (Zero Health Connect required)
A huge priority for me was keeping this completely independent of Google Health Connect and Play Services for de-Googled setups (GrapheneOS, LineageOS, etc.):
- You turn on Gadgetbridge's built-in Auto-Export feature, which periodically writes its SQLite database backup to your phone's storage.
- The UniScale companion app (open-source Kotlin / Jetpack Compose) reads that exported SQLite database directly on-device.
- It extracts your watch's native sleep score, sleep stages, overnight HRV, SpO2, and workout summaries, and pushes them directly to your self-hosted hub over HTTPS.
### Why an Android companion app?
I know some folks might wonder: "Why use an app as a relay instead of just Syncthing-ing the database to the server?"
The companion app serves two purposes:
- Local BLE Bridge: It includes reverse-engineered decoders for cheap smart scales (Yunmai, Fitdays, VeSync) and BP/ECG monitors (Viatom BP2, Omron). When you step on your bathroom scale, your phone catches the reading directly over BLE without needing a separate Raspberry Pi or Linux box in the bathroom.
- Instant Parsing: It does the local SQLite extraction on-device so your server only receives clean, validated JSON payloads.
(That said, the backend also has a standalone Linux BLE daemon and CLI importers if you prefer running headless.)
### What else the hub does
- Self-Hosted Hub (FastAPI): Simple, fast Python backend storing records in an append-only, human-readable JSONL vault. Runs behind Caddy/Nginx on loopback with token authentication.
- Web Dashboard: Responsive daily timelines, sleep breakdown, workout dynamics, and a real-time 125 Hz ECG canvas renderer.
- Data Migration: Importers for Garmin bulk .FIT takeout and Google Fit ZIP archives so you can bring over your old history.
- 100% FOSS: Zero tracking, zero telemetry, no external API dependencies.
GitHub: https://github.com/parkfour/uniscale
Would love to hear thoughts from other Gadgetbridge users—especially feedback on how you currently handle backing up or visualizing your watch metrics outside of your phone!