health-samples icon indicating copy to clipboard operation
health-samples copied to clipboard

Min, max, and avg aggregate heart rate and speed stats are always null

Open deRonbrown opened this issue 2 years ago • 2 comments

I was certain I was doing something wrong (and still could be), but the BPM_AVG value is always null even though I'm certain there's data across the time range. I'm using the following code:

val response = healthConnectClient.aggregate(
    AggregateRequest(
        setOf(HeartRateRecord.BPM_AVG),
        TimeRangeFilter.between(activity.start, activity.end)
    )
)

val avgBpm = response[HeartRateRecord.BPM_AVG]

avgBpm is always null. I checked the sample app and the method readAssociatedSessionData and the "HR stats (bpm)" and "Speed stats (m/s)" sections are only showing "N/A" even though there is plenty of sample data shown.

deRonbrown avatar Aug 06 '22 17:08 deRonbrown

Just want to note that this isn't necessarily blocking because I can just read the sample directly and calculate the stats myself...

deRonbrown avatar Aug 06 '22 17:08 deRonbrown

Thank you, this is a known issue, which will be fixed in the next release.

garanj avatar Aug 06 '22 22:08 garanj

@deRonbrown Are you able to confirm if you are having this issue still in the latest version of Health Connect?

garanj avatar Jan 22 '23 09:01 garanj

@deRonbrown Please reach back out if the issue persists!

breanatate avatar Jul 12 '23 16:07 breanatate