Skip to content

Added Garmin Body Composition values#12381

Merged
frenck merged 1 commit into
home-assistant:nextfrom
cyberjunky:patch-2
Mar 24, 2020
Merged

Added Garmin Body Composition values#12381
frenck merged 1 commit into
home-assistant:nextfrom
cyberjunky:patch-2

Conversation

@cyberjunky
Copy link
Copy Markdown
Contributor

@cyberjunky cyberjunky commented Mar 15, 2020

Proposed change

home-assistant/core#32841 added body composition data support (from Garmin Index Scale) Update the documentation to cover that.

Type of change

  • Spelling, grammar or other readability improvements (current branch).
  • Adjusted missing or incorrect information in the current documentation (current branch).
  • Added documentation for a new integration I'm adding to Home Assistant (next branch).
  • Added documentation for a new feature I'm adding to Home Assistant (next branch).
  • Removed stale or deprecated documentation.

Additional information

Checklist

  • This PR uses the correct branch, based on one of the following:
    • I made a change to the existing documentation and used the current branch.
    • I made a change that is related to an upcoming version of Home Assistant and used the next branch.
  • The documentation follows the Home Assistant documentation standards.

@probot-home-assistant probot-home-assistant Bot added the next This PR goes into the next branch label Mar 15, 2020
Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please link up the parent PR in the openings post. Thanks! 👍

@frenck frenck added the in-progress This PR/Issue is currently being worked on label Mar 16, 2020
@probot-home-assistant probot-home-assistant Bot added the has-parent This PR has a parent PR in another repo label Mar 18, 2020
@cyberjunky
Copy link
Copy Markdown
Contributor Author

@frenck I updated the post with requested information

@frenck frenck removed the in-progress This PR/Issue is currently being worked on label Mar 19, 2020
Copy link
Copy Markdown
Member

@frenck frenck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Approved. Can be merged as soon as the parent PR gets merged.

@frenck frenck added awaits-parent Awaits the merge of an parent PR new-feature This PR adds documentation for a new Home Assistant feature to an existing integration parent-merged The parent PR has been merged already labels Mar 24, 2020
@frenck frenck merged commit 391a999 into home-assistant:next Mar 24, 2020
@probot-home-assistant probot-home-assistant Bot removed awaits-parent Awaits the merge of an parent PR parent-merged The parent PR has been merged already labels Mar 24, 2020
thecode pushed a commit to thecode/home-assistant.io that referenced this pull request Mar 25, 2020
@cyberjunky cyberjunky deleted the patch-2 branch April 3, 2020 12:27
@PavelHonza
Copy link
Copy Markdown

PavelHonza commented Apr 22, 2020

Hello all! Doesn't work for me. I think that couldn't work because Garmin api returning body data like this:

{ "startDate": "2020-04-21", "endDate": "2020-04-22", "dateWeightList": [ { "samplePk": 1587514937000, "date": 1587522137000, "calendarDate": "2020-04-22", "weight": 88849.9984741211, "bmi": 26.799999237060547, "bodyFat": 15.289999961853027, "bodyWater": 61.83000183105469, "boneMass": 6639, "muscleMass": 36130, "physiqueRating": null, "visceralFat": null, "metabolicAge": null, "sourceType": "INDEX_SCALE", "timestampGMT": 1587514937000, "weightDelta": 2299.9999999999973 } ], "totalAverage": { "from": 1587427200000, "until": 1587599999999, "weight": 88849.9984741211, "bmi": 26.799999237060547, "bodyFat": 15.289999961853027, "bodyWater": 61.83000183105469, "boneMass": 6639, "muscleMass": 36130, "physiqueRating": null, "visceralFat": null, "metabolicAge": null, "weightCount": 1, "bmiCount": 1, "bodyFatCount": 1, "bodyWaterCount": 1, "boneMassCount": 1, "muscleMassCount": 1, "physiqueRatingCount": 0, "visceralFatCount": 0, "metabolicAgeCount": 0 } }

There is dateWeightList and totalAverage
But we are looking for Weight only which is wrapped in totalAverage tag. It returns None for all body values.

Here is log:

2020-04-22 02:24:18 DEBUG (MainThread) [garminconnect] Fetching body composition with url https://connect.garmin.com/modern/proxy/weight-service/weight/daterangesnapshot?startDate=2020-04-22&endDate=2020-04-22 2020-04-22 02:24:19 DEBUG (MainThread) [garminconnect] Body Composition response code 200, and json {'startDate': '2020-04-22', 'endDate': '2020-04-22', 'dateWeightList': [{'samplePk': 1587514937000, 'date': 1587522137000, 'calendarDate': '2020-04-22', 'weight': 88849.9984741211, 'bmi': 26.799999237060547, 'bodyFat': 15.289999961853027, 'bodyWater': 61.83000183105469, 'boneMass': 6639, 'muscleMass': 36130, 'physiqueRating': None, 'visceralFat': None, 'metabolicAge': None, 'sourceType': 'INDEX_SCALE', 'timestampGMT': 1587514937000, 'weightDelta': 2299.9999999999973}], 'totalAverage': {'from': 1587513600000, 'until': 1587599999999, 'weight': 88849.9984741211, 'bmi': 26.799999237060547, 'bodyFat': 15.289999961853027, 'bodyWater': 61.83000183105469, 'boneMass': 6639, 'muscleMass': 36130, 'physiqueRating': None, 'visceralFat': None, 'metabolicAge': None, 'weightCount': 1, 'bmiCount': 1, 'bodyFatCount': 1, 'bodyWaterCount': 1, 'boneMassCount': 1, 'muscleMassCount': 1, 'physiqueRatingCount': 0, 'visceralFatCount': 0, 'metabolicAgeCount': 0}}

2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: weight, Weight, kg, mdi:weight-kilogram, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: bmi, BMI, , mdi:food, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: bodyFat, Body Fat, %, mdi:food, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: bodyWater, Body Water, %, mdi:water-percent, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: bodyMass, Body Mass, kg, mdi:food, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: muscleMass, Muscle Mass, kg, mdi:dumbbell, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: physiqueRating, Physique Rating, , mdi:numeric, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: visceralFat, Visceral Fat, , mdi:food, None, False 2020-04-22 02:24:19 DEBUG (MainThread) [homeassistant.components.garmin_connect.sensor] Registering entity: metabolicAge, Metabolic Age, , mdi:calendar-heart, None, False

@cyberjunky
Copy link
Copy Markdown
Contributor Author

Hi Pavel, can you open an issue here: https://github.com/cyberjunky/python-garminconnect/issues
And close this one

It's a better location, since thats the repository of the library parsing these values.
And I will have a look/fix.
Can you tell me where your weight values come from, garmin smart scale, smartphone app, other linked portal?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

has-parent This PR has a parent PR in another repo new-feature This PR adds documentation for a new Home Assistant feature to an existing integration next This PR goes into the next branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants