Read the statement by Michael Teeuw here.
Fitbit
-
-
@olliewarren411 can you describe your steps and your configs ? i think there is any missconfiguration in my credentials config i think soo.
-
I cant easily explain as I had to play around a lot to get it to work… and then it just did.
When setting up your app on the fitbit website did you get the below steps?
Check browser and personal for OAuth settings
Callback URL MUST BE http://127.0.0.1:8080/
Give your app read & write permissions (read-only untested)I could not set the Personal and OAuth settings until I got my personal URL wrong. When the page reloaded these two extra options appeared.
-
i set it all on that page. exeption was my location. but all other options are set.
-
works! i sued your code. Delete the token. set it up new - start it with sudo npm start in MagicMirror directory. -> WORKS!
I think i missunterstand the fibit API page where you have some buttons tu push and autorize the app (i think i pushed them in the wrong way)…
You sayed something about your token.ini -> can you explain what exactly you have to to every day? i think about an cronjob for that - good chance to solve that together!
And another option is the weight of my fitbit ARIA, these data are also available - how can we bind them into the app ?
-
@Hellangel1987
Glad to hear you got it working.I’m just trying to get the module to refresh more often. Not sure how to go about it.
You probably could get your weight data in too, you’d need to contact the creator of the module for that.
-
@olliewarren411 said in Fitbit:
Yes, you can change the refresh interval. In the script MMM-fitbit.js you’ll see
start: function() { Log.info('Starting module: ' + this.name); this.sendSocketNotification('SET CREDS',this.config.credentials) this.sendSocketNotification('GET DATA', 'intial'); this.fadeSpeed = 500; // Schedule update interval. var self = this; setInterval(function() { self.updateData(); }, 60*60*1000); },
change the 60 x 60 x 1000 to an interval of your choosing. Just be careful to to refresh too often as you’ll get emails from FB telling you that you are pulling too much data. I think (and I’d have to check tonight) that I have mine set to 15 x 60 x 1000.
-
Thanks! works perfect. I’ve copied your set up so it refreshes the data every 15 mins.
-
I was getting invalid redirect_uri during the setup process. (sudo python setupAccess.py)
But now It’s working for me, great module !
-
Anyway to get around having to run the setupAccess.py everyday/every other day to keep the tokens fresh?
Since I have to stop the MM from running, run the script to get new token, start MM again, it gets kind of annoying. I also run my Pi w/o keyboard/mouse so when I need to refresh the tokens I have to connect them.
I thought about adding a cron job to stop the MM, run the script and start MM, thoughts? Since the script leaves a browser window open, can the cron job kill it or is there a way to have the python script close the window when done?TIA