ManuelWiese / mrc_tools

Tools to convert mrc workout files
MIT License
31 stars 9 forks source link

Wahoo .plan file format #1

Open fealty opened 6 years ago

fealty commented 6 years ago

I've been poking around inside the Android ELEMNT Companion App.

There is native-wrapper code for converters for ERG/MRC and FIT workout files, which convert/copy workout files in /sdcard/*/plans/ to Wahoo's .plan format, which is then stored in an internal cache (in the app data). The Bolt does the same directly during a "Planned Workouts" sync.

There appears to be no way to remove or modify the .plan file once cached, from both the App and the Bolt. Except for clearing the app data and doing a factory reset of the Bolt.

I've attached the five in-built workout plans from the App as text files herein. Change .txt to .plan and the App and Bolt should accept them.

Based on the five examples, the Wahoo .plan file structure appears to be:

=HEADER=
# comment
DURATION=[workout duration in seconds]
[PlanActionType]=[value]

=STREAM=

# a list of intervals
=INTERVAL=
[PlanActionType]=[value]
...
[TriggerType][operator]?[PlanActionType expression]
...

# an optional list of sub-intervals
=SUBINTERVAL=
[PlanActionType]=[value]
...
[TriggerType][operator]?[PlanActionType expression]
...

Here's the types I found in the decompiled app:

PlanActionType:

NONE
MSG = 
ERG = 
LEVEL = signed integer [-1][3][...](kickr level setting?)
SCHEDULED = (time or date value? Long or string?)
NAME = string
DESCRIPTION = string
EXIT = ends an interval or sub-interval
MSG_DURATION_SEC = 
INTERVAL_NAME = string
INTERVAL_DESCRIPTION = string
INTERVAL_INDEX = 
INTERVAL_COUNT = 
REPEAT = integer (count)
PERCENT_FTP_HI = integer
PERCENT_FTP_LO = integer
HR_LO = integer? (Heart rate?)
HR_HI = integer?
PWR_LO = integer? (Power?)
PWR_HI = integer?
CAD_LO = integer (cadence)
CAD_HI = integer
INTENSITY = 
TSCORE = 
DURATION_SEC = 
DISTANCE_M = 
WORKOUT_TYPE = 
SPD_LO = (speed?)
SPD_HI = 
RPE_LO = 
RPE_HI = 
TSS = 
IF = 
FTP_TEST_FACTOR = double
FTP_TEST_ACTION = START or STOP
FTP_TEST_RESULT = 
PROGRESS_TYPE = [ProgressType?]

TriggerType

MESG_DURATION_SEC = integer (elapsed time in seconds)
MESG_DISTANCE_M = (elapsed distance in meters?)
ACTIVE = 
DELTA_DURATION_SEC = 
DELTA_DISTANCE_M = 

ProgressType

DURATION;
DISTANCE;
NONE;
MIXED;

Sky_Climbing.v1.txt Sky_Mixed.v1.txt Sky_Sprinting.v1.txt Wahoo_8min_FTP.v1.txt Wahoo_20min_FTP.v1.txt

fealty commented 6 years ago

Some notes after playing around with a custom planned workout:

1) The Bolt will modify a cached .plan workout if the /plans/ filename matches a cached file. Deleting the /plans/ file will not remove the cached .plan file.

2) A planned workout can be removed from the list by providing an invalid "=2HEADER=" or by providing an empty file in /plans/, which will overwrite the cached .plan file.

    MSG = string? (doesn't seem to have any effect)
    ERG = kickr ERG mode power to hold (-1 turns ERG mode off)
    SCHEDULED = yyyyMMdd (plan will appear in sort "scheduled")
    MSG_DURATION_SEC = int? (Doesn't seem to have any effect)
    INTERVAL_DESCRIPTION = string? (No visible effect)

Not tested any of these with the companion app, just the Bolt directly.