With this Home Assistant integration, track your body composition closely using data from your weight sensor. You will get detailed information for accurate tracking.
How it works
BodyMiScale calculates advanced body composition metrics based on your scale's data (Weight and/or Impedance). Unlike simple calculators, it offers three distinct calculation engines tailored to your hardware and preferences:
- Xiaomi Mode: Faithful to the original 2017 algorithms for consistency with legacy apps (Zepp Life/Mi Fit).
- Science Mode: Uses international health standards like Schofield (WHO) for BMR and Pace & Rathbun for body water.
- S400 Mode: A clinical-grade dual-frequency engine (50/250 kHz) utilizing Deurenberg and Janssen models for precise compartmental analysis.
Here's a breakdown of the process:
-
Data Input: Bodymiscale relies on data provided by your configured weight sensor (Weight and optionally Impedance). This can be a
sensoror aninput_numberentity. -
Smart Calculation Engine: Depending on your configuration, Bodymiscale applies one of three scientific models:
- Xiaomi Mode: Uses the original 2017 algorithms for consistency with Zepp Life.
- Science Mode: Uses international standards like Schofield (WHO) and Pace (0.73).
- S400 Mode: Automatically activated for dual-frequency data, using Deurenberg and Janssen models.
-
Validation & Constraints: The engine checks for physiological consistency (e.g., ensuring water doesn't exceed 73% in Science/S400 modes) and filters out aberrant values.
-
Output: The calculated metrics are generated as new
sensorentities in Home Assistant. These are ready to use in your dashboards, automations, or with the dedicated Lovelace Card.
Key Considerations:
- Accuracy: The accuracy of the calculated metrics depends heavily on the accuracy of your weight and (if used) impedance measurements. Ensure your sensors are calibrated and providing reliable data.
- No External Services: Bodymiscale performs all calculations locally within your Home Assistant instance. No data is sent to external services or the internet.
Example:
Let's say you've configured a weight sensor called sensor.my_weight. When you add the Bodymiscale integration, it will:
- Read the current value of
sensor.my_weight. - Use this value (along with other information like age and gender you provided during configuration) to calculate your BMI, BMR, etc.
- Create new sensors like
sensor.myname_bmi,sensor.myname_bmr, etc., containing these calculated values.
Before installing Bodymiscale, ensure you have the following:
-
A weight sensor in Home Assistant: There is no relationship between Bodymiscale and a specific connected scale. Bodymiscale works with any weight sensor integrated into Home Assistant.
New in v2026.5.x: You can now point Bodymiscale directly at your scale's native weight and impedance sensors — no per-user dedicated sensors required. Bodymiscale handles user identification automatically through one of the methods described in the Configuration section (interactive notification, weight range, nearest current weight, or profile ID).
If you prefer the traditional approach or need data persistence across restarts, an
input_numberentity remains a robust alternative: its value survives a Home Assistant restart, ensuring Bodymiscale always initialises with a valid weight. -
Home Assistant installed.
(Optional) Impedance sensor:
If you plan to use an impedance sensor for advanced metrics (lean body mass, body fat mass, etc.), make sure an impedance sensor is available in Home Assistant. Since v2026.5.x, the scale's own impedance sensor can be shared across profiles — Bodymiscale assigns the measurement to the correct user automatically.
(Optional) Last weigh-in sensor:
If you plan to integrate your own last weigh-in sensor, make sure a dedicated sensor is properly configured in Home Assistant.
(Optional) Last measurement time sensor: Previously mandatory for accurate history, this is now optional. Bodymiscale automatically generates a timestamp based on Home Assistant's internal clock whenever a weight change is detected. If you provide a dedicated sensor, Bodymiscale will prioritise that "real" measurement time over the system time.
Bodymiscale calculates the following metrics. Note that some advanced parameters require an impedance sensor, and clinical-grade multi-compartment metrics are exclusive to dual-frequency hardware (e.g., Xiaomi S400).
| Data | Description | Sensor / Mode Required |
|---|---|---|
| Weight | Measured weight | Weight |
| Height | User height | Config |
| Age | User age | Config |
| BMI | Body Mass Index (Standard) | Weight |
| Basal Metabolism (BMR) | Calories burned at rest (Schofield/Katch-McArdle) | Weight / LBM |
| Visceral Fat | Fat around organs (Zepp Life / S400 Corrected) | Weight / ECW Ratio |
| Ideal Weight | Recommended weight based on height/age | Config |
| BMI Category | Underweight to Obesity classification | Weight |
| Lean Body Mass (LBM) | Body mass without fat | Impedance |
| Body Fat Mass | Total body fat mass | Impedance |
| Water (TBW) | Total Body Water percentage | Impedance |
| Bone Mass | Bone mineral content estimation | Impedance |
| Muscle Mass | Total muscle mass (including organs) | Impedance |
| Protein | Percentage of protein in the body | Impedance |
| ECW | Extracellular Water (L) | Dual-frequency (S400) |
| ICW | Intracellular Water (L) | Dual-frequency (S400) |
| ECW/TBW Ratio | Hydration & Inflammation status | Dual-frequency (S400) |
| BCM | Body Cell Mass (Active Tissue) | Dual-frequency (S400) |
| Skeletal Muscle | Actual SMM (validated via MRI) | Dual-frequency (S400) |
ℹ️ Dual-frequency metrics: These require a scale capable of measuring impedance at multiple frequencies (50 kHz and 250 kHz). They offer a deeper look into your cellular health and hydration levels.
Bodymiscale allows you to choose between three calculation levels. The formulas used depend on your hardware and the selected calculation mode.
The original algorithm based on the 2017 Mi Fit ecosystem (reverse-engineered).
- With Impedance: Calculates full body composition based on original Xiaomi regression formulas.
- Best for: Maintaining 1:1 consistency with historical Mi Scale, Zepp Life, or Mi Fit data.
Modern physiological equations for higher precision, recommended for active profiles.
Uses standardized anthropometric equations:
- BMR (Basal Metabolic Rate): Uses the Schofield Equation (official WHO standard).
- BMI & Ideal Weight: Calculated using the Devine Formula, adjusted for modern height/weight ratios.
Switches to advanced bioelectrical impedance analysis (BIA) models:
- Lean Body Mass (LBM): Uses clinically validated equations to calculate non-fat tissue.
- Water & Protein: Derived from LBM using standardized physiological constants (Pace 73% for hydration and Wang 19.5% for proteins).
Exclusive to dual-frequency hardware capable of measuring impedance at 50 kHz and 250 kHz.
- Advanced BIA Models: Implements a hardware-calibrated baseline for LBM, combined with clinical models like Deurenberg (1995) for multi-frequency water analysis, and Janssen (2000) for skeletal muscle.
- BMR (Basal Metabolic Rate): Uses the Schofield Equation (official WHO standard), which accounts for age, weight, height, and gender using age-stratified coefficients recommended by the Food and Agriculture Organization (FAO/WHO/UNU 1985).
- Visceral Fat: Standard Zepp Life base estimate.
- Exclusive Metrics: Unlocks 5 clinical metrics: Extracellular Water (ECW), Intracellular Water (ICW), ECW/TBW Ratio, Body Cell Mass (BCM), and MRI-validated Skeletal Muscle Mass (SMM).
💡 Deep Dive: For a full breakdown of the clinical formulas and scientific references (Sun, Janssen, Deurenberg, Wang, etc.), see the Advanced Metrics Documentation.
Note: The results of these modes will differ. Scientific and S400 modes are recommended for users looking for clinical-grade estimations, while Xiaomi Legacy is best for those tracking progress against years of historical scale data.
- Open HACS in Home Assistant.
- Go to the "Integrations" tab.
- Search for "Bodymiscale".
- Click "Install".
- Download the latest version archive from the releases page.
- Unzip the archive.
- Copy the entire
custom_components/bodymiscalefolder into yourconfig/custom_componentsfolder in Home Assistant. The final path should be/config/custom_components/bodymiscale. - Restart Home Assistant.
- Open Home Assistant and go to "Settings" -> "Devices & Services" -> "Add Integration".
- Search for "Bodymiscale".
- Personalize your integration:
- First Name (or other identifier): Enter your first name or another identifier. Important: This identifier will determine the name of your Bodymiscale component in Home Assistant, as well as the names of all sensors created by it. Choose a clear and relevant name.
- Date of Birth: Enter your date of birth in YYYY-MM-DD format.
- Calculation Mode: Choose between Xiaomi (Legacy 2017) or Scientific. The Scientific mode (added in v2026.4.0) provides a more granular approach to body composition for specific profiles.
S400 users: The S400 dual-frequency engine is activated automatically when you configure two impedance sensors (
impedance_low+impedance_high) and selectDual-frequency S400as theimpedance_mode. It uses its own dedicated clinical formulas regardless of thecalculation_modesetting. - Gender: Select your gender (Male/Female).
- User identification method (new in v2026.5.x): Choose how Bodymiscale determines which user to assign a measurement to when using the scale's native sensors:
- Weight range: Each user is assigned a weight interval (e.g. 60–75 kg). Bodymiscale routes the measurement automatically.
- Nearest current weight: Bodymiscale assigns the measurement to the user whose last known weight is closest to the measured value. A configurable tolerance window (default ±5 kg) ensures the measurement is rejected if no user is close enough. An initial weight must be provided at setup so the filter is operational from the very first weighing.
- Interactive push notification: After each weighing, a notification is sent to a chosen mobile device. The user taps their name to confirm the measurement.
- Profile ID: For recent scales (e.g. Xiaomi S400 via Xiaomi Home) that broadcast a user slot ID — Bodymiscale matches it directly with no extra step.
- None — manual assignment: No automatic identification. Use this if each person still has their own dedicated sensors.
- Select your weight sensor: Choose the existing weight sensor in Home Assistant (e.g., a
sensor, or aninput_number). Since v2026.5.x, you can select the scale's shared native sensor directly. If you prefer data persistence across restarts, aninput_numberentity is still a solid choice. - Impedance sensor (optional): If you have an impedance sensor, select it here. Since v2026.5.x, the scale's own sensor can be shared across profiles. This sensor is required to calculate advanced metrics (lean body mass, body fat mass, etc.).
- Last measurement time sensor (optional):
If you have a last weigh-in sensor, select it here (e.g., a
sensor, or aninput_datetime). This sensor is used to record the date and time of the most recent measurement. - Click "Save".
Explanation of choices:
- First Name/Identifier: This field is important because it allows you to personalise the integration and avoid conflicts if multiple people use Bodymiscale in your home. The name you choose will be used to name the entities created by the integration (e.g.,
sensor.firstname_weight,sensor.firstname_bmi, etc.). - Date of Birth and Gender: This information is needed to calculate some metrics, such as basal metabolism.
- User identification method: Since v2026.5.x, Bodymiscale can share the scale's native sensors across multiple profiles and route each measurement to the right user automatically — no per-user dedicated sensors needed. The
nearest_weightmethod is a good fit for households where each person's weight is sufficiently distinct and stable.
Tips:
- If you do not have an impedance sensor, some metrics will not be available. You can still use Bodymiscale to get basic information (weight, BMI, etc.).
- If you are migrating from a setup with per-user dedicated sensors, you can keep your existing
input_numberentities and select None — manual assignment as the identification method to preserve your current workflow.
- Why are some values missing? You must have an impedance sensor configured for Bodymiscale to calculate metrics like Lean Body Mass, Body Fat Mass, and advanced S400 data.
- How accurate is the data? Bodymiscale uses peer-reviewed scientific formulas (Scientific/S400 modes) or original Xiaomi constants (Legacy). However, accuracy depends heavily on your scale's sensors and consistent measurement conditions.
Since v2026.5.x, multi-user management no longer requires per-user dedicated sensors. Bodymiscale assigns measurements to the correct profile using the identification method configured for each user (weight range, nearest current weight, interactive notification, or profile ID).
For detailed configuration examples, please refer to the example_config README.
This folder includes:
esphome_configuration.yaml: Complete ESPHome setup for Xiaomi Mi Scales.weight_impedance_update.yaml: HA configuration to generate sensors via ESPHome or BLE Monitor.interactive_notification_user_selection_weight_data_update.yaml: Automation blueprint for user selection via interactive notifications.
Bodymiscale is NOT a medical device.
- Informational Purpose Only: The metrics calculated by this integration (BMI, BMR, Body Fat, Visceral Fat, etc.) are estimations based on mathematical formulas and bioelectrical impedance analysis. They are provided for personal tracking and educational purposes only.
- Not Medical Advice: The data generated by Bodymiscale should not be used to diagnose, treat, or prevent any medical condition. Always seek the advice of a physician or other qualified health provider with any questions you may have regarding a medical condition.
- Accuracy: While Bodymiscale uses peer-reviewed scientific formulas, results may vary based on sensor quality and individual physiological differences. Do not make significant changes to your diet or exercise routine based solely on these metrics.
- No Liability: The author of this integration is a developer, not a medical professional. By using this integration, you acknowledge that the author is not responsible for any health-related decisions made based on the provided data.