Skip to content

Add support for Yunmai X (YMBS-M268) broadcast-only scale#1418

Open
pagarsky wants to merge 2 commits into
oliexdev:masterfrom
pagarsky:add-yunmai-x
Open

Add support for Yunmai X (YMBS-M268) broadcast-only scale#1418
pagarsky wants to merge 2 commits into
oliexdev:masterfrom
pagarsky:add-yunmai-x

Conversation

@pagarsky

@pagarsky pagarsky commented Jul 8, 2026

Copy link
Copy Markdown

Summary

Adds a handler for the Yunmai X (YMBS-M268), which was not detected by openScale at all. Unlike the Yunmai SE/Mini (GATT), the Yunmai X broadcasts its measurements as manufacturer-specific advertisement data — no GATT connection, and it advertises no local name (the vendor app calls this device family "YUNMAI-ADV").

Protocol

16-byte manufacturer AD (type 0xFF), reverse-engineered from an advertisement capture and confirmed end-to-end against a live measurement driven through this handler:

bytes meaning
[0..5] device MAC, byte-reversed
[6..8] signature 0B 74 17
[9] per-session byte (varies between weigh-ins; ignored)
[10] state: 01 live, 02 stable, 03 final (incl. impedance)
[11..12] weight, u16 BE, 0.01 kg
[13..14] impedance, u16 BE, Ω (0 until final)
[15] XOR checksum over [9..14]

Body composition (fat/water/muscle/bone/LBM/visceral fat) is derived from weight + impedance via the existing YunmaiLib, consistent with the Yunmai SE/Mini handler.

Identification

The scale advertises no name, so matching uses the frame structure — MAC echo + 0B 74 17 signature + checksum — during scans, and the advertised 16-bit service UUID 0x1320 for saved-device snapshots (which carry no manufacturer data). These checks distinguish it from other 14-byte manufacturer frames from nearby devices.

Changes

  • YunmaiXHandler (+ YunmaiXAdv parser), registered in ScaleFactory.
  • 15 unit tests with synthetic fixtures built to the observed layout.
  • saved-scale panel now falls back to the handler display name when a scale advertises no name (previously rendered a blank line above the MAC).
  • README: list the Yunmai X.

Testing

./gradlew testDebugUnitTest passes (15 new tests, 0 failures); assembleDebug builds. Validated on real hardware: a full barefoot measurement produced weight + impedance and full derived body composition stored in openScale.

openscale_saved_redacted

pagarsky and others added 2 commits July 8, 2026 22:06
The Yunmai X (YMBS-M268) advertises measurements as manufacturer-specific
data without a local name and needs no GATT connection (the vendor app
calls this device family "YUNMAI-ADV"). Frames echo the device MAC
byte-reversed, carry a 0B 74 17 signature, a state byte (live/stable/
final), weight and impedance as u16 BE, and an XOR checksum.

Identification uses the frame structure + MAC echo during scans and the
advertised 16-bit service UUID 0x1320 for saved-device snapshots (the
scale advertises no name to match on). Body composition is derived from
weight + impedance via YunmaiLib, like the Yunmai SE/Mini handler.

Protocol reverse-engineered from an advertisement capture and confirmed
end-to-end against a live measurement driven through this handler (weight
and full body composition derived and stored). Unit-test fixtures are
synthetic frames built to the observed layout.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Broadcast-only scales such as the Yunmai X advertise no local name, so the
saved-scale panel rendered a blank line above the MAC. Fall back to the
resolved handler display name when the advertised name is blank.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@pagarsky

pagarsky commented Jul 9, 2026

Copy link
Copy Markdown
Author

@oliexdev sorry for the ping, can you take a look? Would appreciate if this can lend in the next release! ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant