Search code examples
huawei-mobile-serviceshealthkit

Huawei Health Kit API not showing protein value


I hope you can help me...the thing is that I'm getting all the samplepoints from the Health kit API and it's working fine except for the protein value it shows always 0, I've checked the Huawei Health App and over there is showing correctly a value from protein, the device used is a Matepad T8, this is the short answer from the endpoint

{"samplePoints":{
"com.huawei.instantaneus.body_weight":{"startTime":1640210232971000000,"endTime":1640210232971000000:, "dataTypeName":"com.huawei.instantaneous.body_weight","originalDataCollectorId":"raw:com.huawei.instantaneous.body_weight:com.huawei.health:HUAWEI:HUAWEI Body Fat Scale:5C:CA:D3:08:07:C2:168969165","value":[{"fieldName":"body_weight","floatValue":81.80000305175781},{"fieldName":protein_rate"},{....}]}}}

This is the Health App if you see there is protein data enter image description here

and in the app Im developing shows 0 because the endpoint is giving 0 value, this is from the Matepad T8

enter image description here


Solution

  • Update

    May i confirm what is your countries/regions? The protein rate is calculated only when the following three fields are met when the REST interface queries the body weight. Docs link.

    enter image description here

    so to locate this issue, please provide the complete data returned by the REST API.


    Could you pls check whether the conditions are met according to the document?

    enter image description here

    Also please check whether the data source is from Huawei's body fat scale. According to this docs, protein and other data are measured by body fat.

    And it would be great if you could provide us with a picture of the weight parameter data displayed in your HealthApp for us to locate the problem.