惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

C
Check Point Blog
IT之家
IT之家
V
Visual Studio Blog
The Cloudflare Blog
博客园 - 司徒正美
Jina AI
Jina AI
博客园_首页
阮一峰的网络日志
阮一峰的网络日志
美团技术团队
S
SegmentFault 最新的问题
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
T
Tailwind CSS Blog
罗磊的独立博客
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - Franky
Last Week in AI
Last Week in AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
I built a tool that syncs 25+ BLE smart scales to InfluxD...
Kristian Par · 2026-05-19 · via DEV Community

The problem

I own a cheap BLE smart scale. It measures weight and body composition (fat %, muscle, water, bone mass…) over Bluetooth. Solid hardware. The catch: the only way to get those numbers into Garmin Connect was this ritual:

  1. Step on the scale.
  2. Open the vendor's phone app.
  3. Wait for it to connect and sync.
  4. Read the numbers off the app.
  5. Manually type them into Garmin Connect. Every. Single. Time.

If I forgot my phone, or the app's cloud was down, or I just couldn't be bothered — no data point. For something that's only useful as a trend, missing days quietly kills the whole point.

I didn't want to depend on a phone app that talks to a vendor cloud I don't control. So I built BLE Scale Sync.

What it does

A small always-on device (a Raspberry Pi Zero 2 W in my case) sits next to the scale and listens over Bluetooth. You step on, wait a few seconds, step off — and the reading lands in Garmin Connect. No phone. No app. No manual entry. No vendor cloud. Your data stays on your hardware.

Garmin is just one target. The same measurement fans out to whatever you configure:

  • Garmin Connect
  • Strava
  • MQTT → Home Assistant (auto-discovery, sensors appear automatically)
  • InfluxDB → Grafana dashboards
  • Webhook → anything
  • Ntfy → push notification on your phone
  • File → CSV / JSONL for your own scripts

And it speaks 25+ scale brands — Xiaomi (Mi Scale 2 passive broadcast), Renpho / FITINDEX / QN-Scale, Eufy, Yunmai, Beurer, Sanitas, Medisana, and more. Many protocols were ported from the excellent openScale project; a handful I reverse-engineered for this one.

Setup is one command

There's an interactive wizard that does BLE scale auto-discovery, user profiles, exporter selection, and connectivity tests for you:

docker run --rm -it --network host --cap-add NET_ADMIN --cap-add NET_RAW \
  --group-add 112 -v /var/run/dbus:/var/run/dbus:ro \
  -v ./config.yaml:/app/config.yaml \
  ghcr.io/kristianp26/ble-scale-sync:latest setup

Enter fullscreen mode Exit fullscreen mode

It generates a config.yaml you never have to touch by hand, but it's plain and readable if you want to:

ble:
  scale_mac: 'FF:03:00:13:A1:04'   # so you don't grab a neighbour's scale

exporters:
  garmin:
    enabled: true
  mqtt:
    enabled: true
    broker_url: 'mqtt://homeassistant.local:1883'

Enter fullscreen mode Exit fullscreen mode

Then run it continuously and forget it exists:

docker run -d --restart unless-stopped --network host \
  --cap-add NET_ADMIN --cap-add NET_RAW --group-add 112 \
  --device /dev/rfkill -v /var/run/dbus:/var/run/dbus:ro \
  -v ./config.yaml:/app/config.yaml:ro \
  -e CONTINUOUS_MODE=true \
  ghcr.io/kristianp26/ble-scale-sync:latest

Enter fullscreen mode Exit fullscreen mode

If you run Home Assistant OS/Supervised, it's a one-click add-on instead — UI config, Mosquitto auto-detected, Garmin tokens bootstrapped on first start.

A few things I'm proud of

No Pi next to the scale? Use a $5 ESP32. Bathrooms are often out of Bluetooth range of wherever your server lives. So there's an ESP32 BLE proxy: it sits by the scale and relays BLE over WiFi/MQTT to the container running anywhere on your network. It even ships an embedded MQTT broker so there's zero broker setup. If you already run an ESPHome Bluetooth proxy mesh for Home Assistant, it can reuse that instead (multi-proxy with automatic RSSI-based pick).

Multi-user. Two people, one scale. It identifies who stepped on by weight range and routes to per-user exporters (my Garmin, your Garmin).

Historical backfill. Some scales cache offline measurements. On reconnect it replays them with their original timestamps to targets that support back-dating (Garmin, InfluxDB, File), so a week away from the Pi doesn't leave a hole in your chart.

Linux BLE is… a journey. BlueZ has a notorious "stuck discovery" state where scanning silently dies after hours/days. There's a consecutive-failure watchdog that auto-recovers it, plus optional systemd Type=notify integration for whole-loop freezes. Headless reliability was honestly the hardest part — way harder than parsing the scale protocols.

Body composition is computed locally. Scales send weight + raw bioelectrical impedance; the 10 body-composition metrics are derived on-device via BIA formulas. Nothing leaves your network.

Stack

TypeScript / Node 22, zod for config validation, node-ble (Linux) / noble (macOS/Windows) for BLE, mqtt + an embedded aedes broker, Vitest. Adapters and exporters are both pluggable registries — adding a new scale or export target is a single self-contained module, which is documented in CONTRIBUTING.md if you want to add yours.

Cross-platform: Linux (Docker + native), macOS, Windows. GPL-3.0.

Try it / links

If your scale isn't on the list, open an issue with a BLE capture — npm run diagnose collects everything needed. PRs for new adapters very welcome.

Happy to answer anything in the comments — especially curious whether other people hit the same Garmin-sync wall, or solved it differently.