NOTE from Google: The Google Fit APIs, including the Google Fit REST API, will no longer be available after June 30, 2025. As of May 1, 2024, developers cannot sign up to use these APIs.
--
A simple script to sync Gadgetbridge exported data to Google Fit. Currently, only the Mi Band data is supported.
This project is not recommended for normal users because it's not user friendly at all. I strongly suggest to only use this script if you know what you're doing.
You can install and run this script in Termux.
pip install FitBridge
$ FitBridge
It seems that you are running this script for the first time (or the config directory is lost), Do you want to create a new config? (y/n): y
Enter the path to the client_secret.json file: PATH_TO_CLIENT_SECRET
Enter the path to the Exported GadgetBridge database file: PATH_TO_GB_DB
Adding DataSources to the API automatically? (If not, you have to create them manually and add data_source_ids to the config) (y/n): y steps DataSource registered successfully: XXX heart_rate DataSource registered successfully: XXX
Done!
10. After the initial setup is done, You can sync the new data from the Gadgetbridge exported database by simply running the script again (Only the unsynced data will be synced):
$ FitBridge Steps: Read 10 Rows Steps: dataset inserted successfully. Steps: latest inserted timestamp is 2023-06-04 18:34:20 (UTC) Heart Rate: Read 96 Rows Heart Rate: dataset inserted successfully. Heart Rate: latest inserted timestamp is 2023-06-04 18:34:20 (UTC)