Replies: 1 comment
-
|
Please see comment in home-assistant/android#4804 (comment) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the feature
Improve the Health Connect calorie sensors so that active calories are exposed as a reliable aggregated daily value, independent of basal metabolic rate (BMR) records written by other apps.
Currently, the calorie data read by the Android Companion App can become inconsistent when multiple health apps are connected to Health Connect.
In my setup, Xiaomi / Mi Fitness writes activity and active calories in blocks to Health Connect. Google Fit previously wrote Basal Metabolic Rate (BMR). Even after disabling Google Fit permissions, the old BMR value remains accessible through Health Connect.
Because of this, Home Assistant can unintentionally combine active calories from Xiaomi with stale BMR values written months earlier by another app. This makes "total calories burned" unreliable.
Additionally, active calories appear to be read as individual updates instead of a daily aggregate. Since Xiaomi writes activity data in blocks and background sync is not always immediate, Home Assistant can miss some updates unless the source app is manually opened.
Suggested improvements:
• Provide a sensor for aggregated daily active calories using the Health Connect aggregate API
• Allow optional data-origin filtering so users can choose the specific source app/device
• Separate clearly between:
• Avoid implicitly combining active calories with stale BMR records from unrelated apps
Use cases
I use Home Assistant as my main health dashboard.
My wearable (Xiaomi) provides active calories through Health Connect. I prefer calculating basal metabolic rate (BMR) and total energy expenditure inside Home Assistant using my own sensors and formulas.
The ideal model is:
Active calories -> from wearable
Basal metabolic rate -> calculated in Home Assistant
Total calories burned -> active + basal
This allows reliable calorie tracking and energy balance dashboards. However, this becomes difficult if stale BMR records from other apps influence the total calorie data.
A reliable aggregated active calories sensor would allow Home Assistant to act as the main calculation engine for energy expenditure.
Examples
Many health platforms expose separate values for:
• Active calories
• Basal calories
• Total calories burned
Some platforms also allow selecting the source device or application.
A similar approach in the Home Assistant Android app would allow users to choose the exact source of their activity data and avoid mixing values from multiple apps.
Anything else?
Phone: Android device
Wearable: Xiaomi device (Mi Fitness app)
Health platform: Android Health Connect
Integration: Home Assistant Android Companion App
Mi Fitness writes activity and active calorie data to Health Connect in periodic blocks. However, Home Assistant often does not pick up these updates automatically.
Even with all permissions granted to Mi Fitness and Health Connect, the data is not always reflected in Home Assistant unless the Mi Fitness app is opened manually.
In practice this means that to avoid missing active calorie updates, the user must manually open the Mi Fitness app multiple times per day (sometimes every 30–60 minutes). This is not an optimal user experience.
Because Xiaomi writes activity data in blocks, if Home Assistant only reads the latest value instead of an aggregated daily value, it is possible for some activity updates to be missed unless the source app is manually refreshed.
Since the data already exists inside Health Connect, it would be more reliable for Home Assistant to read the aggregated daily active calories directly through the Health Connect aggregate API.
This would ensure that Home Assistant always retrieves the correct total active calories for the day without depending on manual app refreshes or background sync timing.
Beta Was this translation helpful? Give feedback.
All reactions