oliexdev / openscale Goto Github PK
View Code? Open in Web Editor NEWOpen-source weight and body metrics tracker, with support for Bluetooth scales
License: GNU General Public License v3.0
Open-source weight and body metrics tracker, with support for Bluetooth scales
License: GNU General Public License v3.0
Just found your app and it looks great, but....
I've been using a Mi scale since early 2016 - gave up with the MI app when I abandoned the wrist strap.
At my first attempt your app synced with the scale and downloaded all the data, but the values were a multiple of x2.2 (I assume its a llb/Kg conversion?) out. The scale is set for llb's and I set your app the same. If I switch your app to Kg the values read correctly.
I deleted the data and tried a re-sync, but I could only then download one value as I stood on the scale.
Does downloading the data clear it from the Mi scale? and how do I correct the reading error.
Thanks
we don't want our precious data to be deleted by accidental touch
I am trying to reverse engineer the yunmai mini scale.
I already found out the weight values but I can't figure out the body fat percentage, muscle percentage and so on. Any help or idea is welcome.
So far what I got:
0d:1f:0b:01:59:c6:15:2f:26:95:03
0x2695
= 9877 = 98,77 btw the value is rounded in the yunmai app as 98,8 kg)0d:1f:14:02:00:59:c6:15:2f:23:d0:b6:32:26:95:00:a5:08:f2:37
0d:1f:12:06:01:23:d0:b6:32:af:01:19:55:5a:8d:26:01:6f
Here are my Bluetooth log files with the corresponding body measurements which we have to find (open it with wireshark):
23.9.2017 07:36
btsnoop_hci_979.log
23.9.2017 10:02
btsnoop_hci_988.log
22.9.2017 18:35
btsnoop_hci_1041.log
Compared last continous messages of all three values
0d:1f:14:02:00:59:c5:f7:d6:23:d0:b6:32:26:3b:00:dd:08:f2:f9 // 97,9 kg; water 56,0 %
0d:1f:14:02:00:59:c6:15:2f:23:d0:b6:32:26:95:00:a5:08:f2:37 // 98,8 kg; water 56,0 %
0d:1f:14:02:00:59:c5:3b:d8:23:d0:b6:32:28:ae:00:c2:09:c4:88 // 104,1 kg; water 54,5 %
Hi @oliexdev
I found this app on the Google Play Store. This guy just took the source code, added some adds and put it on the Google Play Store
As you are the owner of the source code, feel free to open a request to google here if it's your wish ;)
Don't forget to tell Google that:
please add a changelog and link it to F-Droid' metadata. That way the users can easily see the difference between the installed version and the proposed update. It's important for people who really care about the software on their phone and what changes from the app to expect. Right now one has to find and examine all the commit messages to get a picture of what is going on...
Just found this on fdroid. Looks great.
Only thing I can see it I might need is more measurements.
Not that these measurements need to be tracked, just compared to the last or first measurements.
Measurements like
Biceps, forearms, chest, neck, thigh and calf maybe even left and right sides.
Great for weight loss to see what is going missing
And good for body sculpting to see where muscle is being built.
Great work.
openScale currently requires a hardware address or a device name for the Bluetooth connection.
Unfortunately, the Medisana BS444 scale always has different hardware addresses and device names, see #54.
How is the best and user friendly way to handle with different hardware addresses and device names of scales? Maybe somebody is a Bluetooth expert or as an idea to solve this issue.
I just got my Mi Scale for use with openScale ;)
Unfortunately it seems to be unsupported, the device looks just the same as the "old" Mi Scale but identifies itself as MIBCS. Model Number is XMTZC02HM
I can try to have a closer look at it later and maybe help with the protocol if it is different.
Might be a duplicate of #84
In 1.4.3 version I could add all measurements in 1-step and old values could be edited in the same screen, for example change only decimals:
But in 1.5 version I need 5-steps and old values aren't editable.
Second step to view old values:
Third step to add water percentage (you can't change old value):
Fourth step to add muscle percentage (you can't change old value):
Fifth step to add body fat percentage (you can't change old value):
Is possible change it again to 1-step changing old values?
Thank you very much.
I refactored the Bluetooth classes with commit 18a8457 and 490061f so it will be more developer friendly to implement a new Bluetooth scale class. But I am not sure if I mixed up some source code... I hope not ๐
It would be great if somebody could test the latest developer build and report any bugs or if everything works fine.
@jflesch I didn't refactored much at your source code but I am not sure if it still works because I set the BluetoothSanitasGattCallback in the constructor. Maybe somebody can check the Sanitas SBF70 scale.
Thanks in advance
oli
The app does not allow to enter a value for body fat higher than 40%. This is completely absurd, please remove the restrictions.
The parseInt at UserSettingsActivity:#261 should handle very large interger.
// CRASH: com.health.openscale (pid 6003) (elapsed nanos: 5771939483589)
// Short Msg: java.lang.NumberFormatException
// Long Msg: java.lang.NumberFormatException: Invalid int: "300416523230576771213457683014051600570377573"
// Build Label: Android/sdk_google_phone_x86/generic_x86:6.0/MASTER/4088240:userdebug/test-keys
// Build Changelist: 4088240
// Build Time: 1497047463000
// java.lang.NumberFormatException: Invalid int: "300416523230576771213457683014051600570377573"
// at java.lang.Integer.invalidInt(Integer.java:138)
// at java.lang.Integer.parse(Integer.java:413)
// at java.lang.Integer.parseInt(Integer.java:367)
// at java.lang.Integer.parseInt(Integer.java:334)
// at java.lang.Integer.valueOf(Integer.java:525)
// at com.health.openscale.gui.activities.UserSettingsActivity$onClickListenerOk.onClick(UserSettingsActivity.java:261)
// at android.view.View.performClick(View.java:5198)
// at android.view.View$PerformClick.run(View.java:21147)
// at android.os.Handler.handleCallback(Handler.java:739)
// at android.os.Handler.dispatchMessage(Handler.java:95)
// at android.os.Looper.loop(Looper.java:148)
// at android.app.ActivityThread.main(ActivityThread.java:5417)
// at java.lang.reflect.Method.invoke(Native Method)
// at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
// at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
//
On my scale, after measurements have been taken, the values for body fat, muscles etc. loop by twice after which they disappears. To make measurements entry in the app smoother it would be nice if you could configure the order in which the measurements appear during entry to be the same as on the scale. Then after entering the weight and pressing ok (or next) it would display the next entry in the configured order. It would also be nice if there where a + and - button on the entry screen to quickly increase or decrease a value by e.g. 0.1 kg.
Hey! Just tested this with the 1st gen. scale and it works just fine. Do you have any idea of how much effort to support the 2nd gen. scale?
I can set up a bounty and contribute to it. Maybe people are into that, it'd be nice to have those extra measurements.
What do you think?
Hi, I have a Polar scale which should broadcast its data according to the BLE specs.
It would be cool if the app can support the weight scale profile, so that a multitude of scales can easily be supported.
Keep up the great work!
Hi there,
Do you have any plans for integrating with other services? I am interested in Google Fit integration - there is a possibility to transfer body weight data to that service. Now I cannot find an app that supports this integration easily... What I'm asking now is your attitude about this - I may develop a PR with this integration, but some steps will be required from the application owner to allow this integration
Hello and thanks for making something great. Like you, I have been very frustrated by the lack of "non-cloud" smart devices. I would like to buy a scale to use with your app but, unfortunately, I am not technically savvy enough to understand your engineering notes. Could you please consider adding a section at the Wiki page for each hardware device to clearly outline how well it is supported by the app? The app page says Xiaomi is supported, but is it really fully supported? I would like to make sure before buying one.
Also, I would be happy to buy through your Amazon affiliate link, or something similar, if you have one. If you do not have one, it might be worth setting up. I think I am not the only person who would like to give back for your work.
You might also consider creating an email account for personal contact. Just an idea. I don't know if GitHub has a built in messaging service but I would recommend email anyway.
This app is very useful to obese persons, but in 1.5 version the maximum allowable percent body fat is 40% and it is insufficient to them.
In 1.4.3 version I could add higher values without problems.
This study reveals that in females, mean percentage body fat ranged to 42.4% at age 60-79 years.
https://www.cdc.gov/mmwr/preview/mmwrhtml/mm5751a4.htm
Is possible rise maximum allowable percent body fat to 45%?
Thanks.
I created a simple python script to transform the csv file from libra to the openscale csv format.
https://gist.github.com/feclare/9ce446a640ac1b8854456a4da468dc05
Is there a chance to get this app on fdroid?
(1) Maybe there could be a paragraph in the about screen how to connect to the scale? Even if the process is dead simple, laying out the steps removes a source of confusion.
I managed to pair it this way: put phone on scale with bluetooth enabled, re-insert batteries, try to pair from phone bluetooth settings. This gets lots of error messages "Couldn't pair with MI_SCALE because of an incorrect PIN or passkey." but finally it worked.
(fleshed out of #13)
Please implement import and export feature.
perhaps it will be possible to import data from DroidWeight ?
Currently GUI changes in settings are not instantly applied. You have to restart the app or switch several time between the three sub fragments to update a GUI fragment.
After updating to openScale 1.5.1, my data was all wrong.
My user's preferences were set in lbs (instead of kilos). After the update, the user still had the preferences in lbs, but the app was showing all old values 2.2 times larger (i.e. I think it interpreted them as kilos).
In order to recover, I had to export the data, modify it in openOffice (it was still showing up in lbs, so I had to convert it to kilos), clear the data and cache for openScale, re-create the user with the preference in kilos, import the data, then change the preferences to lbs again.
On the plus side, the BMI computation is now correct - thank you!
Good afternoon, I use scales, please specify whether they are being developed for them or not.
Steps to reproduce:
When I load the app to a new (virtual) device and create a new user,
the Overview view contains all measurement settings.
When I then go to Settings -> Measurements,
I see that waist and hip circumferences are disabled by default.
When I then close the Settings without changing anything and go back to Overview,
only the measurements that are enabled are shown (waist and hip circumferences are not shown).
This can only be reproduced by loading the app to a new (virtual) device and not by creating a new user because the settings are global.
Expected behaviour:
When I load the app to a new (virtual) device and create a new user,
the Overview view contains only the measurement settings that are enabled by default.
It would be great if somebody could translate the following description text into French:
openScale is an Open Source app to keep a log of your weight, body fat, water percentage and muscle percentage.
Features
- Logs your weight, body fat, water percentage and muscle percentage
- Display all your data on a chart and table
- Import or export your data from/into a CSV file
- Support for multiple users
- Support for Bluetooth Xiaomi Mi Scale
- Connection to a custom made bluetooth scale (see openScale wiki for more information)
- All data belongs to you (no cloud service)
Thanks to scritesair the app itself is already translated to French see PR #21
Best regards
oli
The app looks great and fulfills its task quite perfectly. But I'm having trouble doing continuous measurements. There a configurable daily reminder through notification would be a real enhancement for me.
Hey, first of all great app, thanks for your service.
I have a problem connecting the MI_SCALE with Bluetooth. The openScale message (no device found).
The device is found in the Android Bluetooth Management Tool.
Connection works with the official MI Fit App.
Is there a special pairing procedure?
Thx
When I use cm for height and lbs for weight, the BMI is calculated incorrectly. It looks like the weight in lbs isn't being converted to kg before the BMI calculation. The same thing is happening with weights in st.
Hi,
I just installed the app from Google Play (v1.5.3) but I cannot connect to my scale.
Probably because the MAC-address is not in the whitelist. It starts with C9:A6:8A.
Could you add that address?
Thanks
Hi, I'm having a BS 430. Unfortunately it isn't recognized when I hit the Bluetooth button.
Am I doing something wrong? Is it simply unsupported. Can I help somehow reporting some technical data or analyzing with hcitool?
Thanks
Hey @oliexdev,
thanks you so much for your awesome app! Are you interested in a new launcher icon?
I am not good at design myself but I could ask someone. Do you have any wishes?
Hi, first i want to thank you for this great app, definitely better than original Health Coach
I'd like to ask if is possible to add support to publish data after measurement to MQTT broker? I am not fan of regularly exporting. In addition to backups it can add other uses such as TTS to the BT speaker, or send data to Influx and visualize them in Grafana
Thanks for your great app.
Please add an option to export csv in way that can be imported by GoldenCheetah:
date,weightkg,fatkg,boneskg,musclekg,leankg,fatpercent,comment
2017-10-07T12:00:00Z,81.15,12.10,5.4,0,32.5,12.57,"Here the comment text contain commas itself, so it needs quotes"
Goldencheetah weight1.csv.txt
Goldencheetah weight2.csv.txt
(Please remove the .txt extension)
And the weight importer parser code:
GoldenCheetah/GoldenCheetah@e393200
Thanks
I had to add MAC-adress "CD9D0C" to get my BS444 working.
Suggestion:
Add option to settings, where users can add/remove first letters of MAC-adress.
First of all, thanks for the app!
I'd like to mention that the scale you use while building charts (starting from 0) isn't the best solution. This results in almost straight line, especially on small screen of a smartphone. This makes the chart completely useless. No one will weight 0 or 10 or 20 (even 60 for me personally) kilos. And there's no need to use this values while building charts. The better way is to take upper and lower results, add some margin (say, 2-5 kg) and use the resulting scale. Or use target weight as lower bound.
Also, in a year chart there's no need to reserve the scale up to end of the year. Doing so in January we will get almost blank screen. X-line should have 1st of January as 0 and the current date (plus some margin, say, one week) as its right bound.
And the last, putting all the values on a chart isn't a good idea when you have many records. Better not to put at all (or have a setting to put or not) or put only for peak values.
Look what I have in openScale and other similar program with exactly the same data:
Hi, following the wiki tutorial from this page i've re engineered some informations from my own bt scale. so far i've discovered following:
lumsing SmartScale CF369BLE
http://en.lefu.cc/intelligent/22.html
BT-Description:
Name: Electronic Scale
UUIDs: 65520
Custom Service: f000ffc0-0451-4000-b000-000000000000 ?
BLE-Apps:
Connection: fail
Type: LE only
Flags: LimitedDiscoverable
BrEdrNotSupported
Incomplete List of 16-bis Service UUIDs:
0xFFF0
0000FFF0-0000-1000-8000-00805f9b34fb
Reversed from Orig. Scale-App (some readable UUIDs):
"%08x-0000-1000-8000-00805f9b34fb"
"00001101-0000-1000-8000-00805F9B34FB"
"0000" + var2 + "-0000-1000-8000-00805f9b34fb"
Wireshark:
[localhost]
_Write Request 0x0012
_Handle 0x0012
_Value fe 01 01 01 b8 26 01 9e (check EXP. A)
[scale]
_Write Response 0x0013
_Handle 0x0012
_Value no data
[localhost]
_Write Request 0x0012
_Handle 0x0015
_Value 01 00
[scale]
_Write Response 0x0013
_Handle 0x0015
_Value no data
[scale]
_Handle Value Notification 0x1b
_Handle 0x0014
_Value cf 11 a6 b8 03 ad 00 b0 20 02 8c 0e 02 0d 07 64 (check EXP. B)
[scale] - 1xrepeated
_Handle Value Notofication 0x1b
_Handle 0x0014
_Value cf 11 a6 b8 03 ad 00 b0 20 02 8c 0e 02 0d 07 64 (check EXP. B)
EXP. A
fe 01 01 01 b8 26 01 9e
fe - always set
01 - Ugroup ,P0-P9
01 - sex ,00/01 women/men
01 - level ,00/01/02 ordinary/amateur/professional
b8 - height
26 - age
01 - unit ,01/02/04 kg/lb/st:lb/st
9e - checksum 8 xor
EXP. B
cf 11 a6 b8 03 ad 00 b0 20 02 8c 0e 02 0d 07 64
cf - sclae type ,cf/cb/ce BODY_SCALE/BABY_SCALE/BATHROOM_SCALE
1 - level
1 - Ugroup
a6 - sex/age combined (1010 0110, first bit from left sex, rest age 0x26)
b8 - height (cm)
03 ad - weight (kg)
00 b0 - body fat (%)
20 - bone (kg)
02 82 - muscle mass (kg)
0e - visceral fat ()
02 0d - body water (%)
07 64 - bmr (kcal)
i hope the device can get be supported by the app. thx
First, thanks for a great app! I've been using it for a few days and really love it.
In the charts tab, would it be possiblt to implement a yearly view, as well as a view with all available datapoints? I'd like to be able to see my total progress, as well as the progress over a longer period than a month.
Thanks again.
I set up the scale using the manufacturers app and then tried to connect with open scale using the sanitas sbf70 profile from the bluetooth menu i even set the scale name to "SANITAS SBF70".
No matter if the scale is active or inactive when i start it allways says it can't find the scale.
(I stopped the manufacturer app before to make sure it doesn't interfere)
Update: tried with latest development build too. Same result. What can i do to help fix this?
Update: i think my device id starts with 84:eb:18 if i understand the code correctly, that is my problem.
Can you add it to the next build?
Update: i tried to add the prefix myself, but it did not help. What else can i try?
(possibly a dupe of #12)
Hi, I bought the scale because I saw your app on FDroid. Thanks for all your hard work. Unfortunately, I have trouble connecting it:
(1) Maybe there could be a paragraph in the about screen how to connect to the scale? Even if the process is dead simple, laying out the steps removes a source of confusion.
I managed to pair it this way: put phone on scale with bluetooth enabled, re-insert batteries, try to pair from phone bluetooth settings. This gets lots of error messages "Couldn't pair with MI_SCALE because of an incorrect PIN or passkey." but finally it worked.
(2) The app cannot find the scale even if the phone and the scale are connected (and also if they are not). Instead, I get a toast message about no bluetooth devices found.
All the bluetooth info of the scale is here (only for one week for privacy reasons): http://pastebin.com/zne8xUd3
Bluetooth info was captured using https://f-droid.org/repository/browse/?fdfilter=blexplorer&fdid=org.ligi.blexplorer
Phone OS: Android 6.0.1 Slimroms
App: Version 1.4.2 from FDroid
Scale: purchased on 07.03.2017 from https://www.real.de/product/312976664/
When trying to achieve a goal, it is nice to see to which direction the measurements are leading to, specially the weight.
I've used other weight measurements software that showed me how when I would reach my goal if I kept my current pace and it was really usefull.
Maybe as an option?
Is that something you would find usefull?
currently to reset to default chart view (after zoom) is to restart app.
Hi, in issue #13, you suggested to upgrade to version 1.4.3. However, only version 1.4.2 is available.
https://f-droid.org/repository/browse/?fdfilter=openscale&fdid=com.health.openscale
(fleshed out of #13)
Application is not respecting Android's Portrait/Landcsape lock.
After rotating the mobile it rotates the screen not keeping system's rotation lock.
Hi oliexdex,
its great to see someone creates open source apps that save your privacy for products that want to share everything with the cloud. Thank you.
I bought the Mi Scale, downloaded your app Open Scale (v1.4.3) from F-Droid with a LG G4 with Cyanogenmod 13 (Android 6.0.1) and tried to connect it to the scale. I also deactived the privacy features for this app. Only the firewall (Afwall) is activated.
Often it works and I can receive the values from the scale. But more often the app crashes. Sometimes immediately after the start and sometimes after I tap on the bluetooth Symbol within the app.
Then it works for quite a few times and after a while it is broken again --> crash after trying to connect.
Maybe there is a problem if I start the app when I am standing on the scale already and the scale is still changing the weight quickly.
I can not locate the problem in detail but maybe you experienced similar things.
How does the app handle BLE-information that it does not understand? Does it ignore it or might this be the reason for the crash? Maybe you could catch errors within the app?
Best regards
Fox
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.