Open k0rventen opened 9 months ago
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 !
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)
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 :tada:
Do i understand correctly that there is no sense in providing "All" in sleep sources as we have in "Apple health specific metrics"?
Originally posted by @MarshalX in https://github.com/k0rventen/apple-health-grafana/issues/12#issuecomment-1913718757