### Basic sync configuration example Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration file showing how to sync data from Fitbit, Zepp, and Mi Fitness to Garmin, with optional expressions to filter or modify data. ```yaml sync_alex_fitbit: from: fitbit AlexMyFitbitData.zip to: garmin alex@gmail.com garmin-password sync_alex_zepp: from: zepp/xiaomi alex@gmail.com xiaomi-password to: garmin alex@gmail.com garmin-password expr: Weight: 'BodyFat == 0 || Date >= date("2024-11-25") ? 0 : Weight' sync_alex_mifitness: from: mifitness alex@gmail.com xiaomi-password to: garmin alex@gmail.com garmin-password expr: Weight: 'BodyFat == 0 ? 0 : Weight' BodyFat: 'Date >= date("2025-04-01") && Source == "blt.3.1abcdefabcd00" ? 0 : BodyFat' ``` -------------------------------- ### CSV sync examples (file, HTTP, stdout) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Examples of using CSV as source or destination, including file, HTTP link, and stdout. HTTP links are downloaded via GET and uploaded via POST. ```yaml sync_from_file: from: csv source.csv sync_from_http: from: csv http://192.168.1.123/source.csv sync_to_file: to: csv destination.csv sync_to_http: to: csv http://192.168.1.123:8123/api/webhook/594b7e73-1f0f-4c3c-aded-eeaee78a6790 sync_to_stdout: to: csv stdout ``` -------------------------------- ### Get data from specific scales (all users) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to get data of all users from specific scales using the Mi Fitness app. ```yaml sync_mifitness: from: mifitness {username} {password} {scales model} to: csv all_users_mifitness.csv ``` -------------------------------- ### YAML source examples (single and multiple records) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Examples of passing weighting data directly in YAML config, useful for integration with other software like Home Assistant. Shows both single and multiple records. ```yaml sync_one_yaml: from: Weight: 65.0 BMI: 21.0 BodyFat: 10.0 to: garmin {username} {password} sync_many_yaml: from: - Data: '2025-08-01T09:00:00Z' Weight: 65.0 - Data: '2025-08-02T09:00:00Z' Weight: 66.0 to: zepp/xiaomi {username} {password} ``` -------------------------------- ### Get data from Mi Fitness (main user, other region) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to get data from all scales of the main user in other regions (e.g., de, i2, ru, sg, us). ```yaml sync_mifitness: from: mifitness {username} {password} {region} to: csv alex_mifitness_region.csv ``` -------------------------------- ### Sync from Picooc (main user) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync data from all scales of the main user via Picooc. ```yaml sync_picooc: from: picooc {username} {password} to: csv alex_picooc.csv ``` -------------------------------- ### Get data from Mi Fitness (main user, China region) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to get data from all scales of the main user in the China region using the Mi Fitness app. ```yaml sync_mifitness: from: mifitness {username} {password} to: csv alex_mifitness.csv ``` -------------------------------- ### Sync from Picooc (selected user) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync data from all scales of a selected user via Picooc. ```yaml sync_picooc: from: picooc {username} {password} {user} to: csv alex_picooc.csv ``` -------------------------------- ### Sync from My TANINA Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync data from My TANINA. Note: weighing time is stored with an unknown time zone and may be incorrect. ```yaml sync_tanita: from: tanita {username} {password} to: csv alex_tanita.csv ``` -------------------------------- ### Get data from specific scales with user filter Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to get data from specific scales and filter by username using an expression. ```yaml sync_yulia_mifitness: from: mifitness alex@gmail.com xiaomi-password yunmai.scales.ms103 to: csv yulia_mifitness.csv expr: Weight: 'User == "Yulia" ? Weight : 0' ``` -------------------------------- ### Sync from Zepp Life (selected user) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync data from all scales of a selected user via Zepp Life. Requires username, password, and user identifier. ```yaml sync_zepp: from: zepp/xiaomi {username} {password} {user} to: csv alex_zepp.csv ``` -------------------------------- ### Mi Body Composition Scale 2 (XMTZC05HM) Data Example Source: https://github.com/alexxit/smartscaleconnect/blob/master/pkg/zepp/README.md Example data structure returned by the Mi Body Composition Scale 2 (XMTZC05HM). Contains body metrics such as weight, BMI, body fat rate, muscle mass, and impedance values. ```json5 { "bmi": 21.8, "bodyScore": 89, "bodyStyle": 5, "bodyWaterRate": 56.92887, "boneMass": 2.7305484, "deviceType": 1, "encryptImpedance": "451", "fatRate": 17.01331, "height": 172.0, "impedance": 451, "metabolism": 1358.0, "muscleAge": 25, "muscleRate": 50.961838, "proteinRatio": 21.837502, "source": 1, "standBodyWeight": 64.4, "visceralFat": 9.0, "weight": 64.7 } ``` -------------------------------- ### Sync from Xiaomi Home (specific user) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync data for a specific user from Xiaomi Home, filtering by user name. Uses the 'expr' field to zero out weights for other users. ```yaml sync_yulia_xiaomihome: from: xiaomihome alex@gmail.com xiaomi-password ru yunmai.scales.ms104 to: csv yulia_xiaomihome.csv expr: Weight: 'User == "Yulia" ? Weight : 0' ``` -------------------------------- ### Download data from Garmin to CSV Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to download data from Garmin Connect to a CSV file. ```yaml sync_garmin: from: garmin {username} {password} to: csv alex_garmin.csv ``` -------------------------------- ### Xiaomi Eight Electrode Body Composition Scale (XMTZC01YM) Data Example Source: https://github.com/alexxit/smartscaleconnect/blob/master/pkg/xiaomi/README.md Example JSON5 data structure returned by the Xiaomi Eight Electrode Body Composition Scale (XMTZC01YM). Includes additional limb-specific metrics like left/right limb fat and muscle mass, trunk measurements, and recommended calorie intake. ```json5 { "basal_metabolism": 1632, "bmi": 22.4, "body_age": 34, "body_fat_rate": 12, "body_moisture_mass": 43.4, "body_score": 90, "body_shape": 4, "bone_mass": 3.2, "bone_rate": 4.8, "bpm": 81, "fat_control": 2.8, "fat_mass": 8, "left_lower_limb_fat_mass": 1.4, "left_lower_limb_fat_rank": 0, "left_lower_limb_muscle_mass": 9.1, "left_lower_limb_muscle_rank": 0, "left_upper_limb_fat_mass": 0.4, "left_upper_limb_fat_rank": -1, "left_upper_limb_muscle_mass": 3.2, "left_upper_limb_muscle_rank": 0, "limbs_fat_balance": 1, "limbs_muscle_balance": 0, "limbs_skeletal_muscle_index": 8.3, "lower_limb_fat_balance": 0, "lower_limb_muscle_balance": 0, "moisture_rate": 65.3, "muscle_control": -5.4, "muscle_mass": 55.2, "muscle_rate": 83.1, "protein_mass": 11.8, "protein_rate": 17.8, "recommended_calories_intake": 2366, "right_lower_limb_fat_mass": 1.4, "right_lower_limb_fat_rank": 0, "right_lower_limb_muscle_mass": 9.2, "right_lower_limb_muscle_rank": 0, "right_upper_limb_fat_mass": 0.4, "right_upper_limb_fat_rank": -1, "right_upper_limb_muscle_mass": 3.2, "right_upper_limb_muscle_rank": 0, "somatotype": 1, "standard_weight": 63, "standard_weight_v2": 63.7, "time": 1743935472, "trunk_fat_mass": 4, "trunk_fat_rank": 0, "trunk_muscle_mass": 25.1, "trunk_muscle_rank": 0, "upper_limb_fat_balance": 0, "upper_limb_muscle_balance": 0, "visceral_fat": 3, "weight": 66.4, "weight_control": -2.6, "whr": 0.8 } ``` -------------------------------- ### Mi Body Composition Scale S400 (MJTZC01YM) Data Example Source: https://github.com/alexxit/smartscaleconnect/blob/master/pkg/xiaomi/README.md Example JSON5 data structure returned by the Mi Body Composition Scale S400 (MJTZC01YM). Includes metrics like basal metabolism, BMI, body fat rate, muscle mass, and weight. ```json5 { "basal_metabolism": 1582, "bmi": 23.6, "body_age": 36, "body_fat_rate": 19.6, "body_moisture_mass": 35.5, "body_score": 82, "bone_mass": 2.8, "bone_rate": 4.0, "bpm": 62, "fat_control": -4.0, "fat_free_body": 56.1, "fat_mass": 13.7, "moisture_rate": 51.0, "muscle_control": -1.4, "muscle_mass": 53.3, "muscle_rate": 76.4, "protein_mass": 17.2, "protein_rate": 24.6, "score_standard_type": 1, "skeletal_muscle_mass": 24.2, "somatotype": 0, "standard_weight": 64, "standard_weight_v2": 64.4, "time": 1732550224, "visceral_fat": 11.0, "weight": 69.8, "weight_control": -5.4, "whr": 1.2 } ``` -------------------------------- ### Sync to Zepp Life from config Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to send data to Zepp Life from a config file. Data must include Weight, BodyFat, BodyScore, and Height for advanced view; otherwise only Weight is displayed. ```yaml sync_zepp: from: Weight: 64.30 BodyFat: 10.0 BodyScore: 85 Height: 172 to: zepp/xiaomi {username} {password} ``` -------------------------------- ### Sync from Xiaomi Home (all users) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync all users' data from a Xiaomi Home scale. Requires username, password, region (e.g., 'de', 'i2', 'ru', 'sg', 'us'), and scale model. Tested on Mi Body Composition Scale S400 EU (MJTZC01YM, yunmai.scales.ms104). ```yaml sync_xiaomihome: from: xiaomihome {username} {password} {region} {scales model} to: csv all_users_xiaomihome.csv ``` -------------------------------- ### Shell command for Docker or venv sync Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md For Docker or venv installations, download the binary to /config and make it executable. This shell_command invokes the binary with a JSON config passed via -c. ```yaml shell_command: scale_sync: >- /config/scaleconnect -c '{{ { "sync_garmin": { "from": { "Weight": states("sensor.mi_body_composition_scale_mass")|float, }, "to": "garmin {username} {password}" } }|tojson }}' ``` -------------------------------- ### Sync from Zepp Life (main user) Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to sync data from all scales of the main user via Zepp Life. Requires Xiaomi account login. Note: syncing logs you out of the mobile app. ```yaml sync_zepp: from: zepp/xiaomi {username} {password} to: csv alex_zepp.csv ``` -------------------------------- ### Upload data to Garmin from CSV Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to upload data from a CSV file to Garmin Connect. Useful for importing custom manual data. ```yaml sync_garmin: from: csv alex_garmin.csv to: garmin {username} {password} ``` -------------------------------- ### Sync from Fitbit archive Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Example configuration to retrieve data from a Fitbit data export archive (ZIP file). Note: Fitbit service is being discontinued; data must be downloaded by February 2, 2026. ```yaml sync_fitbit: from: fitbit MyFitbitData.zip to: csv alex_fitbit.csv ``` -------------------------------- ### Configure sync_expr with expr for all measurement parameters Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Defines a sync_expr.expr block that maps each measurement parameter to an expr expression. Use this to adjust weighing time, apply conditions, or use mathematical formulas on any parameter. The example shows default passthroughs and sample transformations for Date, Weight, BMI, BodyFat, and Source. ```yaml sync_expr: expr: Date: 'Date - duration("1h")' # string RFC 3339, you can adjust the weighing time Weight: 'Weight > 60 ? 0 : Weight' # float kg, you can use conditions BMI: 'BMI * 0.95' # float index, mathematical formulas can be used BodyFat: 'BodyFat - 5.0' # float percent, mathematical formulas can be used BodyWater: 'BodyWater' # float percent BoneMass: 'BoneMass' # float kg MetabolicAge: 'MetabolicAge' # int years MuscleMass: 'MuscleMass' # float kg PhysiqueRating: 'PhysiqueRating' # int index, from 1 to 9 ProteinMass: 'ProteinMass' # float kg VisceralFat: 'VisceralFat' # int index, from 1 to 59 BasalMetabolism: 'BasalMetabolism' # int kcal BodyScore: 'BodyScore' # int index, from 1 to 100 HeartRate: 'HeartRate' # int bpm Height: 'Height' # float cm SkeletalMuscleMass: 'SkeletalMuscleMass' # float kg User: 'User' # string Source: 'Source + " some other text"' # string, adding custom text information ``` -------------------------------- ### scaleconnect.yaml sync configuration Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Add this to scaleconnect.yaml to sync from Mi Fitness to a Home Assistant webhook. Replace the credentials and webhook URL with your own. ```yaml sync_hass: from: mifitness alex@gmail.com xiaomi-password to: json/latest http://192.168.1.123:8123/api/webhook/594b7e73-1f0f-4c3c-aded-eeaee78a6790 ``` -------------------------------- ### Call hassio.addon_stdin with scaleconnect config Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Use this YAML to trigger a sync from Home Assistant to Garmin via the add-on. The 'input' field must contain the sync configuration with 'sync_garmin' as the sync name. Templates are allowed in the 'from' values. ```yaml action: hassio.addon_stdin data: addon: a889bffc_scaleconnect # addon ID input: sync_garmin: # sync name (use any) from: Weight: '{{ states("sensor.mi_body_composition_scale_mass")|float }}' # you can use templates BMI: 21.0 BodyFat: 10.0 to: garmin {username} {password} ``` -------------------------------- ### Run SmartScaleConnect with inline config Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Sends configuration content directly via the -c option and receives the response to stdout. The config is a JSON object with a sync1 key mapping a Garmin source to a JSON stdout destination. ```shell ./scaleconnect -c '{"sync1":{"from":"garmin alex@gmail.com garmin-password","to":"json stdout"}}' ``` -------------------------------- ### Handle multiple scales and ignore old data in sync_alex_mifitness Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Use this sync_alex_mifitness.expr block when using both a new Xiaomi 8-Electrode Scale and an old Xiaomi S400. It ignores weighings without fat information and zeroes out BodyFat from the old scale (identified by its Source) on or after 2025-04-01, while keeping Weight from the old scale. ```yaml sync_alex_mifitness: expr: Weight: 'BodyFat == 0 ? 0 : Weight' # ignore weighing without fat information BodyFat: 'Date >= date("2025-04-01") && Source == "blt.3.1abcdefabcd00" ? 0 : BodyFat' # zero body fat from old scales ``` -------------------------------- ### Define input_number entities for weight and BMI Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Add these input_number entities to configuration.yaml to store weight and BMI values. Adjust min/max and entity IDs as needed. ```yaml input_number: alex_weight: name: Alex Weight min: 50 max: 80 unit_of_measurement: kg icon: mdi:weight alex_bmi: name: Alex BMI min: 15 max: 30 ``` -------------------------------- ### Filter data by date and fat information in sync_alex_zepp Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Use this sync_alex_zepp.expr block to stop syncing data from Zepp after a certain date and to ignore weighings without fat information. The Weight expression returns 0 when BodyFat is 0 or the date is on or after 2024-11-25. ```yaml sync_alex_zepp: expr: Weight: 'BodyFat == 0 || Date >= date("2024-11-25") ? 0 : Weight' ``` -------------------------------- ### POST /api/webhook/{webhook_id} Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Home Assistant webhook endpoint that receives scale data from SmartScaleConnect and triggers automations to update input_number entities. ```APIDOC ## [POST] /api/webhook/{webhook_id} ### Description Webhook endpoint that receives scale data from SmartScaleConnect and triggers Home Assistant automations to update input_number entities. ### Method POST ### Endpoint /api/webhook/{webhook_id} ### Parameters #### Path Parameters - **webhook_id** (string) - Required - The unique webhook ID configured in the automation (e.g., "594b7e73-1f0f-4c3c-aded-eeaee78a6790"). #### Request Body - **Weight** (number) - Required - The weight value from the scale. - **BMI** (number) - Optional - The BMI value from the scale. - **BodyFat** (number) - Optional - The body fat percentage from the scale. ### Request Example { "Weight": 75.5, "BMI": 23.1, "BodyFat": 18.2 } ### Response #### Success Response (200) - **status** (string) - "success" or similar confirmation. #### Response Example { "status": "success" } ``` -------------------------------- ### Webhook automation to receive scale data Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md This automation listens for a webhook POST and updates the input_number entities. Replace the webhook_id and entity IDs. The persistent_notification is for testing only. ```yaml alias: Weight Data triggers: - trigger: webhook allowed_methods: [ POST ] local_only: true webhook_id: "594b7e73-1f0f-4c3c-aded-eeaee78a6790" # change to random conditions: [] actions: - action: persistent_notification.create data: message: "{{ trigger.json }}" # only for tests - action: input_number.set_value data: value: "{{ trigger.json.Weight|round(2) }}" target: entity_id: input_number.alex_weight # change here - action: input_number.set_value data: value: "{{ trigger.json.BMI|round(2) }}" target: entity_id: input_number.alex_bmi # change here mode: single ``` -------------------------------- ### Replace SkeletalMuscleMass with MuscleMass in sync_expr Source: https://github.com/alexxit/smartscaleconnect/blob/master/README.md Use this sync_expr.expr block to make Garmin display the MuscleMass value instead of SkeletalMuscleMass. This is useful when your scale measures MuscleMass but not SkeletalMuscleMass. ```yaml sync_expr: expr: SkeletalMuscleMass: 'MuscleMass' # replace the skeletal mass data with a regular mass ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.