Fitbit intraday data using new OAuth 2.0 "personal" type app

95 views
Skip to first unread message

Wim Vanhooff

unread,
Feb 15, 2016, 11:52:22 AM2/15/16
to Sleep as Android
Hi there,

What I like best about your app, is the possibility to attach tags to sleep records, and run statistics on them to find out how to optimize deep sleep percentage.
It's always been a bummer that I couldn't use my Fitbit Flex to register the sleep quality into Sleep.

Now, in December 2015, Fitbit introduced a new app type to their OAuth, which exposes the user's intraday data.
The intraday data looks like this, where the minute values map to 1 ("asleep"), 2 ("awake"), or 3 ("really awake").

{"sleep":[{"awakeCount":3,"awakeDuration":16,"awakeningsCount":22,"dateOfSleep":"2016-02-13","duration":35160000,"efficiency":53,"isMainSleep":true,"logId":10870743534,"minuteData":[{"dateTime":"00:25:00","value":"2"},{"dateTime":"00:26:00","value":"2"},{"dateTime":"00:27:00","value":"2"},{"dateTime":"00:28:00","value":"2"},{"dateTime":"00:29:00","value":"2"},{"dateTime":"00:30:00","value":"2"},{"dateTime":"00:31:00","value":"2"},{"dateTime":"00:32:00","value":"2"},{"dateTime":"00:33:00","value":"2"},{"dateTime":"00:34:00","value":"2"},{"dateTime":"00:35:00","value":"2"},{"dateTime":"00:36:00","value":"2"},{"dateTime":"00:37:00","value":"2"},{"dateTime":"00:38:00","value":"2"},{"dateTime":"00:39:00","value":"2"},{"dateTime":"00:40:00","value":"2"},...,{"dateTime":"10:10:00","value":"2"}],"minutesAfterWakeup":45,"minutesAsleep":270,"minutesAwake":236,"minutesToFallAsleep":35,"restlessCount":19,"restlessDuration":300,"startTime":"2016-02-13T00:25:00.000","timeInBed":586}],"summary":{"totalMinutesAsleep":270,"totalSleepRecords":1,"totalTimeInBed":586}}

I'm aware that this isn't live data, and that it's inserted after the tracker syncs to the Fitbit service.
But it's the next best thing, so if we could get this data into SleepCloud, that would be a step forward.
I have a small working Java program which authenticates using OAuth 2.0 and fetches the above data, but nowhere to upload it to :)

Another approach would be to sync the Fitbit data into Google Fit, which could in theory pass its data into Sleep I'm presuming.

I think this shows promise.
What do you guys think? Doable?

Kind regards,
Wim Vanhooff

Jiri Richter

unread,
Feb 15, 2016, 12:43:16 PM2/15/16
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Jiri replied

Feb 15, 18:42
Hi, it is possible to use fitnesssyncer to do that -- fitnesssyncer.com

Thank you very much.

Best regards,

Jiri Richter
Urbandroid Team

Sleep as Android Googlegroup sent a message

Feb 15, 17:52
--
You received this message because you are subscribed to the Google Groups "Sleep as Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sleep-as-an-dr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

{#HS:171488944-13062#}

Wim Vanhooff

unread,
Feb 15, 2016, 1:11:02 PM2/15/16
to sleep-as...@googlegroups.com
Hi Jiri,

Thanks for pointing that out!
That's very interesting website, very similar to Zenobase.

However, although Sleep an Android is there as a data source, it's not possible to write data from Fitbit into Sleep As Android.
Or am I missing something?

Kind regards,
Wim Vanhooff

--
You received this message because you are subscribed to a topic in the Google Groups "Sleep as Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sleep-as-an-droid/sKESN0eF6LQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sleep-as-an-dr...@googlegroups.com.

Jiri Richter

unread,
Feb 16, 2016, 7:41:36 AM2/16/16
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Jiri replied

Feb 16, 13:41
Hi, yes, that's true -- you'd need to go around using Google Fit, as you suggested. So data would go Fitbit -> Fitnesssyncer -> Google Fit -> Sleep as Android


Thank you very much.

Best regards,

Jiri Richter
Urbandroid Team

Sleep as Android Googlegroup replied

Feb 15, 19:11
Hi Jiri,

Thanks for pointing that out!
That's very interesting website, very similar to Zenobase.

However, although Sleep an Android is there as a data source, it's not
possible to write data from Fitbit into Sleep As Android.
Or am I missing something?

Kind regards,
Wim Vanhooff

Wim Vanhooff

unread,
Feb 16, 2016, 7:55:42 AM2/16/16
to sleep-as...@googlegroups.com
Hi Jiri,

I enabled Google Fit integration in the Sleep app, but the imported Fitbit sleeps don't show up.

Kind regards,
Wim

--
You received this message because you are subscribed to a topic in the Google Groups "Sleep as Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sleep-as-an-droid/sKESN0eF6LQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sleep-as-an-dr...@googlegroups.com.

Jiri Richter

unread,
Feb 16, 2016, 8:19:34 AM2/16/16
to Sleep as Android Googlegroup, sleep-as...@googlegroups.com

Jiri replied

Feb 16, 14:19
Hi Wim, thank you for the update, we'll look at that. The third party input may not be completely compatible, we'll try it with a Mi Band (we don't have a Fitbit at our perusal), and see if there are any flaws in the import process from Fit to Sleep.


Thank you very much.

Best regards,

Jiri Richter
Urbandroid Team

Sleep as Android Googlegroup replied

Feb 16, 13:55
Hi Jiri,

I enabled Google Fit integration in the Sleep app, but the imported Fitbit
sleeps don't show up.

Kind regards,
Wim

Wim Vanhooff

unread,
Feb 16, 2016, 8:20:53 AM2/16/16
to sleep-as...@googlegroups.com
Thanks, you guys are the best! :)

--
You received this message because you are subscribed to a topic in the Google Groups "Sleep as Android" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/sleep-as-an-droid/sKESN0eF6LQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to sleep-as-an-dr...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages