oliexdev / openScale

Open-source weight and body metrics tracker, with support for Bluetooth scales
GNU General Public License v3.0
1.68k stars 292 forks source link

add support for Accuway scale #248

Closed en1389 closed 6 years ago

en1389 commented 6 years ago

I am use an Accuway scale http://images.hktvmall.com/h5680001/0c4204ced13f013b5d9854684d7b7271e527ccb4/h5680001_sl0916006a_171123082124_01_1200.jpg

It will shows the following data in its app. screenshot 26 apr 2018 2_01_59 pm

The openScale can connect with the scale with v1.7.2 but it lack of showing the visceral index I would like the openScale to add the support for this.

I capture the bt hci snoop log file, and it is attached. btsnoop_hci_0425.log

I check it with wireshark and found the corresponding data

00:00:35:ab:02:af:00:bd:02:29:00:1c:01:2c:08:06:2a:00:ea:00 00:00: gender ?? (maybe 00 for male, 01 for female) 35: 53 age ab: 171 height (cm) 02:af: 687 wght (68.7kg) 00:bd: 189 fat (18.9%) 02:29: 553 water (55.3%) 00:1c: 28 bone (2.8 kg) 01:2c: 300 muscle (30.0%) 08: 8 visceral (an index, not %, not kg) 06:2a: 1578 BMR (Kcal) 00:ea: 234 BMI (23.4944...) 00

This data agree with the captured screen above. However, on the openScale the data shown are,

screenshot 26 apr 2018 10_59_58 am There are some slightly different in the BMI and body fat, but I am not too worry about that. For the BMR the different is bigger (1501 vs 1578 Kcal) The biggest different is in Bone mass (4.08 vs 2.8 kg)

Please, check if some data is mis-calculated.

en1389 commented 6 years ago

Ok, I got it for the bone mass From the accuway app, it said my bone mass is 2.8kg But in openscale it said 4.08kg

If we 2.8 / 68.7 (my body weight) = 0.040757, i.e. 4.08% So, the openSacle app is actually showing the bone mass in %

with reference to https://tanita.eu/tanita-academy/understanding-your-measurements

I have less bone mass than normal.

erijo commented 6 years ago

The calculation for bone mass can be seen here: https://github.com/oliexdev/openScale/blob/master/android_app/app/src/main/java/com/health/openscale/core/bluetooth/BluetoothExingtechY1.java

Maybe @oliexdev can shed some light on why the calculation is done as it is?

en1389 commented 6 years ago

From the java script, the bone parameter is calculated like this,

float bone = (float)(((weightBytes[10] & 0xFF) << 8) | (weightBytes[11] & 0xFF)) / weight * 10.0f; // kg

We can see that the bone data is divided by 'weight' So the result is in % not in kg.

oliexdev commented 6 years ago

@en1389 fixed it with commit https://github.com/oliexdev/openScale/commit/3e3ff403e61f1e0f12c7f615064b37a367bfae93 Please try out the last openScale dev version.

It seems I received some false specification of the scale. :/

Anyway the difference between BMR is not a big deal.

oliexdev commented 6 years ago

@en1389 btw can you take a photo of your scale please for our wiki gallery?

erijo commented 6 years ago

@en1389: if you add a second user in openScale and select that user, can you still get readings from the scale then? I suspect not... Please enable debug log under settings -> about and attach that here if it doesn't work.

en1389 commented 6 years ago

picture of accuway scale

http://images.hktvmall.com/h5680001/128093/h5680001_sl0916006b_171011050140_01_1200.jpg

erijo commented 6 years ago

@en1389: we need an image taken by you, not an official one (due to copyright reasons).

en1389 commented 6 years ago

@en1389: if you add a second user in openScale and select that user, can you still get readings from the scale then? I suspect not... Please enable debug log under settings -> about and attach that here if it doesn't work.

Yes, you are right. The reading of the 2nd user cannot be shown in the app. I captured the bt hci log for you. btsnoop_hci_0428.log

The 2nd user I created is a female, age 49, height 163cm 02:01:31:a3:02:d7:01:53:01:d0:00:1d:00:b9:0e:06:76:01:11:00 From the bt log file, it got all the measurements. And I notice the first byte if for user ID, I just wonder hwy it is not 01 (as 00 is for the first user, second use should be 01)

erijo commented 6 years ago

User id starts on 1 in openScale so 2 is expected. I've removed the check that made it only work for the first user. Please verify that it works with the dev version after this fix.

en1389 commented 6 years ago

The dev version can show the 2nd user data with no problem.

erijo commented 6 years ago

Perfect, thanks for verifying @en1389!

en1389 commented 6 years ago

I tried out the new v1.8.1(28) with my Accuway scale.

Frist, I am happy that the Visceral fat is added. But I found that when I stepped on the scale, the app always made 2 entries each time. And the first entry has incorrect data, i.e. body fat, body water, muscle are all at 80%. And the Visceral for both entries are 0.

Please check it. screenshot_20180528-104635