Closed Smandurlo closed 1 year ago
First checks (Work in Progress).
Message from scale
04 3E 24 02 01 00 01 B1 22 51 0B C1 DD 18 02 01 06 03 02 1B 18 10 16 1B 18 02 A6 E6 07 0C 13 0D 10 1C 5E 02 50 37 BC
Result with my local testing parser
{'non-stabilized weight': 70.8, 'weight unit': 'kg', 'weight removed': 1, 'stabilized': 1, 'type': 'Mi Scale V2', 'firmware': 'Mi Scale V2', 'mac': 'DDC10B5122B1', 'packet': '02a6e6070c130d101c5e025037', 'rssi': -68, 'data': True}
So, the parser should be fine.
Next step, testing why this doesn't show up in HA
Seems to be missing the impedance in the above parsed results, and not sure why 'stabilized': 1
, but 'non-stabilized weight'
. Could it be that non-stabilized is not being transferred to/registered in HA?
Just FYI
02a6e6070c130d101c5e025037
{"brand":"Xiaomi","model":"Mi_Body_Composition_Scale","model_id":"XMTZC02HM/XMTZC05HM","weighing_mode":"person","unit":"kg","weight":70.8,"impedance":606}
I made other measurements. I waited till the end when the scale is done. I have no idea if and why the impedance is missing.
EDIT: I checked with zepp life app and the app shows all the data (water, visceral fat, bmi and so on), so the impedance should be sent... Correct me if I am wrong
I made other measurements. I waited till the end when the scale is done. I have no idea if and why the impedance is missing.
I checked with zepp life app and the app shows all the data (water, visceral fat, bmi and so on), so the impedance should be sent... Correct me if I am wrong
No worries, nothing you did wrong. Was more for @Ernst79 as the parser needs to be adjusted to allow for the impedance to also be recognised.
ah, sorry @Smandurlo I totally missed this part of your question:
According with the documentation, it should be already moved to HA bluetooth integration, but the XMTZC02HM doesn't show up.
I thought it didn't work in BLE monitor, but you meant in the HA xiaomi-ble integration, my mistake.
It is correct that it doesn't show up in the Xiaomi-ble integration, as the MiScales use a different UUID. In BLE monitor, a different parser is used for MiScale. Most Xiaomi sensors use the MiBeacon format, with UUID FE95
, but the Xiaomi Scales use a different UUID and also have a different format to decode the data.
So, you will have to wait till the MiScale parser is converted to an official HA integration (or more likely, added to the Xiaomi-ble integration).
Wait, I am a bit lost... BLE monitor is your HACS integration and it is moving to HA Bluetooth integration, isn't it? What is Xiaomi-ble integration now? How should I use all my xiaomi sensors (plant and thermometer) and miscale with the new Bluetooth HA mesh?
I am sorry, I am a bit confused
Wait, I am a bit lost
No problem, I'll try to explain.
BLE monitor is your HACS integration and it is moving to HA Bluetooth integration, isn't it? What is Xiaomi-ble integration now?
Almost correct.
HA Bluetooth integration is the "master" Bluetooth integration that takes care of collecting the BLE data and forwarding it to a brand-specific integration that understands the format. Each brand has it's own way of decoding (parsing) the BLE data (bytes) into readable sensor data. So, for each brand, there will be an additional integration.
Xiaomi-ble is one of these brand-specific integrations, that receives the data from the Bluetooth integration. There are also integrations for other brands, like govee, bthome, etc. The Bluetooth integration will decide which info needs to go to what brand-specific integration (based on the UUID or manufacturer id in the BLE message).
BLE monitor is actually doing all in one, it does the data collecting, and has all the brand-specific parsers in it, see this folder. We are in the process of moving it into the above mentioned brand-specific integrations at the moment.
We did this move for (a large part of) the Xiaomi sensors that use the MiBeacon BLE format. However, we did not make the move yet for Xiaomi MiScale sensors (scales), as this is a different format.
The more detailed explanation,
95FE
to identify Xiaomi MiBeacon sensors, and than parses the raw data according to a certain format (MiBeacon) to readable sensor data.181D
or 181B
to identify MiScale sensors, and than parses the raw data according to a different format (MiScale) to readable dataThe last (MiScale) isn't done yet. Most likely, I will add that to the xiaomi-ble integration, such that you won't notice it as a user, that it is using a different format.
Hopefully, this makes it a bit more clear. If not, let me know.
Yes, very crystal clear now! Thank you very much :-) I will wait you move everything I would like to use into an official HA integration so I can use the Bluetooth mesh. I can survive without the scale 😂 thank you for your great work
Sensor Description
body scale
Additional information
I am using the HA bluetooth integration, not the BLE monitor addon. According with the documentation, it should be already moved to HA bluetooth integration, but the XMTZC02HM doesn't show up. I was not able to collect the BLE advertisement with the Home Assistant logger (since the bluetooth integration doesn't have the option to), so I use the HCIdump way.
Debian 11 with Plugable USB-BT4LE (BCM20702A0), bluez 5.66 with experimental and passive mode
BLE advertisements