There are a few manual steps necessary to be run the first time, in order obtain tokens that will work forever.
These steps have been taken from: https://www.forkingbytes.com/blog/using-the-fitbit-api-from-a-command-line-application-in-go/
In this page:
Once you do that, you will be redirected to the URL you typed in the Callback URL when registering your app. If you used http://localhost, you should see an error page now but that’s OK; we just need what’s on the URL, which should look like this:
https://localhost/?code=4c8bda4345baa41e39053aaef020996d2e1a19ce#_=_
We will need this bit:
code=4c8bda4345baa41e39053aaef020996d2e1a19ce
This code will be used the first time we run the app. Make sure you run it briefly after obtaining it or it will expire, and a new one will have to be obtained.
docker create \
--name=fitbit-steps \
-e PUID=USERID \
-e PGID=GROUPID \
-e TZ=Europe/Zurich \
-e UMASK_SET=077 \
-e CLIENT_ID=CLIENTID \
-e CLIENT_SECRET=CLIENTSECRET \
-e ONETIME_CODE=CODE \
-v /home/user/config:/config \
--restart always `#or: unless-stopped` \
tsubus/fitbit-steps
USERID: your linux user ID
GROUPID: your linux group ID
CLIENTID: client ID of FitBit app
CLIENTSECRET: client secret of FitBit app
CODE: one time code obtained from steps above
/home/user/config: path where fitbit-steps will store its configuration files
To start it:
docker start fitbit-steps
The YAML configuration file is located at /home/user/config/config.yaml (path as set above).
It will be automatically generated during first run.
Adjust it accordingly to your preferences and restart fitbit-steps.
---
### General options
# start of lunch
LUNCH_START: 12:00:00
# end of lunch
LUNCH_END: 13:00:00
# start of dinner
DINNER_START: 19:30:00
# end of dinner
DINNER_END: 20:30:00
# Number of minutes of variance from START and END times of meals
## Make sure this number is not going to overlap the START and END times (cannot have END before START)
MEAL_VARIANCE: 15
# cooldown before bed time
COOLDOWN: 120
### Workday-specific activities
# minimum steps per day
WORKDAY_STEPS_MINIMUM: 10000
# maximum steps per day
WORKDAY_STEPS_MAXIMUM: 15000
# Start of activities during workdays. Format: HH:MM:SS
# Set minimum to 00:00:00
WORKDAY_START: 07:00:00
# End of activities during workdays. Format: HH:MM:SS
# Set maximum to 23:59:59
WORKDAY_END: 23:00:00
# Number of minutes of variance from START and END times of workdays
# Make sure this number is not going to overlap the START and END times (cannot have END before START)
WORKDAY_VARIANCE: 30
### Weekend-specific activities
# minimum steps per day
WEEKEND_STEPS_MINIMUM: 14000
# maximum steps per day
WEEKEND_STEPS_MAXIMUM: 20000
# Start of activities during weekends. Format: HH:MM:SS
# Set minimum to 00:00:00
WEEKEND_START: 08:30:00
# End of activities during weekends. Format: HH:MM:SS
# Set maximum to 23:59:59
WEEKEND_END: 23:30:00
# Number of minutes of variance from START and END times of weekends
# Make sure this number is not going to overlap the START and END times (cannot have END before START)
WEEKEND_VARIANCE: 60
### Higher-intensity walk activities
# Optional: start of workday higher-intensity walk activity
WORKDAY_INTENSIVE_START: 17:00:00
# Optional: end of workday higher-intensity walk activity
# Required if WORKDAY_INTENSIVE_START is set
WORKDAY_INTENSIVE_END: 18:00:00
# Optional: start of weekend higher-intensity walk activity
WEEKEND_INTENSIVE_START: 14:30:00
# Optional: end of weekend higher-intensity walk activity
# Required if WORKDAY_INTENSIVE_START is set
WEEKEND_INTENSIVE_END: 16:30:00
# Number of minutes of variance from START and END times of high intensity activities
# Make sure this number is not going to overlap the START and END times (cannot have END before START)
INTENSIVE_VARIANCE: 20
...
The first time we run the app, we also have to insert the code obtained in the last step of the initialization,
make sure you include a valid one in the ONETIME_CODE variable.
CODE is the access code obtained above.
Content type
Image
Digest
Size
10.2 MB
Last updated
almost 6 years ago
docker pull tsubus/fitbit-steps