Skip to content

Add Lenovo HS10 and Dr.Trust SSW526 support - #1440

Closed
RealBhupesh wants to merge 2 commits into
oliexdev:masterfrom
RealBhupesh:codex/solve-openscale-issues
Closed

RealBhupesh wants to merge 2 commits into
oliexdev:masterfrom
RealBhupesh:codex/solve-openscale-issues

Conversation

@RealBhupesh

@RealBhupesh RealBhupesh commented Aug 2, 2026 •

Copy link
Copy Markdown

What changed

  • Add Lenovo HS10 support for the FFF0/FFF1/FFF4 history stream, including F2 00 history requests, ten-byte timestamp/weight/impedance decoding, duplicate protection, and consumed-history cleanup.
  • Add Dr.Trust SSW526 support for the AC 27 FFB2 stream, including the captured offset-weight decoding, fixed-frame validation, stability detection, and weight publishing.
  • Route both device-specific handlers before the generic MGB handler and narrow SSW532 matching so SSW526 is not misclaimed.
  • Add focused protocol and handler-recognition tests.

Why

Issue #1437's HS10 capture showed the device's FFF0 service with FFF1 write and FFF4 notify characteristics but no measurement packet. The implementation follows the compatible HS11 packet reference and keeps the unverified hardware assumption explicit.

Issue #1436's SSW526 capture showed repeated AC 27 frames that the existing MGB/Taylor parsers ignored, so no measurement was published.

Validation

  • git diff --check and committed-diff checks pass.
  • Focused and full Gradle test commands were attempted, but local compilation is blocked because this checkout has no Android SDK/local.properties configured.

@oliexdev

oliexdev commented Aug 7, 2026

Copy link
Copy Markdown
Owner

Thanks for your PR. Is something missing or why it is a draft version?

@RealBhupesh

Copy link
Copy Markdown
Author

I kept this PR as a draft intentionally because two validation gaps remained: the local Android SDK was unavailable, so the Gradle tests could not compile, and GitHub had not reported any CI checks for the branch. In addition, the Lenovo HS10 implementation follows the compatible HS11 protocol reference because the issue capture contained no measurement packets, so it still needs physical HS10 hardware validation. The SSW526 path is based directly on the captured AC27 frames. I wanted those limitations to be visible before marking the PR ready for review.

@oliexdev

oliexdev commented Aug 8, 2026

Copy link
Copy Markdown
Owner

The missing Android SDK isn't really a blocker — the easiest way is to just install Android Studio, it ships the SDK and sets everything up for you (open the android_app folder and you're ready to build). Alternatively you can install the command line tools and point local.properties at them with sdk.dir=…; after that ./gradlew assembleDebug test runs fine locally.

That said, from the code it looks like this PR was never actually run — neither built nor tried against a scale. Scale handlers are very hard to judge from review alone, so please test this with the real hardware, and let me know whether it works or not. Once we have that feedback I'm happy to take another look.

@jankinath-das

Copy link
Copy Markdown

I have a minimal working version for the SSW526. It reads weight accurately but not impedance (as my hardware repeatedly sends back Byte 17: 03 and Byte 18: D5, which translates to a constant 981 placeholder).

If anyone is interested, I can paste the custom driver file here.

I am not entirely sure if the scale's firmware strictly expects user metrics (age, gender, and height) to be successfully registered first before it will trigger an electrical current on the electrode plates, or if my specific device has a hardware issue, or if there is a timing/packet-drop race condition during the initial handshake.

NB: Even though I have forked this repo, it has been a total nightmare to get it compiled given how picky Android Studio is with Gradle versions. I am so exhausted right now that I am not even going to bother committing or creating a pull request for these files in the foreseeable future. If you want the raw driver code, let me know here and I will gladly dump it in a comment.

PS: I am not a native mobile developer, so I used a lot of help from AI to iron out the Kotlin syntax specifics.

@oliexdev

Copy link
Copy Markdown
Owner

@jankinath-das sure you can paste the code here if you want. Maybe it will help somebody for future use. Usually Android Studio fetch the right dependencies automatically.

I will close this PR for now.

@oliexdev oliexdev closed this Aug 21, 2026
@jankinath-das

Copy link
Copy Markdown

Hi everyone, I've attached my code as a text file below. Could you please acknowledge if the file is accessible to you?

A few points to note from my testing:

  • Code Style: This may or may not perfectly match the project's style guide. Please feel free to adjust it!
  • Weight Readings: The reading is fairly accurate across multiple tests. However, it rarely mirrors the exact weight shown on the scale's physical display. I am consistently seeing a 150g to 500g difference. I am unsure if this is a limitation of the "dumb" scale hardware itself or a bug in this code.
  • Impedance Issue: The impedance reading still returns junk data. No matter what I try—using feet with an insulator, wet feet, or even testing on bare concrete bricks—the value is stubbornly stuck at 981.
  • Compiling: The code compiles perfectly, but Android Studio was giving me a lot of trouble on my specific setup. Because of this, I had to build it entirely via the Command Line Interface (CLI).

DrTrustSSW526Handler.kt.txt

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.

3 participants