08-14-2017 21:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-14-2017 21:27
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
{'sleep': [ {'logId': 15444351924, 'dateOfSleep': '2017-08-07', 'minutesToFallAsleep': 0, 'awakeningsCount': 17, 'minutesAwake': 250, 'timeInBed': 426, 'minutesAsleep': 176, 'awakeDuration': 1, 'efficiency': 41, 'isMainSleep': True, 'startTime': '2017-08-07T02:32:00.000', 'restlessCount': 16, 'duration': 25560000, 'restlessDuration': 249, 'minuteData': [{'value': '2', 'dateTime': '02:32:00'}, {'value': '2', 'dateTime': '02:33:00'}, ... {'value': '1', 'dateTime': '09:36:00'}, {'value': '1', 'dateTime': '09:37:00'}], 'endTime': '2017-08-07T09:38:30.000', 'awakeCount': 1, 'minutesAfterWakeup': 0} ], 'summary': {'totalTimeInBed': 426, 'stages': {'light': 176, 'wake': 43, 'deep': 92, 'rem': 160}, 'totalMinutesAsleep': 176, 'totalSleepRecords': 1}}
On the old v1 API endpoint at https://api.fitbit.com/1/user/-/sleep/date/ we are getting inconsistent sleep values for some users. Above you can see that minutesAsleep is 176 but this matches exactly the time supposedly spent in light sleep. It's unclear what the total should be, as light + deep + rem > totalTimeInBed! We've been using the totalMinutesAsleep value in the summary to record total time asleep for a user, but this is now different to what the Fitbit app reports. Is this a bug? Why do the time asleep and awake totals not match the time reports in the stages breakdown?
08-15-2017 22:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

08-15-2017 22:12
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
I can't see a way to delete my post so I'll just leave an update here. Instead of hoping the Fitbit team might fix the issue I just switched to the 1.2 endpoint, which has correct values. I guess that's probably the outcome they were after.

