-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for Mi Body Composition Scale 2 (Model # XMTZC05HM) #4
Comments
I take it you managed to get your MAC address ok following the instructions? |
Yes, I could get MAC address as described. Running wrapper.sh (no docker), in a Raspberry Pi4 running Raspbian Buster properly updated (Linux fw 4.19.66-v7l+), python_version 3.7.3. With my Python limited and basic skills, I tried printing the variables height weight and age before the error message and weight was like 0.3 (maybe weight is coming at a different offset?). Age and Height looked consistent with Mi Fit data. Let me know how can I help more. Thanks in advance for your help |
It's a different scale so the message is probably different. |
OK, deal. That "dive" info may also be helpful for me to try to do myself a similar job for another Xiaomi BT device I have here (currently outside Home Assistant, only in Mi Home). |
sorry not had the chance to do this yet. Should have time tomorrow if you're around |
Yeah, no problem. Let me know when you can. |
Hi, I have also problem with connection so if you let me join to your discussion then i will be very pleased. After let say 3pm I will add here my errors in code and some other uncertainty :) |
Hi @pplucky @patrickf10
I'm mostly interested in the longest data string (in my example 1b1802a4b2070103051428fdffe43e) as well as your weight and unit from the actual scale / Mi App please |
I'm on discord now (lolouk44#7180) |
I sent you a invitation on discord as Drochu#3314 |
Unfortunately I can’t right now. Msybe in an hour or so, otherwise in the
evening only
…On Fri, 25 Oct 2019 at 12:09, lolouk44 ***@***.***> wrote:
I'm on discord now (lolouk44#7180)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#4?email_source=notifications&email_token=AD5FWDL5S5L4WENIL2UCG5DQQLHWNA5CNFSM4JDGUUG2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOECIAXBY#issuecomment-546311047>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AD5FWDPMMRIDSFZNJQBRC2LQQLHWNANCNFSM4JDGUUGQ>
.
|
What appears as measure is the weight showing on the scale while running the python, what is in Mi Fit is 63,25 and unit is KG (for the first user, there is a second one in Mi Fit, with 48,85 and unit is also KG). What else do you need? |
The data appears to be quite different than mine, |
Here it is, using the latest version of test script:
|
Thanks. The data looks interesting and may I say promising. That being set aside for now, when I get the data I expect, I get the right readings: Can you try and run the script more than once while you're being weighed to see if the data changes? |
All tests done with socks:
|
Well that's interesting. Every single reading gives a weight. I really don't understand why you sometimes get odd weight readings. |
Hi Guys, i obtain such errors; Any ideas how to solve it? |
Tonight after 10PM UTC (without access to the scale, but with some ideas to your questions) or Sunday same time or a bit later (with access to the scale). |
Are you running with sudo? If not, try your command with sudo before |
@pplucky beat me to it on the "sudo" ;) With regards to the discord chat. I'm not sure I can do tonight. If not will look at Sunday if possible. |
I'll check discord tonight and on Sunday then ;-) |
Ya I forgot that sudo avoid permission... Now works and I think i should be properly |
As discussed with @lolouk44 on discord, script is reading the current/last weight and only works in the 5/10 minutes after you have weighed yourself in the scale (same as Xiaomi Mi Fit app). After that it goes to deep sleep and cannot be found by script (or the app). Script also only works if impedance has been determined properly during the weight process (socks not allowed). Using the standard script on this device, I got the following: Still then, the corresponding readings in Mi Fit are not the same: |
Thanks for the feedback @pplucky . |
Agree to close. |
@pplucky could you give me your discord name? I wanna ask about something :) |
|
The body metrics classes has last been updated one month ago, based on the latest version of amazfir/mi fit, so i'm pretty sure it's calculations are up to date, as long as you've been keeping your fork up to date as well (which doesn't seems to be the case), especially based on the very slow release cycle of the holtek's SDK (which AFAIK hasn't been updated since some months). The current version of the body metrics classes has all the same informations the mi fit app has, the only differences being that mi fit rounds the floats. This only apply to the "old" MIBCS though, not the new glass one, as huami may have changed parts and/or SDK with this new model. |
Thanks @prototux for the comments. Anyway thanks for letting me know you've updated the formulas, I'll have a look at your repo and will look to integrate it in "my" script |
Hey Guys, some of you thinkng to present this data in some graphical way? Or do you have some ideas? |
AFAIK, there's no real standard as to how to represent the impedance, and a set of formulas to apply to such impedance, so, basically, what i've seen is that every scale OEM (or more precisely, the companies that makes ASICs for such scales) basically does "whatever they want" and most doesn't even really uses the most used formulas (for example, the mi fit app only does a reverse of the BMI calculation, to get your "ideal weight" even if it's not how "ideal weight" are usually calculated), but well, even the various specialists doesn't seems to agree on standard values so... The most problematic thing would be that they (xiaomi/holtek) obviously made their models for chinese people, and added a generic model for western people as a afterthough, so, we get a simpler and less precise model, especially as basically western here means "anybody that doesn't speak mandarin" (as even say, an indian, would get the "western model" only because he set his phone language to something other than mandarin). That is especially true for kids (as some formulas are quite precise for chinese people, with something like 5 models depending on the age, where non-chinese kids get the same model from 5 to 18). Anyway, these scales are only here to give some tendencies, not precise values, so it's good enough for that purpose, i think. |
My Mi Body Composition Scale show in lescan as MIBFS and it is shown as 'Mi Body Composition Scale 2' (Model # XMTZC05HM).
When I ran wrapper.sh with sudo, I got the following error:
Traceback (most recent call last):
File "/home/pi/xiaomi_mi_scale/Xiaomi_Scale.py", line 183, in
main()
File "/home/pi/xiaomi_mi_scale/Xiaomi_Scale.py", line 180, in main
devices = scanner.scan(5)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 853, in scan
self.process(timeout)
File "/usr/local/lib/python3.7/dist-packages/bluepy/btle.py", line 842, in process
self.delegate.handleDiscovery(dev, (dev.updateCount <= 1), isNewData)
File "/home/pi/xiaomi_mi_scale/Xiaomi_Scale.py", line 113, in handleDiscovery
self._publish(round(measured, 2), unit, str(mitdatetime), miimpedance)
File "/home/pi/xiaomi_mi_scale/Xiaomi_Scale.py", line 153, in _publish
lib = Xiaomi_Scale_Body_Metrics.bodyMetrics(weight, height, age, sex, 0)
File "/home/pi/xiaomi_mi_scale/Xiaomi_Scale_Body_Metrics.py", line 17, in init
raise Exception("Weight is either too low or too high (limits: <10kg and >200kg)")
Exception: Weight is either too low or too high (limits: <10kg and >200kg)
If anyone is willing to guide me on testing it properly to add support to it, it would be great!
Thanks in advance.
The text was updated successfully, but these errors were encountered: