Hello, I am the same as you, I find it very interesting but the tool is not correct enough for my use, since like you, I also train for power, it would be interesting if I could do it by power zones or better yet, for a % of the FTP value.
Regarding this type of issue, I have already made a request to the creator through Github. Here my petition: Support workouts based on % FTP · Issue #5 · h3xh0und/intervals.icu-api · GitHub
Regarding the second section you mention, swimming, the problem is not the generation of your code but the code of the import tool, I was fighting and I found the reason, let me show you:
formatted_data.append({
"start_date_local": training["date"] + "T00:00:00",
"category": "WORKOUT",
"name": training["name"],
"description": "\n".join(description_lines).strip(),
"type": "Ride" if "Bike" in training["name"] else "Run" if "Run" in training["name"] else "Swim",
"moving_time": sum(
convert_duration(step["duration"]) for step in expanded_steps
),
"steps": expanded_steps
“type”: “Ride” if “Bike” in training[“name”] else “Run” if “Run” in training[“name”] else “Swim”
What this code does is that when you run the script, if the activity has the word ‘Bike’ as part of the training then it will be training of type ‘Bike’; if you have the word ‘Run’ as part of the training then it will be ‘Run’ type training; If it does not meet any of the other conditions then it will always be of type ‘swimming’.
This is how it is implemented in the code, so regardless of the format and type of your JSON, when you run that script and upload it to your Intervals.icu it will change it.
For the latter, regarding the type of training there is no major problem than editing the code, even if you are not familiar with the code (I am not) it is as simple as changing that part and making it always ‘Bike’.
For the power part, I have not been able to modify the code, I have been testing but without success… let’s see if the creator of the project or someone with knowledge can help us.