Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

API returns incorrect sleep stages data

ANSWERED

The reported sleep stages have runs of the same value. E.g., rem sleep will have
a value 119 several days in a row. The total time in bed and total minutes of sleep fields are updating with each day's data but the sleep stage summaries are not.

 

This is consistent across different users and on data since at least Nov 2017. Also on both V1 and V1.2 API calls.

 

(u'2018-01-16', {u'totalTimeInBed': 546, u'stages': {u'light': 171, u'wake': 44, u'deep': 88, u'rem': 93}, u'totalMinutesAsleep': 508, u'totalSleepRecords': 1})
(u'2018-01-17', {u'totalTimeInBed': 567, u'stages': {u'light': 335, u'wake': 77, u'deep': 68, u'rem': 87}, u'totalMinutesAsleep': 554, u'totalSleepRecords': 1})
(u'2018-01-18', {u'totalTimeInBed': 531, u'stages': {u'light': 335, u'wake': 77, u'deep': 68, u'rem': 87}, u'totalMinutesAsleep': 520, u'totalSleepRecords': 1})
(u'2018-01-19', {u'totalTimeInBed': 503, u'stages': {u'light': 271, u'wake': 51, u'deep': 62, u'rem': 119}, u'totalMinutesAsleep': 490, u'totalSleepRecords': 1})
(u'2018-01-20', {u'totalTimeInBed': 0, u'totalMinutesAsleep': 0, u'totalSleepRecords': 0})
(u'2018-01-21', {u'totalTimeInBed': 624, u'stages': {u'light': 271, u'wake': 51, u'deep': 62, u'rem': 119}, u'totalMinutesAsleep': 580, u'totalSleepRecords': 2})
(u'2018-01-22', {u'totalTimeInBed': 446, u'stages': {u'light': 271, u'wake': 51, u'deep': 62, u'rem': 119}, u'totalMinutesAsleep': 440, u'totalSleepRecords': 1})
(u'2018-01-23', {u'totalTimeInBed': 109, u'stages': {u'light': 271, u'wake': 51, u'deep': 62, u'rem': 119}, u'totalMinutesAsleep': 98, u'totalSleepRecords': 1})
(u'2018-01-24', {u'totalTimeInBed': 614, u'stages': {u'light': 271, u'wake': 51, u'deep': 62, u'rem': 119}, u'totalMinutesAsleep': 590, u'totalSleepRecords': 1})
Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

I dont know if this will be of any help to you or not, but just thought I would mention it just in case.

I was pretty much having the same issue. No matter what date I changed to, the sleep stage data was exactly the same. Turns out, I was taking it from the wrong location within the JSON response.

 

The "<JSON Response> -->Summary --> Stages

sleep stage data is always the same ( still havent figured out exactly what that is or why. Perhaps an average?)

But the  <JSON Response> --> sleep -->levels --> Summary --> <light/wake/rem/deep> changed with the date ( this is only available when using API v.1.2 it seems ). This stage data was on par with what the Official Fitbit app was showing me, so I took it as being accurate.

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

I dont know if this will be of any help to you or not, but just thought I would mention it just in case.

I was pretty much having the same issue. No matter what date I changed to, the sleep stage data was exactly the same. Turns out, I was taking it from the wrong location within the JSON response.

 

The "<JSON Response> -->Summary --> Stages

sleep stage data is always the same ( still havent figured out exactly what that is or why. Perhaps an average?)

But the  <JSON Response> --> sleep -->levels --> Summary --> <light/wake/rem/deep> changed with the date ( this is only available when using API v.1.2 it seems ). This stage data was on par with what the Official Fitbit app was showing me, so I took it as being accurate.

Best Answer
0 Votes