Skip to content

Commit

Permalink
Body metrics support
Browse files Browse the repository at this point in the history
  • Loading branch information
ronnnnnnnnnnnnn committed Oct 22, 2024
1 parent 03897b1 commit daa545c
Show file tree
Hide file tree
Showing 10 changed files with 681 additions and 198 deletions.
28 changes: 24 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,25 @@
# Etekcity Fitness Scale BLE Integration for Home Assistant

This custom integration allows you to connect your Etekcity Bluetooth Low Energy (BLE) fitness scale to Home Assistant. It provides real-time weight measurements directly in your Home Assistant instance, without requiring an internet connection or the VeSync app.
This custom integration allows you to connect your Etekcity Bluetooth Low Energy (BLE) fitness scale to Home Assistant. It provides real-time weight measurements and body composition metrics directly in your Home Assistant instance, without requiring an internet connection or the VeSync app.

## Features

- Automatic discovery of Etekcity BLE fitness scales
- Real-time weight measurements
- Customizable display units (kg, lb, st)
- Real-time weight and impedance measurements
- Optional body composition metrics calculation including:
- Body Mass Index (BMI)
- Body Fat Percentage
- Fat Free Weight
- Subcutaneous Fat Percentage
- Visceral Fat Value
- Body Water Percentage
- Basal Metabolic Rate
- Skeletal Muscle Percentage
- Muscle Mass
- Bone Mass
- Protein Percentage
- Metabolic Age
- Customizable display units (kg, lb)
- Direct Bluetooth communication (no internet or VeSync app required)

**Note:** Currently, only weight measurement is supported. Future updates may include support for impedance measurements and/or impedance-based body composition estimates.
Expand Down Expand Up @@ -35,7 +48,14 @@ This custom integration allows you to connect your Etekcity Bluetooth Low Energy
1. In Home Assistant, go to "Configuration" > "Integrations".
2. Click the "+" button to add a new integration.
3. Search for "Etekcity Fitness Scale BLE" and select it.
4. Follow the configuration steps to add your scale.
4. Follow the configuration steps:
- Choose your preferred unit system (Metric or Imperial)
- Optionally enable body composition metrics
- If body composition is enabled:
- Select your sex (Male/Female)
- Enter your birthdate
- Enter your height (in cm for Metric, or feet/inches for Imperial)


## Supported Devices

Expand Down
6 changes: 5 additions & 1 deletion custom_components/etekcity_fitness_scale_ble/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from __future__ import annotations

from bleak_retry_connector import close_stale_connections_by_address

from homeassistant.components import bluetooth
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import Platform
from homeassistant.core import HomeAssistant
Expand Down Expand Up @@ -34,6 +36,8 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
async def async_unload_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
"""Unload a config entry."""
if unload_ok := await hass.config_entries.async_unload_platforms(entry, PLATFORMS):
hass.data[DOMAIN].pop(entry.entry_id)
coordinator: ScaleDataUpdateCoordinator = hass.data[DOMAIN].pop(entry.entry_id)
await coordinator.async_stop()
bluetooth.async_rediscover_address(hass, coordinator.address)

return unload_ok
Loading

0 comments on commit daa545c

Please sign in to comment.