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

How to capture sleep time on clock face?

We are developing a clock face that will show steps count, heart rate, and sleeping hours. We are able to get steps to count and heart rate from device API but are not able to get sleeping hours

Is there any way to get sleeping hours from device API?
I found device API which will give the state of "awake" or "asleep".
https://dev.fitbit.com/build/reference/device-api/sleep/ 

but I am not able to capture these above events("awake", "asleep").

Could anybody suggest what is the best approach we should follow?


 

Best Answer
0 Votes
4 REPLIES 4

The device sleep API is just a simple classifier. https://dev.fitbit.com/blog/2020-09-10-announcing-fitbit-os-sdk-4.2/#sleep-api

 

 

Actual sleep data can be fetched from the web APIs. There's an example here https://github.com/Fitbit/sdk-oauth

Best Answer
0 Votes

@JonFitbit 

How we can test this API( https://dev.fitbit.com/blog/2020-09-10-announcing-fitbit-os-sdk-4.2/#sleep-api) on the Fitbit emulator or Real device and How we can create a sleeping scenario in the Fitbit emulator. 

Best Answer
0 Votes

@JonFitbit 

did you find it anyway? and one strange issue I am faced for the last 3-4 days. Fitbit Simulator only showing companion phone to connect but device not connecting to visual studio. It's working fine for the real device(Sense).


Please check the below screenshot
The device bridge is disconnected 

Screenshot 2021-11-11 at 2.20.11 PM.png

Best Answer
0 Votes