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

Sleep data sources #24

Open
k0rventen opened this issue Jan 28, 2024 · 3 comments
Open

Sleep data sources #24

k0rventen opened this issue Jan 28, 2024 · 3 comments

Comments

@k0rventen
Copy link
Owner

Do i understand correctly that there is no sense in providing "All" in sleep sources as we have in "Apple health specific metrics"?

image

Originally posted by @MarshalX in #12 (comment)

@k0rventen
Copy link
Owner Author

k0rventen commented Jan 28, 2024

hey @MarshalX , created an issue for this 🐛 from your comment.

Yeah I ran into this problem while developing the feature. IIRC, the problem is that if you take the measurements from all the possible sources, the dashboards are summing up all the values, and that creates impossible values.

For example with my phone and my watch both having sleep tracking, my "In Bed time" will be (in bed from iPhone + in bed from watch), which is not accurate (roughly double my actual sleep time 🛌 ), and create false data / charts.

I figured that by choosing a single source it would alleviate this problem, and as I only have an iPhone and a watch it made sense to only count the watch data, which is more precise. But from your screenshot I forgot that there are way more sleep data sources than I anticipated.

I'm not quite sure how to handle this particular issue, but if you have any ideas I'm all for it !

@MarshalX
Copy link
Contributor

hey @k0rventen! Hmm yeah, aggregating sleep data is not a trivial task. Even Apple does it more smartly. they provide you the option to reorder the priorities of the data source. and it enriches missed sleep data from the priority (img 1)

like today I slept until 8am and it was recorded by apple watch but 30 min later I went to sleep again for ~2.5 hours more. it wasn't recorded by apple watch but was recorded by Oura ring! and the final graph of the day has a great visualization from 2 sources (img 2)

image image

@k0rventen
Copy link
Owner Author

k0rventen commented Mar 3, 2024

If we were to "reproduce" the behavior of the Health app, the easiest way would be to do it through Grafana.

Right now I've purposely locked the source selection to one device, but allowing multiple sources should allow sources to fill in the gaps of other sources.
The main problem remains that when the data is overlapping, the dashboard will tally up the total. I'll try to find a way around (telling influx to only report 1 data point per given interval).

In the meantime, i just release v0.2.0, which contains sleep tracking support 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants