01-05-2021 01:11
01-05-2021 01:11
Hello Fitbit community,
Lets get straight to the point.
When I manually calculate the sleep efficiency score using my data retrieved from the Web API using this formula, I do not end up with the same values.
For instance:
timeAsleep - 433
timeInBed - 510
minutesToFallAsleep - 0
That would make: 433 / (510 - 0) = 0.849. However, the efficiency score is 94 for that day.
How does that work?
Thank you, and have a good day,
Olle
01-05-2021 05:44 - edited 01-07-2021 06:19
01-05-2021 05:44 - edited 01-07-2021 06:19
Hello @olledejong and welcome to the Help forums. The thread you reference is a very old thread. Fitbit replaced Sleep Efficiency with the Sleep Score for heart rate trackers.
Here is Fitbit's current Help article that explains Sleep Score. The Help article that is linked in you post was removed.
What model Fitbit do you use? It might help answer your question.
Laurie | Maryland
Sense 2, Luxe, Aria 2 | iOS | Mac OS
Take a look at the Fitbit help site for further assistance and information.
01-05-2021 07:35
01-05-2021 07:35
Hello Laurie,
Thanks for your response.
First: I have an Inspire HR.
If you are right, that brings up even more questions.
If the sleep efficiency variable was changed to sleep score variable, then why is the variable name in the data I pull from the API still named 'efficiency'?
Secondly, if it is just oddly still labeled 'efficiency' while it is the sleep score you see in the mobile app, then it still does not check out.
My sleep score in the mobile app for the 13th of december for instance is 84, however, the 'efficiency' value is 90. The minutes asleep and total time in bed do match though. There must be another formula in play here, right?
Thank you.
Olle
01-05-2021 07:49 - edited 01-06-2021 04:47
01-05-2021 07:49 - edited 01-06-2021 04:47
@olledejong There are a lot of old posts available, despite the fact that they are completely irrelevant. Your sleep score is based on three things: Time Asleep, Deep and REM sleep, and Restoration (a component that looks at your sleeping heart rate and restlessness). The Time Asleep, that component that uses the time in bed and time asleep, accounts for only 50% of your sleep score.
Any reference to Sleep Efficiency is out of date.
Laurie | Maryland
Sense 2, Luxe, Aria 2 | iOS | Mac OS
Take a look at the Fitbit help site for further assistance and information.
01-06-2021 02:00
01-06-2021 02:00
Thank you.
Still doesn't explain why the scores differ, right?
01-06-2021 05:14
01-06-2021 05:14
@olledejong Those scores differ because two different things are being measured. They will always be different.
Here is how Fitbit calculates a sleep score:
Cropped to fit. Sleep score is 87.
The link in your original post is from 2014, ancient in Fitbit years. Fitbit didn't even have a tracker that could measure heart rate in 2014.
Fitbit stopped using Sleep Efficiency when it released the Sleep Score. Please stop trying to compare them.
Laurie | Maryland
Sense 2, Luxe, Aria 2 | iOS | Mac OS
Take a look at the Fitbit help site for further assistance and information.
01-06-2021 06:01
01-06-2021 06:01
Well, you don't seem to understand me, or you don't want to.
You seem to be unwilling to admit that it is stupid that the efficiency score is still in the data that is pulled from the API, and that the 'new fancy sleep score' is not in that data.
Or perhaps it is the 'new sleep score' but it is just labeled wrong in the JSON data.
01-06-2021 21:42 - edited 01-06-2021 21:44
01-06-2021 21:42 - edited 01-06-2021 21:44
We aren't really privy to what Fitbit programmers are doing/thinking--whether it's a lack of update of a variable name or it's somehow using the old efficiency value in the new calculation. "Stupid" is somewhat subjective and reliant on assumptions.
I put this kind of thing in a file called "Fitbit Secret Sauce", of proprietary information I'll likely never know. Sorry if that's unsatisfying.
01-07-2021 06:18
01-07-2021 06:18
@olledejong I certainly do want to understand you. But let me quote you to help you understand why I am giving you my responses. "My sleep score in the mobile app for the 13th of december(sic) for instance is 84, however the "efficiency" is 90." You are confusing sleep score and sleep efficiency.
It will help if you explain why you are interested in sleep efficiency calculation. You mention the Web API and JSON data. Are you a software engineer? Why are you interested in a calculation that Fitbit doesn't use anymore?
Laurie | Maryland
Sense 2, Luxe, Aria 2 | iOS | Mac OS
Take a look at the Fitbit help site for further assistance and information.
01-07-2021 06:34
01-07-2021 06:34
You're right, I should have elaborated on the 'why'.
I'm analyzing and trying to find relations in my own 266 days of Fitbit data.
Resting heart-rate and the efficiency score pulled from the API correlate strongly.
What I need to know is: is the efficiency score (pulled from API) calculated using the resting heart-rate? Or is it calculated using the formula from the thread in 2014?
Because if it is, then the conclusion taken from the correlation significantly changes.
Thank you.
01-07-2021 11:39
01-07-2021 11:39
@olledejong In your initial post you gave time asleep, time in bed, and minutes to fall asleep data. This data is used for your Inspire HR sleep score and accounts for 50% of the score you see each day. In an old post, when a user asked about the sleep efficiency equation, a Fitbit Developer said that the equation is proprietary.
You sleep score uses your sleeping heart rate, not your resting heart rate. I pointed this out in my second response.
If you want more detail about your sleep, then you should purchase the Premium subscription. You will get the information as shown in my screenshot. The premium subscription includes your sleeping heart rate. But you will still spin your wheels trying to analyze this, though maybe not as much. In the end your sleep score is derived using proprietary equations and algorithms.
Laurie | Maryland
Sense 2, Luxe, Aria 2 | iOS | Mac OS
Take a look at the Fitbit help site for further assistance and information.
10-10-2023 10:45
10-10-2023 10:45
Any news regarding fitbit including "sleep score" in the API?
05-15-2024 14:10
05-15-2024 14:10
Thanks everyone. I'm looking for the same "Sleep Score" value which Fitbit state is different from Sleep Efficiency in the dev API docs [See 1st Image below] The API only provides Sleep Efficiency not Sleep Score. As olledejong correctly mentioned, the mobile app has a different Sleep Score value, from the API retrieval of the same session which provides a different "Sleep Efficiency" score. Fitbit has said publicly they acknowledge there is no access to the sleep score with the API, and its not in the roadmap of upcoming dev (last mention was 2023).