Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add several more health connect sensors #4785

Merged
merged 6 commits into from
Nov 7, 2024

Conversation

dshokouhi
Copy link
Member

@dshokouhi dshokouhi commented Nov 5, 2024

Summary

  • Body fat
  • Blood glucose (tested with the toolbox)
  • Distance
  • Elevation gained
  • Floors climbed
  • Sleep duration
  • Steps

This also fixes the attribute for total calories burned to display the current timestamp as it is an accumulated value, currently for me the timestamp on the attribute there is off by the UTC offset. UTC offset is meant for sensors with the timestamp device class.

Screenshots

image

Link to pull request in Documentation repository

Documentation: home-assistant/companion.home-assistant#1134

Any other notes

With the exception of exercise this is all the data I have for myself in Health Connect.

@jpelgrom
Copy link
Member

jpelgrom commented Nov 6, 2024

I see there are docs now. Why are those descriptions different from the sensor description?

@dshokouhi
Copy link
Member Author

I see there are docs now. Why are those descriptions different from the sensor description?

I'll update the strings here to match the docs, originally they were matching the descriptions in teh app

…rs to properly reset at midnight, convert some sensors to aggregate
@dshokouhi
Copy link
Member Author

latest update converts a few sensor to be aggregate so teh value can reset to 0, for example if you climb no floors for the day the value should be 0 until you do.

sleep duration updated to get data from teh record directly instead of aggregate, using some basic math to subtract end time from start time for the state.

corrected data in total calories sensor to reset properly to 0 and to correct the attribute

@dshokouhi
Copy link
Member Author

dshokouhi commented Nov 7, 2024

Due to popularity felt the need to add blood glucose here

#1523
#2098
#2537 (comment)
#2537 (comment)

Copy link
Member

@jpelgrom jpelgrom left a comment

Choose a reason for hiding this comment

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

Code and sensors look good. Nice clean up of the internals so some code can be reused.

@dshokouhi dshokouhi merged commit 2264dfb into home-assistant:master Nov 7, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants