Widget Formula Reference – Ride Cave | Ride Cave

Widget Formula Reference

Build custom data items with formulas that combine live workout data, computed metrics, comparisons, and math functions. This is your complete guide to every operator, function, and data field available in the widget builder; the same language also powers Custom Alerts.

Operators

Arithmetic

Standard math operators with the usual precedence: multiplication and division before addition and subtraction. Use parentheses to override.

OperatorNameExample
+AdditionPower + 10
-SubtractionHeart Rate - 48
*MultiplicationIF * 100
/DivisionPower / Weight
( )Parentheses(Power + NP) / 2
Comparisons

Conditional logic

Comparison operators evaluate to 1 when the condition is true and 0 when false. They have lower precedence than arithmetic, so Power + 10 > 100 parses as (Power + 10) > 100. Combine with if() for conditional display, or multiply two conditions together for logical AND.

OperatorNameExample
>Greater thanPower > FTP
<Less thanCadence < 70
>=Greater than or equalHeart Rate >= 170
<=Less than or equalW/kg <= 2
==EqualPower == 0
!=Not equalCadence != 0
Use case · Custom Alerts

The same comparison and if() language powers Custom Alerts: write any expression that evaluates non-zero when you want a toast and sound to fire, e.g. Power > FTP or Heart Rate > 0.9 * Max HR.

Functions

Built-in math functions

Wrap any expression in a function call. Functions can be nested and combined with operators.

round(x)

Rounds to the nearest integer

round(Power / Weight)If Power/Weight is 3.7, returns 4
abs(x)

Returns the absolute (non-negative) value

abs(Int Delta Power)If drift is -12, returns 12
floor(x)

Rounds down to the nearest integer

floor(TSS / 10) * 10If TSS is 67, returns 60
ceil(x)

Rounds up to the nearest integer

ceil(Elapsed / 60)If elapsed is 121s, returns 3 (minutes)
min(a, b, ...)

Returns the smallest value from multiple arguments

min(Power, Target Power)Returns whichever is lower
max(a, b, ...)

Returns the largest value from multiple arguments

max(Peak 5m, NP)Returns whichever is higher
if(cond, a, b)

Returns a when the condition is non-zero, otherwise b. Short-circuits: only the selected branch is evaluated, so the other can safely divide by zero or reference null fields.

if(Weight > 0, Power / Weight, 0)Safe W/kg even before Weight is loaded
Examples

Formula ideas

Copy these formulas into the widget builder or use them as inspiration for your own.

W/kg
Power / Weight

Watts per kilogram, the most common power-to-weight ratio.

% of FTP
Power / FTP * 100

Current power as a percentage of your FTP. Useful for pacing by intensity.

Variability Index
NP / Avg Power

Variability Index, how steady your effort is. Closer to 1.0 means more even pacing.

Efficiency
Power / Heart Rate

Efficiency Factor: watts produced per heartbeat. Higher is more efficient.

TSS/hr
round(TSS / (Elapsed / 3600))

TSS per hour, your rate of stress accumulation. Useful for comparing interval density.

Best sustained
max(Peak 5m, NP)

The higher of your best 5-minute power or Normalized Power for the session.

% HRR
(Heart Rate - 48) / (190 - 48) * 100

Heart rate reserve percentage (replace 48 with your resting HR and 190 with your max HR).

Quality time
Zone 4 Time + Zone 5 Time

Total time spent in threshold and VO2max zones combined: your "quality time" in a workout.

Smoothed power
Power 30s

Your average power over the last 30 seconds. A steadier read than instantaneous watts for pacing long efforts without hitting the lap button.

Smoothed W/kg
Power 3s / Weight

W/kg smoothed over 3 seconds, the classic head-unit display. Damps the spikes so the number is readable while you ride.

Time at threshold
HR7:Z4 Time + HR7:Z5 Time

Seconds spent from 94% to 102% of LTHR (7-zone Z4 plus Z5). The HR7: prefix means the 7-zone model; format as a duration to track time right around threshold.

Time above threshold
HR7:Z6 Time + HR7:Z7 Time

Time above 102% of LTHR in the 7-zone model (Z6 plus Z7): your hard, anaerobic minutes. Format as a duration.

Smoothed %FTP
Power 30s / FTP * 100

Your last-30-seconds power as a percentage of FTP. Steadier than instantaneous %FTP for holding an interval on target. Suffix with a percent sign.

