hms-scale-esp

An ESP32-C3 BLE gateway for the Etekcity ESF-551 smart scale. It reads weight and impedance over Bluetooth Low Energy and forwards each measurement to the hms-scale backend via an HTTP webhook — with a captive portal that makes first-boot WiFi setup a one-minute job.

ESP32-C3BLEESP-IDFSmart ScaleHome Assistant

What it does

Reads the scale over BLE

A Bluedroid GATT client connects to the Etekcity ESF-551 and decodes its 22-byte notification protocol, extracting weight (in grams), bio-impedance (in ohms), and battery level on every step-on.

Delivers via HTTP webhook

Each reading is POSTed to the hms-scale service as clean JSON, with 3 retries and 2-second backoff on failure — no MQTT broker required on the device side.

Captive-portal setup

On first boot the device hosts a GiraffeScale-XXXX AP with DNS hijacking, so your browser auto-redirects to a page for picking WiFi and setting the webhook URL. Credentials persist in NVS.

The device also computes on-device body composition with the Deurenberg formula for local logging, while the hms-scale backend handles ML user identification, BIA body composition, PostgreSQL storage, and MQTT publish to Home Assistant.

Get it running

Build & flash

Requires ESP-IDF v5.3+ and an ESP32-C3 Super Mini.

. ~/esp/esp-idf/export.sh

idf.py set-target esp32c3
idf.py build

idf.py -p /dev/ttyUSB0 flash monitor

Configure on first boot

No WiFi yet? The captive portal walks you through it:

1. Join WiFi AP: GiraffeScale-XXXX
2. Browser auto-redirects to setup
3. Pick WiFi network + password
4. Set webhook URL, e.g.
   http://192.168.x.x:8889/api/webhook/measurement
5. Save & Connect — device reboots

Runtime config

Browse to the ESP32's IP (port 80) to view WiFi, IP and BLE status, change the webhook URL, or factory reset back to the captive portal. Build-time options like the scale MAC, default webhook URL, and user age/height/sex are set via idf.py menuconfig.

Webhook payload

Every measurement is sent to hms-scale as JSON:

POST {
  "weight_kg": 71.89,
  "weight_lb": 158.49,
  "impedance": 537,
  "battery": 95
}

hms-scale responds with the identified user and confidence, then publishes to Home Assistant over MQTT.

Build your own scale gateway

Firmware, build script, and partition layout are MIT-licensed and ready to flash. Pair it with the hms-scale backend for full body-composition tracking in Home Assistant.