You can now edit the distance of an activity. This is useful for indoor rides done with GPS left on and other similar issues. This has no impact other than correcting weekly distances totals and so on.
Thanks, David. You are doing an amazing amount of work on this website: I – and I’m sure the rest of us – are very grateful to you.
Hi @david,
I’m trying to automate filling out distance for indoor cycling workouts I do on a “dumb” spin-bike at my local gym. I’ve used 30 kph as a ballpark speed, as this is usually what I can do on a Zone 2 ride on a flat course.
I’ve created a custom activity field, that I want to use to override the icu distance, but it is not working. Any clue as to what I am missing here?
I probably also have to put in a statement that if distance is not present, fill out activity.icu_distance.
{
let v = activity.elapsed_time*8.33 // 8,33 m/s - 30 km/t
activity.icu_distance = v
v/1000
}
I’d like to revive this old thread.
Has there been any progress on being able to automate editing of the activity.icu_distance field?
For indoor trainer activities, I’d like to replace the default distance with a different value calculated from a Computed Activity Field, rather than using the (essentially meaningless) virtual distance reported by the trainer/platform.
What is the name of your custom field?
I can add it to the list of automated updates on my AutoMate app as its a setup once and will be automated thereafter. It’s currently working for eFTP.
Hi Gerald,
The custom field is called Trainer Equivalent Distance.
It calculates an outdoor-equivalent distance for VirtualRide activities based on elapsed time and average power, with a 0.70 factor to account for the cleaner indoor environment.
The goal is specifically to replace the meaningless virtual/trainer distance with a more useful value for drivetrain maintenance.
Thanks — this sounds like exactly what I was looking for!
Please give me a few days. I’m busy migrating from WhatsApp to a WebApp interface, for the UI on my app.
Will create a custom field and enter a value to be able to test. Once deployed, I’ll let you know.
Hi @MTreys,
I’ve tested the workflow and it’s working; on one ride only.
I have two questions before deploying it:
- Keep a note of the original? Should AutoMate add a line to the ride’s description, such as “Trainer distance of 28.73 km replaced with TrainerEqDist 18.24 km”? This way there will be a “record” of the change, by adding a line to every indoor ride. If someone else uses this, and wants to revert to the original distance, they know what it was.
- Past rides? Should there be a “Fix the last N days” button (like the ImReady4 readiness backfill), or only new rides from now on?
Hi Gerald,
Thanks for working on it!
I think indeed it makes sense keeping track of the original distance in a note.
As for the option to fix the past rides, it would be super useful, provided that it doesn’t require to reprocess original files : when the activity has been modified (cropped, redefined intervals…) reprocessing files revert them back to their original state and that could be a mess.
Looking forward to testing it, thanks again!
Thanks, that’s helpful. A note with the original distance it is; anticipated and coded for already.
Fixing past rides won’t reprocess anything. AutoMate doesn’t touch the original files. It reads the ride’s data from Intervals and changes only the distance value (and average speed) through the API, the same as editing the distance by hand in the activity. Think of it as a change by hand, but automatically after an activity is uploaded, providing you’ve connected your account through my app. I tested it on one of my own indoor rides: the distance and average speed changed, and nothing else did. I can even include an undo button, for in-case. Dedected intervals stay exactly as they are, but I’ll confirm about a cropped ride as I don’t usually crop my rides.
For older rides there’s one more thing. Intervals only fills in a computed field when it calculates it, so rides from before you created the field have no value. Rather than asking you to recompute them (which might involve reprocessing), AutoMate would work out the same formula itself from each ride’s power data, so nothing needs recomputing on your side. Again, it’s the automated workflow of a manual process of changing the distance, which changes the average speed.
One honest point about the formula, so it’s clear where it comes from: AutoMate would automate your script exactly as you wrote it. It treats speed as rising in a straight line with power, whereas outdoors air resistance makes speed rise much more slowly. I checked for my indoor rides for the last 365 days, and at endurance power it gives a distance that is a lot less than I’d ride at, on a real road. Your script may be exactly what you want as a fixed yardstick, but I don’t want anyone to think the adjusted numbers are mine; so it will state that on the page with a toggle for “on/off”.
Separately, I’m testing a physics-based option (my own bike, ride position, tyres/pressures). I’m going to calibrate on my road bike (dual recording with both power meters), which could be offered as an alternative later.
I’ll let you know when it’s ready to test, probably tomorrow evening as the script is ready, I just need to work on a few things, like the additional card on the Intervals-settings page.
edit:
Here’s a quick view of the page. It’s a setup once application, but does show your most recent changes.
It’s live, you can test
Click on Settings - then on Indoor Distance
Let me know if anything needs to change.
Works like a charm, thanks a lot for the quick implementation!
I’ll let you know if I can think of other automations that could be useful for BaieSukkel
Of course, I realise that the formula I came up with is extremely simplistic: it simply extrapolates linearly from a single reference point (200 W → 30 km/h) and applies a reduced wear factor of 0.7 to account for the cleaner indoor environment.
The purpose was simply to have a meaningful distance figure for indoor rides (which can add up quickly), bringing them somewhat closer to what would have been ridden outdoors, while counting less mileage towards periodic drivetrain maintenance. I currently have a re-waxing reminder set at around 800 km for my chains.
But of course, the formula could be reconsidered or optimised to better reflect real-world physics. For example, if the goal is to estimate an equivalent outdoor distance from power, we could take rolling resistance and aerodynamic drag into account rather than assuming a simple linear relationship between power and speed.
Thanks to your automation tool, it should be easy to change the formula and recalculate all past rides if we come up with a better model.
Please let me know your thoughts!