Efficiency (30s)
Power 30s / HR 30s

Watts per heartbeat over the last 30 seconds, both smoothed. Watch it sag as you tire on a long effort.

Surge vs steady
Power 3s - Power 60s

How far your current effort sits above your last minute. Positive means you are surging, negative means you are easing off.

Easy time
HR7:Z1 Time + HR7:Z2 Time

Combined time in the two easiest heart-rate zones. Handy on a recovery ride to check you are actually staying easy. Format as a duration.

Above-threshold %
(HR7:Z5 Time + HR7:Z6 Time + HR7:Z7 Time) / Elapsed * 100

What share of the whole ride you have spent above threshold. Suffix with a percent sign.

Power drift
abs(Int Delta Power)

Absolute power drift between intervals. Tells you how much your power changed regardless of direction.

Mins left
ceil(Remaining / 60)

Minutes remaining in the workout, always rounded up. Handy as a countdown timer.

Over-threshold %
if(Power > FTP, Power / FTP * 100, 0)

Shows percent over FTP only when you’re actually above threshold, otherwise reads zero.

Safe W/kg
if(Weight > 0, Power / Weight, 0)

Safe W/kg that won’t flash NaN before your profile loads; the divide is skipped until weight is known.

Grinding flag
(Power > 200) * (Cadence < 80)

Logical AND via multiplication: returns 1 only when both conditions are true. Pair with a text or color threshold to show "grinding".

Top zone flag
if(Heart Rate > 0.9 * Max HR, 1, 0)

Returns 1 in your top HR zone, 0 below. Drop it into a number widget with a text threshold to label the zone.

Heart Rate & Rolling

HR zone models and rolling averages

Two field families are worth a closer look before you dive into the full list: the heart-rate zone models and the rolling-average metrics.

Heart rate zones

Every HR zone field is anchored to your Lactate Threshold Heart Rate (LTHR), set under Athlete Settings. Zones are stored as a percentage of LTHR, so they rescale automatically whenever your LTHR changes. Two models are available and both start from that same LTHR.

The 5-zone model (fields under HR Zones (5-zone), prefixed HR5:) is the app default for zone displays. The 7-zone model (HR Zones (7-zone), prefixed HR7:) follows Joe Friel’s cycling zones: zones 1 to 4 are identical to the 5-zone model, and the supra-threshold top end splits into three so time just above threshold reads separately from deep anaerobic work.

Not sure which to pick? The 5-zone model is plenty for everyday training and matches the zones most riders already know. Reach for the 7-zone model when you specifically want to separate the effort just above threshold from all-out anaerobic work, for example to track time spent right around threshold.

Interval HR targets inside a workout are a separate thing: the player resolves those straight from your %LTHR, so neither zone model changes how they work.

7-zone model (percent of LTHR)

ZoneNameRange
Z1Recoveryup to 80%
Z2Aerobic81-89%
Z3Tempo90-93%
Z4Sub-Threshold94-99%
Z5Super-Threshold100-102%
Z6Aerobic Capacity103-106%
Z7Anaerobic Capacity107%+
Reading the HR zone field names

An HR zone field name is three pieces. Take HR7:Z4 Time:

HR7Z4Time
heart rate, 7-zone modelzone 4seconds spent there

So it reads: seconds spent in heart-rate zone 4, using the 7-zone model. The model is just the prefix: HR5: is the 5-zone model and HR7: is the 7-zone model, so HR5:Z4 Time and HR7:Z4 Time are the same zone counted in each.

There are two kinds of zone field, and they answer different questions:

  • HR7:Zone (no zone number) is which zone am I in right now: a single number, 1 to 7, that changes as your heart rate moves. Pair it with color thresholds for a tile that recolors by zone.
  • HR7:Z4 Time (a specific zone) is a stopwatch for that one zone: the seconds you have banked in it so far, counting up all ride. There is one per zone.

Mid-ride, HR7:Zone might read 4 while HR7:Z4 Time reads 8:20 and HR7:Z5 Time reads 0:00. Same split exists in the 5-zone model: HR5:Zone plus HR5:Z1 Time through HR5:Z5 Time.

Rolling averages

Instantaneous power and heart rate jump around so much they are hard to pace by. A rolling average smooths the number to something you can actually hold, and it keeps updating on its own, so it is ideal for long steady efforts where you are not pressing the lap button.

The fields under Rolling Avg report the mean of a metric over a trailing window: a fixed span that follows you through the whole ride. Power offers 3, 5, 10, 30 and 60 second windows plus 5 and 10 minute windows; heart rate offers 10, 30 and 60 seconds; cadence offers 10 and 30 seconds. So Power 3s is the classic head-unit smoothing, while Power 30s or Power 5m hold steadier for a long climb.

Coasting (0 W) counts toward the power average. A dropped heart-rate or cadence sensor is skipped rather than read as zero, and a rolling field shows nothing until it has at least one reading in its window. Format it as a number with a suffix like w or bpm, exactly like a live field.

Formatting

Shaping the output

A formula produces a raw number. How it looks on the widget is up to you, which is why a few examples above say things like “format as a duration” or “suffix with a percent sign.”

The basics

Each metric has a few knobs. Pick Number or Duration: a duration shows mm:ss instead of a big second count, which is what you want for the zone timers, lap and workout time, and anything else measured in seconds. Set how many decimals to show, and add a suffix (w, bpm, %) or a prefix so the value carries its units.

Display styles

StyleLooks likeGood for
Numberthe value itself, optionally recolored at thresholdsmost metrics
Bar / Gaugea fill that grows toward a maximum you choosePower / FTP * 100 toward 120, or Heart Rate toward Max HR
Indicatora colored dot that switches color at thresholdscurrent zone from HR7:Zone, red when hard
Texta word chosen at thresholds, not a numberlabels like Endurance / Tempo / Hard
Data Fields

All 128 fields

Type any field name or alias directly into your formula. Names are case-insensitive and spaces are optional.

Body Temp

FieldAliasesDescription
Avg Core TempavgcoretempavgcoreSession average core body temperature
Avg HSIavghsiavgheatstrainSession average Heat Strain Index
Avg Skin TempavgskintempavgskinSession average skin temperature
Core TempcoretempcoretemperaturebodytempCurrent core body temperature in °C
Heat Strain IndexhsiheatstrainheatstrainindexCurrent Heat Strain Index (0-25.4)
Max Core TempmaxcoretempmaxcoreMaximum core body temperature recorded
Skin TempskintempskintemperatureCurrent skin temperature in °C

Breathing

FieldAliasesDescription
Avg Breath RateavgbravgbreathrateSession average breath rate
Avg VentilationavgveavgventilationSession average minute ventilation
Breath RatebrbreathratebrpmCurrent breathing rate in breaths/min
I:E RatioieieratioInspiration to expiration ratio
Mean RRmeanrrrrMean RR interval from HRV in ms
Minute VentilationveventilationminuteventilationCurrent minute ventilation in L/min
Tidal VolumetvtidalvolumeAverage inhale volume in liters
VE 5sve5ve5s5-second rolling ventilation average
VE 60sve60ve60s60-second rolling ventilation average

Computed

FieldAliasesDescription
Avg CadenceavgcadenceavgrpmSession average cadence
Avg HRavghrSession average heart rate
Avg PoweravgpowerapSession average power
DecouplingdecouplingaeroDecouplingAerobic decoupling % (cardiac drift)
IFifintensityfactorIntensity Factor (NP / FTP)
KilojouleskjkilojoulescalorieskcalenergyTotal energy output in kilojoules
Max CadencemaxcadencemaxrpmHighest cadence recorded this session
Max HRmaxhrHighest heart rate recorded this session
NPnpnormalizedpowerNormalized Power (intensity-weighted average)
NP/kgnpkgnpperkgNormalized Power per kilogram
Power:HRpowerhrphrEfficiency ratio (power / heart rate)
TorquetorqueEstimated torque (power / cadence proxy)
TSStssTraining Stress Score
VIvivariabilityindexVariability Index (NP / Avg Power)
W/kgwkgwattsperkgCurrent watts per kilogram of body weight

HR Zones (5-zone)

FieldAliasesDescription
HR5:Zonehrzonehzonehr5zoneCurrent heart rate zone (5-zone LTHR model, 1-5)
HR5:Z1 Timehrz1timehrzone1hr5z1timeTime in HR zone 1 (Recovery, under 81% LTHR) in seconds
HR5:Z2 Timehrz2timehrzone2hr5z2timeTime in HR zone 2 (Aerobic, 81-89% LTHR) in seconds
HR5:Z3 Timehrz3timehrzone3hr5z3timeTime in HR zone 3 (Tempo, 90-93% LTHR) in seconds
HR5:Z4 Timehrz4timehrzone4hr5z4timeTime in HR zone 4 (Sub-Threshold, 94-99% LTHR) in seconds
HR5:Z5 Timehrz5timehrzone5hr5z5timeTime in HR zone 5 (Supra-Threshold, 100%+ LTHR) in seconds

