Post

Replies

Boosts

Views

Activity

Reply to When are inBed logs from the Apple Watch added and what do they mean?
Please confirm that that you and your friend are using the same version of watchOS and are both using the native Apple sleep tracking experience rather than a third party app. "If a user sleeps with their Apple Watch at night with a sleep schedule set up, are CORE, REM and Deep enough to check for asleep status? Or is inBed also necessary?" It depends on the needs of your app. If you're developing an app that is trying to calculate time asleep separate from time in bed you would not want to fetch the inBed samples from HealthKit and just check the asleep samples.
Mar ’23
Reply to Calculate daily steep from healthkit data
I'm not sure exactly what you mean by "merging data for consecutive days" but I suspect you're querying for "what is the total amount of sleep time in this calendar day" which will include data from both the night you care about but also the morning corresponding to the night before and that's what you mean by merged. You'll likely want to query a little differently. For example, instead of bucketing by a midnight to midnight day, bucket by a 6pm - 6pm bounded day. Or apply some other type of processing to determine which "actual" day sleep data belongs to.
May ’22