Skip to content

feat(ios): derive Fake Treadmill speed from Apple Watch cadence - #4594

Merged
cagnulein merged 3 commits into
cagnulein:masterfrom
miraicat:applewatch-as-treadmill-speed
Apr 30, 2026
Merged

feat(ios): derive Fake Treadmill speed from Apple Watch cadence#4594
cagnulein merged 3 commits into
cagnulein:masterfrom
miraicat:applewatch-as-treadmill-speed

Conversation

@miraicat

@miraicat miraicat commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

Hi Roberto — thanks for the quick reply and for inviting the PR.

Summary

This adds an opt-in iOS setting, applewatch_as_treadmill_speed (default off), to derive treadmill Speed from Apple Watch step cadence when Fake Treadmill mode is enabled.

The feature reuses the existing Apple Watch cadence path in treadmill::cadenceFromAppleWatch(), the existing cadence_sensor_speed_ratio ("Wheel Ratio") multiplier, and the existing virtual treadmill / RSC broadcast pipeline.

Use case

This is for indoor walking or slow jogging without a physical treadmill, while broadcasting to apps like Kinomap or Zwift via FTMS / RSC.

Apple Watch cadence is already available in QZ on iOS, but without a real treadmill there was no path to convert that cadence into broadcast Speed, so users had to adjust the Speed tile manually.

Design

  • Default off, so existing users should see no behavior change.
  • Dual-gated behind both applewatch_as_treadmill_speed and fakedevice_treadmill.
  • Normal treadmill users are unaffected unless they explicitly enable both settings.
  • Reuses the existing cadence_sensor_speed_ratio setting instead of adding another ratio control.
  • When cadence reports exactly 0, Speed is also set to 0 so the virtual treadmill broadcast does not keep ghosting the previous speed.
  • Negative cadence is treated as "no fresh sample" and leaves Speed unchanged.
  • A defensive ratio clamp prevents a misconfigured negative Wheel Ratio from producing negative speed.
  • Per src/CLAUDE.md, the new setting is appended at the end of the settings.qml Settings block and allSettingsCount is bumped from 882 to 883.

UI

The toggle is placed next to "Fake Treadmill" in Experimental Features, since this feature requires Fake Treadmill mode.

The help text points users to Accessories > Cadence Sensor Options and suggests a Wheel Ratio around 0.025-0.04 for walking / slow jogging. The existing cycling default of 0.33 would be too high for this use case.

Testing plan

  • iOS CI compiles cleanly
  • Toggle off -> no new speed derivation
  • Toggle on + Fake Treadmill on + walking with Apple Watch -> Speed updates from cadence x Wheel Ratio
  • Toggle on + walking, then stop -> Speed drops to 0
  • Toggle on + Fake Treadmill off -> Speed is unaffected

I have not been able to compile-verify locally because I do not have a Qt 5.15.2 + iOS toolchain set up, so I am relying on CI. Happy to iterate on anything that breaks or that you would like reshaped.

Related

…eadmill mode

Adds opt-in setting `applewatch_as_treadmill_speed` (default off) that
derives Speed from Apple Watch step cadence inside cadenceFromAppleWatch()
when fakedevice_treadmill is also enabled. Reuses cadence_sensor_speed_ratio
("Wheel Ratio") for the multiplier and the existing virtual treadmill / RSC
broadcast pipeline. Useful for indoor walking and slow jogging with apps like
Kinomap or Zwift when no physical treadmill is connected.

Dual-gated behind both new toggles so normal treadmill users are unaffected.
When cadence reports exactly zero (user stopped), Speed is also zeroed; a
negative cadence (no fresh sample) leaves Speed unchanged. Settings appended
at the end of qzsettings and settings.qml per src/CLAUDE.md.
@cagnulein

Copy link
Copy Markdown
Owner

Thanks @miraicat the patch looks great, I will build an ios version tomorrow!

@cagnulein

Copy link
Copy Markdown
Owner

sent the version!

@miraicat

Copy link
Copy Markdown
Contributor Author

Tested on the TestFlight build. Slow jogging at ~180 spm (Apple Watch cadence) — Speed correctly derived from cadence. With Wheel Ratio at 0.046, getting ~4.1 km/h, pace and cadence numbers all consistent. Verified end-to-end with both Zwift and Kinomap on MacBook receiving over BLE FTMS — both work. Thanks for the quick turnaround!

@miraicat

miraicat commented Apr 30, 2026

Copy link
Copy Markdown
Contributor Author

Quick follow-up: pushed a one-line help text correction (545f56e). Real-world testing showed the original 0.025-0.04 Wheel Ratio range was below typical slow jog speeds at 180 spm cadence (max ~3.6 km/h). Updated to 0.04-0.15 which covers walking through running.

… help text

Real-world testing showed the original 0.025-0.04 range was below
typical slow jog speeds at 180 spm cadence (max ~3.6 km/h). Updated
to 0.04-0.15 which covers walking through running.
@miraicat
miraicat force-pushed the applewatch-as-treadmill-speed branch from deba85e to 545f56e Compare April 30, 2026 11:57
@cagnulein cagnulein added this to the 2.21 milestone Apr 30, 2026
@cagnulein

Copy link
Copy Markdown
Owner

that's great!

@cagnulein
cagnulein merged commit f964d67 into cagnulein:master Apr 30, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants