[Android Apps and Games] m.klinge:
Any and all support for this thread has discontinued. Feel free to refer to it anyway if you need some inspiration, but don't hold your breath for me to pitch in...

---xox---

I'm into Tasker. I mean like really into Tasker - so now that I got myself a Fitbit fitness tracker I decided to explore the possibilities of automating a bit more than the app does OOB. It turns out Fitbit have a quite capable API for fetching data, but the road to get to it isn't straight forward for a non-programmer guy like me. I turned to this wonderful forum and soon found help :good:

This entire How-To wouldn't have been possible for me to write without the help from blnk2007 - a big thanks goes out to him :highfive:

Just for show I've made my own Fitbit widget using Tasker and Zooper (Another really great app) that's updated whenever I unlock the screen, unless it's less than 30 minutes since last update. It shows the battery level, last update time, my percentage of step vs the goal and percentage of calories burn vs the goal. I kinda like it (Transparent background btw) , tell's me everything I need at glance, and only takes up one tile (As opposed to the 4x2 widget that comes with the app).

​

But you can do so much more than this once you get the hang of it, so let's get cracking [emoji14]

So first you need to create and account at https://dev.fitbit.com/apps/new in order to get access to the API. It's quite straight forward, you can put anything in the fields for company and website. Choose "Desktop" and "Read & Write" and you're done!

Next you need to register an account with Temboo. Temboo act as an integration point towards Fitbit. They provide 250 free calls per month, but you (and I) get 500 extra if you use my referral link here: http://bit.ly/1CYr4Fz and 750 per month should get you started for personal use like this :)

All set?

Good - perhaps it's time for a refill? [emoji14]

Fitbit uses OAuth so in Temboo find the OAuth library under the Fitbit folder.

First you run the "InitializeOAuth" - you need to get the Client key and client secret from your newly created Fitbit app. Follow the on-screen tips on Temboo and save the "AccesssToken" and "AccessTokenSecret".

Also while at Temboo download the Python SDK to you pc.

Download and install Python and SL4A to your android phone using the links below:

Python: http://goo.gl/YnOApT

SL4A (sl4a_r6x.apk): http://goo.gl/tBTW9e

All installed? Good!

Temboo Python SDK downloaded? Great. If you care about space on your device get weed out all the folders except the Fitbit one.

In the /SL4A/Scripts make a folder called Fitbit

In the newly created Fitbit folder copy the Temboo folder

Path should be SL4A/Scripts/Fitbit/Temboo

Get back to temboo and grab whatever script you would like to run from your android device.

Add the code to make it work:

from android import Android
droid = Android()

Place you new script in the Fitbit folder (Not the Temboo one)

And heureka! You're ready to make your first call to Fitbit directly from Tasker!

Now for my widget setup I'm pulling data rather then sending it to Fitbit, so I need to write the output to a file and then read it by Tasker. To do so simply use this code:

# Write file
target = open('output/device.txt','w')
target.truncate()
target.write(getDevicesResults.get_Response())
target.close()

getDevicesResults.get_Response()

This is the value and will need to be changed depending on the script you're running.

So there you have it, you are now able to interact with your Fitbit device through Tasker.

How about automatically setting a Fitbit alarm when you set an alarm on your device?

Or make your phone tell you to move you ass if you're below 25% of you step goal and it's five in the afternoon?

Now if you have reached this part of the How-To you are most probably a very patient person - or thinking TL: DR just share the files for that widget thing...

Here you go:

Tasker setup: http://1drv.ms/1Ei5b1V

Zooper setup: http://1drv.ms/1Ei5idJ

Pictures for the widget: http://1drv.ms/1Ei5ycD

GetDevice python script (You need to modify it with your own credentials - note I have my Fitbit credentials stored at Temboo): http://1drv.ms/1NToTGt

GetActivities python script (You need to modify it with your own credentials - note I have my Fitbit credentials stored at Temboo): http://1drv.ms/1NToZOx

When passing a variable to the python script you need to specify that in the script as well, an example of this can be seen in the GetActivities script.

I hope somebody out there find's some need for this - and once more a big shout out to blkn2007 for his help getting me started :)

//M