HR Zones (7-zone)

FieldAliasesDescription
HR7:Zonehrzone7hzone7hr7zoneCurrent heart rate zone (7-zone Friel LTHR model, 1-7)
HR7:Z1 Timehrz1time7hr7zone1hr7z1timeTime in 7-zone HR zone 1 (Recovery, under 81% LTHR) in seconds
HR7:Z2 Timehrz2time7hr7zone2hr7z2timeTime in 7-zone HR zone 2 (Aerobic, 81-89% LTHR) in seconds
HR7:Z3 Timehrz3time7hr7zone3hr7z3timeTime in 7-zone HR zone 3 (Tempo, 90-93% LTHR) in seconds
HR7:Z4 Timehrz4time7hr7zone4hr7z4timeTime in 7-zone HR zone 4 (Sub-Threshold, 94-99% LTHR) in seconds
HR7:Z5 Timehrz5time7hr7zone5hr7z5timeTime in 7-zone HR zone 5 (Super-Threshold, 100-102% LTHR) in seconds
HR7:Z6 Timehrz6time7hr7zone6hr7z6timeTime in 7-zone HR zone 6 (Aerobic Capacity, 103-106% LTHR) in seconds
HR7:Z7 Timehrz7time7hr7zone7hr7z7timeTime in 7-zone HR zone 7 (Anaerobic Capacity, 107%+ LTHR) in seconds

Rolling Avg

FieldAliasesDescription
Power 3spower3spwr3sAverage power over the last 3 seconds
Power 5spower5spwr5sAverage power over the last 5 seconds
Power 10spower10spwr10sAverage power over the last 10 seconds
Power 30spower30spwr30sAverage power over the last 30 seconds
Power 60spower60spower1mpwr60sAverage power over the last 60 seconds
Power 5mpower5mpower300spwr5mAverage power over the last 5 minutes
Power 10mpower10mpower600spwr10mAverage power over the last 10 minutes
HR 10shr10sbpm10sAverage heart rate over the last 10 seconds
HR 30shr30sbpm30sAverage heart rate over the last 30 seconds
HR 60shr60shr1mbpm60sAverage heart rate over the last 60 seconds
Cadence 10scadence10srpm10sAverage cadence over the last 10 seconds
Cadence 30scadence30srpm30sAverage cadence over the last 30 seconds

Intervals

FieldAliasesDescription
Int Avg CadenceintavgcadenceintcadenceAverage cadence in current interval
Int Avg HRintavghrinthrintervalavghrAverage heart rate in current interval
Int Avg PowerintavgpowerintpowerintervalavgpowerAverage power in current interval
Int Cadence HighintcadencehighCadence range upper bound
Int Cadence LowintcadencelowCadence range lower bound
Int Cadence TargetintcadencetargetintervalcadenceCadence target for current interval
Int HR HighinthrhighHeart-rate target range upper bound (bpm, resolved from %LTHR)
Int HR LowinthrlowHeart-rate target range lower bound (bpm, resolved from %LTHR)
Int HR TargetinthrtargetintervalhrHeart-rate target for current interval (bpm, resolved from %LTHR)
Int Delta HRintdeltahrdeltahrHR drift vs. previous interval
Int Delta PowerintdeltapowerdeltapPower drift vs. previous interval
Interval NumintervalindexintnumintervalnumCurrent interval number
Next Int % FTPnextftpnextint%ftpTarget % FTP for the next interval
Next Int DurationnextdurationnextintdurationDuration of the next interval in seconds

Live

FieldAliasesDescription
% FTP%ftpftppctftppercentCurrent power as a fraction of FTP (0-1)
Avg HR LiveavghrliveavgbpmRunning average heart rate from start
CadencecadencerpmCurrent pedaling cadence in RPM
DistancedistancedistTotal distance traveled in meters
ElapsedelapsedtimeTotal workout time in seconds
FTP AdjustmentadjustmentftpadjustadjustmentwattsManual FTP bias adjustment in watts
Heart RatehrbpmheartrateCurrent heart rate in bpm
Interval RemainingintervalremainingintremTime left in current interval in seconds
PowerpowerwattswCurrent power output in watts
RemainingremainingTime left in workout in seconds
SpeedspeedVirtual speed in m/s
Target PowertargettargetpowerrawtargetWorkout target power for current interval
Trainer TargettrainertargetpmtargetadjustedtargetPower Match adjusted target sent to trainer (null if PM inactive)

