@Oliver_Tooth I was able to successfully install the Fitbit module and get it to pull information from the web API. It took a little tweaking, but I did get it to work.
Problems I encountered:
- Python was not installed. I had to install it and figure out how to install “pip”.
- Fitbit doesn’t make their developer area visible off their main website. I ended up bouncing through their forums first.
- Example config file on the module GitHub page contains errors. The character after
config:
should be {
, not [
.
- The secret key and appID field values need to be surrounded by single quotes, something not explained in the readme file.
Here’s the relevant portion of my config.sys file.
{
module: 'MMM-fitbit',
position: 'bottom_left',
config: {
credentials: {
client_id: '000XX0',
client_secret: 'abbacadabba1234567890',
},
resources: [
'steps',
'floors',
'caloriesOut',
'distance',
'activeMinutes',
'sleep',
'heart'
],
update_interval: 60
}
},
When you run npm start
the MMM-Fitbit python script will run and kick out a few lines in the console. I’m not entirely sure what it’s doing, but here’s what mine reads:
Set credential request recieved.
{ client_id: '000XX0',
client_secret: 'abbacadabba1234567890' }
Initial run request recieved.
Running getData.py
results: [{"message":"credentials.ini exists","type":"status"},{"message":"Writing credentials to credentials.ini","type":"status"},{"message":"Writing id: 000XX0 and secret: abbacadabba1234567890","type":"status"},{"message":"Credentials write successful","type":"status"}]
When I ran the setupAccess.py
script, it failed to modify the credentials.ini
file. I ended up editing it manually and plugging in my application ID and my secret key. The format is simple. Spaces before & after the =
and no quotes around the ID or key.