Repository navigation
feat: Add support for the Lescale F4P (Runstar R6 protocol) - #1563
Merged
Merged
Conversation
The Lescale F4P (ICOMON model FI2019LB-C, firmware 1.0.3) speaks the Runstar R6 protocol on service 0xFFB0, next to the Nordic DFU service 0x1530. RunstarR6Handler now claims it by its advertised name, "Lescale F4P". Verified against six weigh-ins captured with a BlueZ script, then an end-to-end weigh-in with a debug build on a Pixel (Android 13): 74.3 kg, 78 bpm and 492 ohm decoded and saved with body composition. Two differences from the R6, both seen in every capture: - The top three bits of the trailer byte are flags, not part of the checksum. 0x20 is set on every frame while the scale displays pounds. isChecksumValid() now compares the low five bits only; the other scales in this family leave the top bits clear. The flag in frames the app sends sets the display unit: a 0xBA user frame without it switched the scale from pounds to kg. Frames to the F4P therefore carry the user's unit (0x20 for LB; KG and the untested ST send 0). - Like the HO-36, the F4P gets the 0xBA user frame right after the 0xA1 ack. It answers 0xA0 01, shows body composition on its display, and after the weight locks (A2 state 0x04, about 20 s) reports impedance and heart rate in 0xA3. The existing encodeHoffenUserInfo() payload is accepted as-is. Known limitation: ScaleUser.scaleUnit is never filled in from the user's weight unit (BluetoothFacade.toScaleUser()), so handlers always see KG and the F4P is switched to kg. Measurements are stored correctly either way; the scale's own display shows kg. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Daniel Walker <dwalker@fifo99.com>
This was referenced Oct 18, 2026
Contributor
Author
|
The known limitation above (the F4P being switched to kg because |
Owner
|
Merged. The known limitation from the description no longer applies: on master If the F4P can display stones and you get the chance, it would be worth trying whether Thanks for your PR 👍 |
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.
The Lescale F4P (ICOMON model
FI2019LB-C, firmware 1.0.3, hardware 1.0.1) is another ICOMON body-composition scale that speaks the Runstar R6 protocol. It exposes service0xFFB0(FFB1write,FFB2notify,FFB3indicate), next to the Nordic legacy DFU service0x1530.RunstarR6Handlernow claims it by its advertised name,Lescale F4P.Two differences from the R6 were seen in every capture:
1. The trailer byte carries a unit flag
The top three bits of the trailer are flags, not part of the checksum. The low five bits are the usual
sum(bytes[3..18]) & 0x1F.0x20is set on every frame while the scale displays pounds and clear while it displays kg:The current exact comparison rejects every frame from a scale set to pounds.
isChecksumValid()now compares the low five bits only. The R6, HO-36 and FG2202WB captures in the tests leave those bits clear, so they're unaffected.The flag in frames the app sends sets the scale's display unit. A
0xBAuser frame sent without it switched the scale from pounds to kg. The same frame with0x20was accepted (A0 01) and the scale stayed in pounds. Frames to the F4P therefore carry the user's unit:0x20for LB, nothing for KG. Stones were never tested and fall back to KG rather than a guessed bit.2. It wants the 0xBA user frame, like the HO-36
After the
0xA1ack the F4P gets the same user frame as the HO-36. The existingencodeHoffenUserInfo()payload works as-is. The scale answersA0 01, shows body-composition values on its own display, and reports impedance and heart rate in0xA3once the weight has locked:A2state01A2state02A2state04A3Like the R6, the scale streams
A2without any handshake and replays offline weigh-ins asA4(timestamp + weight) on the next connect. The user frame also sets the scale's clock:A4timestamps were correct after it.Testing
A4history, impedance 0 (stepped off early) and impedance with heart rate (500 Ω / 0 bpm, 493 Ω / 71 bpm).RunstarR6HandlerTest, all from verbatim F4P frames, plus aScaleCatalogentry../gradlew :app:testDebugUnitTest --tests 'com.health.openscale.core.bluetooth.*': 645 tests, 0 failures.Known limitation: the scale is switched to kg
ScaleUser.scaleUnitis never filled in:BluetoothFacade.toScaleUser()copies name, birthday, height and gender only. So every handler sees the defaultKG, and this handler sends the kg flag. A user who prefers pounds will see the scale's own display switch to kg after connecting to openScale. Measurements are stored correctly either way, and the app shows the unit chosen for the Weight type. I've opened a separate issue for this because the fix affects every handler that readsscaleUnit: #1562Unknowns, unchanged from the HO-36
A1device-info payload (80 71 1e 5a 00 07 05) is not decoded.0xBAframe are copied from Fitdays captures of the HO-36. Their meaning is unknown, but the F4P accepts them.🤖 Generated with Claude Code