Miscale2garmin Save

Mi Body Composition Scale 2 Garmin Connect

Project README

Mi Body Composition Scale 2 Garmin Connect

1. Introduction

2. Getting MAC address of Mi Body Composition Scale 2 / disable weigh small object

  • Install Zepp Life App on your mobile device, user manual: https://files.xiaomi-mi.com/files/smart_scales/smart_scales-EN.pdf;
  • Configure your scale with Zepp Life App on your mobile device (tested on Android 10-14);
  • Retrieve scale's MAC address from Zepp Life App (Profile > My devices > Mi Body Composition Scale 2);
  • Turn off weigh small object in Zepp Life App (Profile > My devices > Mi Body Composition Scale 2) for better measurement quality:

alt text

3. Setting correct date and time in Mi Body Composition Scale 2

  • Launch Zepp Life App, go to scale (Profile > My devices > Mi Body Composition Scale 2);
  • Start scale and select Clear data in App;
  • Take a new weight measurement with App, App should synchronize date and time (UTC);
  • Script import_data.sh detects time zone and includes this as a time offset;
  • If time is still not synchronized correctly, check NTP synchronization on server or change time offset in import_data.sh file (offset parameter);
  • You should also synchronize scale after replacing batteries;
  • Script import_data.sh detects same weighing done in less than 30 seconds (protection against duplicates);
  • Script import_data.sh have time difference detection of more than 20 minutes (between scale data and os).

4. How does this work

  • Synchronization diagram from Mi Body Composition Scale 2 to Garmin Connect:

alt text

4.1. BLE VERSION

  • After weighing, Mi Body Composition Scale 2 is active for 15 minutes on bluetooth transmission;
  • USB bluetooth adapter or internal module (tested with bluetooth versions 4.0/4.1 and 5.0/5.1/5.3) scans for BLE device every 1 minute for 10 seconds and queries scale for data;
  • Body weight and impedance data on server are appropriately processed by scripts;
  • Processed data are sent to Garmin Connect (MFA/2FA support);
  • Raw and calculated data from scale is backed up on server in backup.csv file;
  • backup.csv file can be imported e.g. for analysis into Excel.

Select your platform and go to instructions:

4.2. ESP32 VERSION

  • After weighing, Mi Body Composition Scale 2 is active for 15 minutes on bluetooth transmission;
  • ESP32 module operates in a deep sleep and wakes up every 7 minutes, scans for BLE device for 10 seconds and queries scale for data, process can be started immediately via reset button;
  • ESP32 module sends acquired data via MQTT protocol to MQTT broker installed on server;
  • Body weight and impedance data on server are appropriately processed by scripts;
  • Processed data are sent to Garmin Connect (MFA/2FA support);
  • Raw and calculated data from scale is backed up on server in backup.csv file;
  • backup.csv file can be imported e.g. for analysis into Excel.

Select your platform and go to instructions:

5. Mobile App

I don't plan to create a mobile app, but I encourage you to take advantage of another projects:

If you like my work, you can buy me a coffee

Buy Me A Coffee

Open Source Agenda is not affiliated with "Miscale2garmin" Project. README Source: RobertWojtowicz/miscale2garmin

Open Source Agenda Badge

Open Source Agenda Rating