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

Sleep Time Series Discrepancy

ANSWERED


Could someone from Fitbit API take a look at the following issue. Looks like Sleep in the Time Series is not returning correct values and the dashboard seems to be showing different information.
 
https://community.fitbit.com/t5/Fitbit-com-Dashboard/Bug-Total-Sleep-Discrepancy/m-p/722832/highligh...

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@FedericoArg wrote:

We are using the Time-Series API which should get the aggregated values for the entire day.
 
https://wiki.fitbit.com/display/API/API-Get-Time-Series
 


No, it shouldn't. You will note on that page it says: "1. Note that sleep collection resources represent values for the main sleep entry for the dates in request (this is the log entry labeled with "isMainSleep" = true)."

 

So it specifically only includes the primary sleep session.

View best answer in original post

Best Answer
6 REPLIES 6

@FedericoArg wrote:

I mainly asking this because I am seeing a Bug in the Fitbit API when returning this information.

 

215 / 60 = 3.58 hours which does not match with what I slept that day (6.32hours)

 

{

"sleep-minutesAsleep": [

    {

      "dateTime": "2015-03-18",
      "value": "215"
    }
  ]
}

 


What API call are you using? You should be using API-Get-Sleep and looking at the "summary" section, which shows the total of all sleep sessions for the day, which should look like:

 "summary":{

        "totalMinutesAsleep":518,
        "totalSleepRecords":2,
        "totalTimeInBed":540
    }

Best Answer
0 Votes

We are using the Time-Series API which should get the aggregated values for the entire day.
 
https://wiki.fitbit.com/display/API/API-Get-Time-Series
 
sleep/minutesAsleep
sleep/awakeningsCount    
sleep/minutesAwake

Best Answer
0 Votes

@FedericoArg wrote:

We are using the Time-Series API which should get the aggregated values for the entire day.
 
https://wiki.fitbit.com/display/API/API-Get-Time-Series
 


No, it shouldn't. You will note on that page it says: "1. Note that sleep collection resources represent values for the main sleep entry for the dates in request (this is the log entry labeled with "isMainSleep" = true)."

 

So it specifically only includes the primary sleep session.

Best Answer

I combined your posts all in the API forum, where it is most appropriate. But again, if you look at the documentation, it appears to be working as intended.

Best Answer
0 Votes

Thank you for pointing that to me. 

Best Answer
0 Votes

I don't see that caveat at https://dev.fitbit.com/docs/sleep/#get-sleep-time-series. Was that an intentional omission? 

Best Answer
0 Votes