Server side data model for scripts

Solved.
Sorry, small mistake.

Script is working now.

1 Like

Hi David,

the alphaHRV app now provides an additional field called ā€œreadiness alphahrvā€, which apparently tries to quantify how ready you are based on the alpha1 during warm-up as compared to your previous few warm-ups. I’ve confirmed the field is present in the fit file using fitfileviewer. Could you add this to the data model so we can access it through intervals.icu? I’d be interested in tracking it over time.

You can add it using a custom activity field.

2 Likes

Thanks, that works! I had actually searched for a field called ā€œReadinessā€, but only looked in the ā€œFieldsā€ tab rather than ā€œCustomā€ (step 1).

1 Like

Hello, is there any stream available to access for a cadence curve?

Not at the moment. You would need to compute that from the cadence stream (and time if you want to be very accurate).

@david , how do you specify a request to return your all time personal best Power or HR? The only script I can find requires a retro number of days to specified. e.g., 42 days

You can use ā€˜all’:

{
  let pc = icu.bestPower['all']
  let best5mWatts = pc.getWatts(5 * 60)
  console.log("best5mWatts", best5mWatts)
}
1 Like

@david hoping you can help. I’m assuming this topic covers the custom activity scripts?

if this (below) is the script for best power (for 5m), what is the script to get it in the W/Kg equivalent, based on the rider’s weight on the day of the activity?

icu.powerCurve.getWatts(5 * 60)

Then as an alternative script, how would the same two scripts show the same best power after a certain work value, eg. 1500kJ?

You can just do:

icu.powerCurve.getWattsPerKg(5 * 60)

For fatigued curves use icu.powerCurveFatigued0 and icu.powerCurveFatigued1. The number of kJ of work before each depends on what has been configured for the athlete. It is available as icu.powerCurveFatigued0.after_kj etc…

1 Like

Would it be possible to get submax efforts too?

I have added up to 5 submax curves. Will deploy Monday AM. You will be able to do:

{
  let pc = icu.bestPower['42d']
  for (let i = 0; i < pc.submax_watts?.length; i++) {
    console.log("submax_watts[" + i + "] = " + pc.submax_watts[I])
    console.log("submax_watts_per_kg[" + i + "] = " + pc.submax_watts_per_kg[i])
  }
}

submax_watts[0] = 757,748,735,720,703 ...
submax_watts_per_kg[0] = 10.955137252807617,10.824892044067383,10.636758804321289 ...
submax_watts[1] = 715,699,676,641,615 ...
etc.
1 Like