Skip to content

chriszuercher/MyWhoosh2Garmin

 
 

Repository files navigation

myWhoosh2Garmin

Python script to upload MyWhoosh .fit files to Garmin Connect for both MacOS and Windows.

🧐 Features

  • Finds the .fit files from your MyWhoosh installation.
  • Fix the missing power & heart rate averages.
  • Removes the temperature.
  • Create a backup file to a folder you select.
  • Uploads the fixed .fit file to Garmin Connect.

🛠️ Installation Steps:

1. Download myWhoosh2Garmin.py and MyWhoosMonitor.ps1 to your filesystem to a folder or your choosing.

2. Go to the folder where you downloaded the script in a shell.

MacOS: Terminal of your choice.

Windows: Start > Run > cmd or Start > Run > powershell

3. Run it to set things up.

You can directly call the PowerShell script if you have the required tools installed (see automation tips). This will setup a python venv and install all required packages.

.\MyWhooshMonitor.ps1

Alternatively you can run the python script (which will install stuff in your local environment)

python3 myWhoosh2Garmin.py
or
python myWhoosh2Garmin.py

3.1. First it will install Garth and Fit_tool package when you don't have it installed.

Installing collected packages: garth
Successfully installed garth-0.4.46
Installing collected packages: fit_tool
Successfully installed fit_tool-0.9.13

4. Choose your backup folder.

MacOS

image

Windows

image

5. Enter your Garmin Connect credentials

2024-11-21 10:08:04,014 No existing session. Please log in.
Username: <YOUR_EMAIL>
Password:
2024-11-21 10:08:33,545 Authenticating...

2024-11-21 10:08:37,107 Successfully authenticated!

6. Run the script when you're done riding or running.

2024-11-21 10:08:37,107 Checking for .fit files in directory: <YOUR_MYWHOOSH_DIR_WITH_FITFILES>.
2024-11-21 10:08:37,107 Found the most recent .fit file: MyNewActivity-3.8.5.fit.
2024-11-21 10:08:37,107 Cleaning up <YOUR_BACKUP_FOLDER>yNewActivity-3.8.5_2024-11-21_100837.fit.
2024-11-21 10:08:37,855 Cleaned-up file saved as <YOUR_BACKUP_FOLDER>MyNewActivity-3.8.5_2024-11-21_100837.fit
2024-11-21 10:08:37,871 Successfully cleaned MyNewActivity-3.8.5.fit and saved it as MyNewActivity-3.8.5_2024-11-21_100837.fit.
2024-11-21 10:08:38,408 Duplicate activity found on Garmin Connect.

(7. Or see below to automate the process)

ℹ️ Automation tips

What if you want to automate the whole process:

MacOS

PowerShell on MacOS (Verified & works)

You need Powershell

brew install powershell/tap/powershell

Start the script. This will also setup a virtual python environment and starts monitoring the application.

.\MyWhooshMonitor.ps1

AppleScript (need to test further)

-- Define the text file path to store mywhoosh.app's location
set textFilePath to (POSIX path of (path to me)) & "mywhoosh_path.txt"

-- Read the stored path from the text file
set mywhooshPath to ""
try
    set mywhooshPath to do shell script "cat " & quoted form of textFilePath
on error
    set mywhooshPath to ""
end try

-- Check if the stored path is valid
if mywhooshPath is not "" then
    try
        do shell script "test -d " & quoted form of mywhooshPath
    on error
        set mywhooshPath to ""
    end try
end if

-- Search for mywhoosh.app if no valid path is found
if mywhooshPath is "" then
    set mywhooshPath to do shell script "mdfind 'kMDItemFSName == \"mywhoosh.app\"' | head -n 1"
    if mywhooshPath is "" then
        return -- Exit if mywhoosh.app is not found
    end if
    -- Store the path in the text file
    do shell script "echo " & quoted form of mywhooshPath & " > " & quoted form of textFilePath
end if

-- Run mywhoosh.app
tell application "Finder"
    open application file mywhooshPath
end tell

-- Wait for mywhoosh to finish
repeat
    set appRunning to (do shell script "ps aux | grep -v grep | grep -c " & quoted form of "mywhoosh.app") as integer
    if appRunning = 0 then exit repeat
    delay 5
end repeat

-- Run the Python script
do shell script "python3 /path/to/mywhoosh.py"

Windows

You can simply start the monitor by doubleclick the StartMyWooshMonitor.bat file which will execute PowerShell with the script.

If you prefer PowerShell you can start the script. This will also setup a virtual python environment and starts monitoring the application.

.\MyWhooshMonitor.ps1

💻 Built with

Technologies used in the project:

About

MyWhoosh2Garmin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 83.7%
  • PowerShell 15.9%
  • Batchfile 0.4%