Add support for Yunmai X (YMBS-M268) broadcast-only scale#1418
Open
pagarsky wants to merge 2 commits into
Open
Add support for Yunmai X (YMBS-M268) broadcast-only scale#1418pagarsky wants to merge 2 commits into
pagarsky wants to merge 2 commits into
Conversation
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>
Author
|
@oliexdev sorry for the ping, can you take a look? Would appreciate if this can lend in the next release! ❤️ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:[0..5][6..8]0B 74 17[9][10]01live,02stable,03final (incl. impedance)[11..12][13..14][15][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 17signature + checksum — during scans, and the advertised 16-bit service UUID0x1320for saved-device snapshots (which carry no manufacturer data). These checks distinguish it from other 14-byte manufacturer frames from nearby devices.Changes
YunmaiXHandler(+YunmaiXAdvparser), registered inScaleFactory.Testing
./gradlew testDebugUnitTestpasses (15 new tests, 0 failures);assembleDebugbuilds. Validated on real hardware: a full barefoot measurement produced weight + impedance and full derived body composition stored in openScale.