Skip to content
omriasta edited this page Jul 10, 2021 · 9 revisions

Welcome to the ifitsync wiki! A few issues that are coming up while writing this script:

  • The summarized values are due to Google Fit API not accepting some of the values provided by iFit because they are "Out of Range".

  • I have limited the iFit API requests to just the last 5 items to improve performance. If you need to bulk upload the history to date, simply change the IFIT_HIST_URL as per the comment in get_ifitaccount.py (line 127)

  • I have changed the workout type from "Running (treadmill)" integer 58 to "Running" integer 8. This is due to the fact that Google Fit will not show the route when it is set to Treadmill. You can change if you don't care about the map it is under the UploadIfitSessionToGoogle and UploadIfitActivityTo Google functions. I have also created if statements for anyone that also has an ifit bike. I am not sure how this would look in the ifit api, if anyone has a bike, let me know and we can look at the code and add this as an option.

  • If you have Google Fit on your phone or other device, please note that the activity recorded on them is prioritized and the info you upload will not show. Also, it prefers the GPS location received from your phone which may show weird routes if it acquires your location when you are on the treadmill. If you care about the route maps, you should turn off GPS while on the treadmill or set the app to only track location when open.

  • You can create a bash script called cron.sh and then run it using cron on Linux to have the script run on a schedule:

#!/bin/sh

cd $(dirname $0)

python3 -m venv venv > /dev/null

. venv/bin/activate

python3 ./ifitsync.py

And your crontab entry would look like this(also adds a log file in the same directory so you can see past results):

7 * * * /home/Your_Username/ifitsync/cron.sh >> /home/Your_Username/ifitsync/ifitsync.log 2>&1

Clone this wiki locally