Skip to content

Support for Active Era BS-06 scales#1091

Merged
oliexdev merged 2 commits intooliexdev:masterfrom
NecroKote:feat/support-for-active-era-bs06
Nov 24, 2024
Merged

Support for Active Era BS-06 scales#1091
oliexdev merged 2 commits intooliexdev:masterfrom
NecroKote:feat/support-for-active-era-bs06

Conversation

@NecroKote
Copy link
Copy Markdown
Contributor

PR contains rudimentary support for Active Era BS-06 scales.
Scales report weight, feet balance (weight distribution), raw impedance readout from the ADC, and heart rate.
All of those are logged, but only weight is reported in the app.

Historical measurements are also parsed, but not stored.

The BIA is done inside a native library, which I haven't looked at yet.

@oliexdev oliexdev merged commit f8bf51f into oliexdev:master Nov 24, 2024
@oliexdev
Copy link
Copy Markdown
Owner

Thanks for your awesome PR 🥇

int hr = pkt[0x0d] & 0xff;
int adc = Converters.fromUnsignedInt16Be(pkt, 0x0f);
Timber.i("Historical measurement: %.3f kg, Weight Left: %.2f kg, HR: %d, ADC: %d", weight, weightLeft, hr, adc);
// TODO: store historical results
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe just a simple

ScaleMeasurement historyMeasurement = new ScaleMeasurement();
historyMeasurement.setWeight(weight);
addScaleMeasurement(historyMeasurement);

would do it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is - I'm not the sole user of this scales ) So unless we have a proper "select and claim" mechanic, I would rather not claim everything automatically

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be solved with the settings->Bluetooth->Intelligence user assignment which automatically assign the user which have the nearest weight. You could also enable then ignore out of range measurements to ignore weights that out of the user weights.

int gender = selectedUser.getGender() == Converters.Gender.FEMALE ? 0 : 1;

calculateBIA(height, impedance, stableWeightKg, age, gender);
// TODO: report results
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you could set scaleData with the results?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I've used example BIA calculation, just to see how far off the result whould be from what the scales are showing. The results are way off, so this is why I'm not storing the results

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok yeah the vendors calculations are sometimes mysterious. I also implemented some estimates calculations, see https://github.com/oliexdev/openScale/wiki/Body-metric-estimations
You can enable them under settings->measurements->Body fat / Body water / Lean body mass

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.

2 participants