How dckiller51/bodymiscale works
Bodymiscale is a local Home Assistant integration that turns configured weight and optional impedance readings into body-composition sensor entities. The main path is configuration and profile selection, live measurement handling, mode-specific calculations, then sensor publication. The README also documents three calculation modes and interactive profile assignment. Some modules are only partially sampled, so uncertain internal call paths are omitted; unsampled capabilities are represented only where the tree or README supports them.
Main entry points: metrics/__init__.py Metrics handler · bodymiscale/__init__.py Integration lifecycle · sensor.py Metric sensors · profile.py Profile matching
Components 16
Setup & Profiles
- Integration setup
custom_components/bodymiscale/config_flow.py - Profile matching
custom_components/bodymiscale/profile.py - Integration lifecycle
custom_components/bodymiscale/__init__.py
Measurement Runtime
- Metrics handler
custom_components/bodymiscale/metrics/__init__.py - Metric definitions
custom_components/bodymiscale/models.py
Calculation Engines
- Weight metrics
custom_components/bodymiscale/metrics/weight.py - Impedance metrics
custom_components/bodymiscale/metrics/impedance.py - Body score
custom_components/bodymiscale/metrics/body_score.py - Reference scales
custom_components/bodymiscale/metrics/scale.py - Formula utilities
custom_components/bodymiscale/util.py
Home Assistant Entities
- Metric sensors
custom_components/bodymiscale/sensor.py - Entity base
custom_components/bodymiscale/entity.py
Other components
- Home Assistant user
- Home Assistant
- Scale sensors
- Notify service
Connections 18
- Home Assistant user → Integration setup: configures
- Integration setup → Integration lifecycle: provides settings
- Home Assistant → Integration lifecycle: loads integration
- Integration lifecycle → Metrics handler: creates handler
- Integration lifecycle → Profile matching: registers filter
- Scale sensors → Metrics handler: reports readings
- Metrics handler → Profile matching: checks profile
- Metrics handler → Weight metrics: calculates weight metrics
- Metrics handler → Impedance metrics: calculates impedance metrics
- Metrics handler → Body score: calculates score
- Metrics handler → Metric definitions: uses metric types
- Weight metrics → Formula utilities: uses formulas
- Impedance metrics → Formula utilities: uses constraints
- Body score → Reference scales: uses thresholds
- Metric sensors → Metrics handler: subscribes to metrics
- Metric sensors → Entity base: extends entity base
- Home Assistant → Metric sensors: hosts sensors
- Profile matching → Notify service: sends selection prompt