Peaks

FieldAliasesDescription
Peak 5speak5speak5Best 5-second average power
Peak 15speak15speak15Best 15-second average power
Peak 30speak30speak30Best 30-second average power
Peak 1mpeak1mpeak60peak60sBest 1-minute average power
Peak 2mpeak2mpeak120peak120speak2minBest 2-minute average power
Peak 5mpeak5mpeak300peak5minBest 5-minute average power
Peak 10mpeak10mpeak600peak10minBest 10-minute average power
Peak 20mpeak20mpeak1200peak20minBest 20-minute average power

Profile

FieldAliasesDescription
FTPftpFunctional Threshold Power setting
WeightweightbodyweightkgBody weight in kilograms

Gearing

FieldAliasesDescription
Gear RatiogearratioratiogearCurrent virtual gear ratio (evenly spaced ladder between the preset's easiest and hardest gears)
ChainringchainringfrontFront chainring teeth of the closest real gear combination
CogcogrearsprocketRear cassette cog teeth of the closest real gear combination
Gear IndexgearindexgearnumbergearnumCurrent gear position (0-based index in sequential gear list)
Total GearstotalgearsgearcountTotal number of virtual gears
Gear ForcegearoffsetgeargradegearforceForce change vs neutral gear (%)

Strain

FieldAliasesDescription
Strain HighstrainhighglycolyticstrainGlycolytic training load (zone 4-5)
Strain LowstrainlowaerobicstrainAerobic training load (zone 1-3)
Strain PeakstrainpeaknmstrainNeuromuscular training load (zone 6-7)

Route

FieldAliasesDescription
Climbing RemainingclimbingremainingclimbingleftelevationleftRemaining elevation gain to the end of the eRoute (metres)
Distance RemainingdistanceremainingdistremroutedistleftRemaining eRoute distance in metres
eRoute ElevationrouteelevationrouteeleelevationCurrent elevation interpolated from the GPS eRoute (metres)
eRoute GraderoutegradegradegradepcentgradientCurrent road gradient (%)
eRoute PositionrouteprogressroutepctrouteprogresspctroutepositionYour position along the eRoute as a percentage (0-100)
eRoute Total DistanceroutetotaldistanceroutetotaldistroutelengthTotal eRoute distance in metres
Total Elevation GaintotalelevationgaintotalgainroutegainTotal elevation gain for the full eRoute (metres)

Laps

FieldAliasesDescription
Lap NumberlapnumberlapnumlapCurrent lap number (loop routes)
Lap TimelaptimelaptimerElapsed time in current lap (seconds)
Lap Avg PowerlapavgpowerlappowerAverage power in current lap
Lap Avg HRlapavghrlaphrAverage heart rate in current lap
Best LapbestlapbestlaptimefastestlapFastest completed lap time (seconds)
Last LaplastlaplastlaptimepreviouslapMost recent completed lap time (seconds)
Completed LapscompletedlapslapcountlapsNumber of completed laps

W'bal

FieldAliasesDescription
Time to EmptyttetimetoemptySeconds until W'bal fully depleted
W'bal %wbalwbalpctwbal%Anaerobic energy remaining (0-100%)
W'bal JouleswbaljwbaljoulesAnaerobic energy remaining in joules

Zones

FieldAliasesDescription
Power ZonepowerzonepzoneCurrent power zone (1-7)
Zone 1 Timez1timezone1Time in power zone 1 (seconds)
Zone 2 Timez2timezone2Time in power zone 2 (seconds)
Zone 3 Timez3timezone3Time in power zone 3 (seconds)
Zone 4 Timez4timezone4Time in power zone 4 (seconds)
Zone 5 Timez5timezone5Time in power zone 5 (seconds)
Zone 6 Timez6timezone6Time in power zone 6 (seconds)
Zone 7 Timez7timezone7Time in power zone 7 (seconds)

Ready to build?

Open the widget builder and start creating custom data items with your own formulas.

Open widget builder