10-05-2018 11:29
10-05-2018 11:29
I am using the Get Sleep Logs endpoint described here: https://dev.fitbit.com/build/reference/web-api/sleep/
In the full response, there are two main keys: "sleep" and "summary". In the response below, the "summary" values do not seem to match to the data in "sleep". The data looks like a mix of both classic and stages sleep. Can anyone help explain the relationship between these two keys for this record? How does this classic record have stages sleep data associated with it?
{u'sleep': [{u'dateOfSleep': u'2018-09-26', u'duration': 25020000, u'efficiency': 96, u'endTime': u'2018-09-26T07:16:00.000', u'infoCode': 3, u'isMainSleep': True, u'levels': {u'data': [{u'dateTime': u'2018-09-26T00:18:30.000', u'level': u'restless', u'seconds': 120}, {u'dateTime': u'2018-09-26T00:20:30.000', u'level': u'asleep', u'seconds': 3960}, {u'dateTime': u'2018-09-26T01:26:30.000', u'level': u'restless', u'seconds': 60}, {u'dateTime': u'2018-09-26T01:27:30.000', u'level': u'asleep', u'seconds': 7500}, {u'dateTime': u'2018-09-26T03:32:30.000', u'level': u'restless', u'seconds': 60}, {u'dateTime': u'2018-09-26T03:33:30.000', u'level': u'asleep', u'seconds': 3780}, {u'dateTime': u'2018-09-26T04:36:30.000', u'level': u'restless', u'seconds': 60}, {u'dateTime': u'2018-09-26T04:37:30.000', u'level': u'asleep', u'seconds': 4620}, {u'dateTime': u'2018-09-26T05:54:30.000', u'level': u'restless', u'seconds': 480}, {u'dateTime': u'2018-09-26T06:02:30.000', u'level': u'awake', u'seconds': 60}, {u'dateTime': u'2018-09-26T06:03:30.000', u'level': u'asleep', u'seconds': 2640}, {u'dateTime': u'2018-09-26T06:47:30.000', u'level': u'restless', u'seconds': 120}, {u'dateTime': u'2018-09-26T06:49:30.000', u'level': u'asleep', u'seconds': 1500}, {u'dateTime': u'2018-09-26T07:14:30.000', u'level': u'restless', u'seconds': 60}], u'summary': {u'asleep': {u'count': 0, u'minutes': 400}, u'awake': {u'count': 1, u'minutes': 1}, u'restless': {u'count': 7, u'minutes': 16}}}, u'logId': 19682091511, u'minutesAfterWakeup': 1, u'minutesAsleep': 400, u'minutesAwake': 16, u'minutesToFallAsleep': 0, u'startTime': u'2018-09-26T00:18:30.000', u'timeInBed': 417, u'type': u'classic'}], u'summary': {u'stages': {u'deep': 73, u'light': 217, u'rem': 78, u'wake': 57}, u'totalMinutesAsleep': 400, u'totalSleepRecords': 1, u'totalTimeInBed': 417}}
10-29-2018 12:19
10-29-2018 12:19
Hi @sleepy_dave,
Would you private message me the exact Sleep endpoint you're executing and the user-id for this response? I'll take a look.
Gordon
12-05-2018 16:25
12-05-2018 16:25
Has this issue been resolved? I am experiencing similar problems with the sleep data.
12-07-2018 15:24
12-07-2018 15:24
Hi @SunsetRunner,
Would you please describe the problem you are experiencing with the Sleep endpoints?
Thanks!
Gordon
12-14-2018 16:30
12-14-2018 16:30
I am seeing two problems that the original poster pointed out. First, on occasion, I get the classic sleep levels: awake, restless, and asleep. Second, in the summary, the sum of the deep, light, and rem totals do not match the total minutes asleep.
In addition, I have noticed sequences of consecutive nights where the summary totals for deep, light, and rem are exactly the same each night. Often, on the first such night, the deep, light, and rem totals do match the total minutes asleep, but on the following nights, the total minutes asleep are different.
My data comes from an Alta HR and spans over a year.
01-14-2019 17:54
01-14-2019 17:54
Has any progress been made on these issues?