DuinrahaicDuinrahaic
Developer

WebSocket

WebSocket API reference for FitOSC

FitOSC exposes a read-only WebSocket server that broadcasts live treadmill telemetry and app state. External tools and overlays can connect to consume this data in real time.

The WebSocket server must be enabled in Integrations settings before it can be used.

Connecting

ws://localhost:6547

The server listens on port 6547 by default. The port can be changed in the Integrations settings. All messages are JSON with properties serialized in camelCase.

Message Format

Every message from the server follows this envelope:

{
  "type": "string",
  "data": {}
}
FieldTypeDescription
typestringThe message type: state, pong, or error.
dataobjectThe payload. Structure varies by type.

Commands

Clients can send commands to the server as JSON.

ping

{ "command": "ping" }

Server responds with:

{
  "type": "pong",
  "data": { "timestamp": 1700000000000 }
}

getstate

{ "command": "getstate" }

Server responds with a state message containing the current full app state.

Server Messages

state

Broadcast to all connected clients when state changes, and returned in response to getstate.

{
  "type": "state",
  "data": {
    "deviceName": "My Treadmill",
    "treadmillState": "Running",
    "unitSystem": "metric",
    "connections": {
      "bluetooth": "Connected",
      "vr": "Disconnected",
      "pulsoid": "Connected",
      "osc": "Disconnected"
    },
    "configuration": {
      "maxSpeed": 23.15,
      "minSpeed": 3.46,
      "speedIncrement": 0.58,
      "maxIncline": 9,
      "minIncline": 0,
      "inclineIncrement": 1,
      "speedUnit": "KPH"
    },
    "metrics": {
      "speed": { "value": 3.21, "unit": "KPH", "enabled": true },
      "avgSpeed": { "value": 3.10, "unit": "KPH", "enabled": true },
      "distance": { "value": 0.42, "unit": "KILOMETERS", "enabled": true },
      "incline": { "value": 1.0, "unit": "%", "enabled": true },
      "heartRate": { "value": 82, "unit": "BPM", "enabled": true },
      "elapsedTime": { "value": 480, "unit": "SECS", "enabled": true }
    },
    "walking": {
      "mode": "Dynamic",
      "velocity": 0.45,
      "horizontal": 0,
      "vertical": 0.45,
      "isManualOverride": false,
      "config": {
        "maxSpeed": 4.0,
        "walkingTrim": 1.25,
        "smoothingFactor": 0.8,
        "maxTurnAngle": 80,
        "updateIntervalMs": 12,
        "thumbstickRampSpeed": 0.05,
        "overrideSpeeds": [0, 0.25, 0.5, 0.75, 1],
        "currentOverrideIndex": 0
      }
    }
  }
}

Top-level Fields

FieldTypeDescription
deviceNamestring | nullBLE device name of the connected treadmill. null when no device is connected.
treadmillStatestringCurrent treadmill state. See Treadmill States.
unitSystemstringUnit system applied to all values in this payload. Either "metric" or "imperial".
connectionsobjectConnection status for each integration. See Connections.
configurationobject | nullHardware limits reported by the treadmill. null when disconnected. See Configuration.
metricsobjectLive telemetry in the user's preferred unit system. See Metrics.
walkingobjectWalking mode state and configuration. See Walking.

Treadmill States

ValueDescription
"Unknown"State cannot be determined.
"Stopped"Treadmill is stopped.
"Running"Treadmill belt is active.
"Paused"Treadmill is paused.

Connections

Each key in connections is one of the following string values:

ValueDescription
"Disconnected"Not connected.
"Connecting"Connection in progress.
"Connected"Successfully connected.
FieldDescription
bluetoothBLE treadmill connection status.
vrOpenVR/SteamVR runtime connection status.
pulsoidPulsoid heart rate monitor connection status.
oscVRChat OSC connection status.

Configuration

Hardware limits as reported by the treadmill over BLE. This field is null when no device is connected.

FieldTypeDescription
maxSpeednumberMaximum supported belt speed.
minSpeednumberMinimum supported belt speed.
speedIncrementnumberSpeed adjustment step size.
maxInclinenumberMaximum incline level (%).
minInclinenumberMinimum incline level (%).
inclineIncrementnumberIncline adjustment step size (%).
speedUnitstringSpeed unit for this payload. Either "KPH" or "MPH".

Metrics

metrics is a flat object where each key is a named metric. All values are already converted to the user's preferred unit system (as indicated by unitSystem). A metric is null if the connected device does not support it.

Each metric has the following shape:

FieldTypeDescription
valuenumberCurrent reading.
unitstringUnit label (e.g. "KPH", "BPM", "KCAL").
enabledbooleanWhether the device actively reports this metric.
KeyUnit (Metric)Unit (Imperial)Description
speedKPHMPHInstantaneous belt speed.
avgSpeedKPHMPHSession average speed.
distanceKILOMETERSMILESTotal distance traveled.
incline%%Current incline grade.
rampAngle%%Ramp angle.
elevationGainMETERSFEETCumulative elevation gained.
pacePACEPACEInstantaneous pace.
avgPacePACEPACESession average pace.
caloriesKCALKCALEstimated calories burned.
heartRateBPMBPMHeart rate.
metMETMETMetabolic equivalent.
elapsedTimeSECSSECSSession duration in seconds.
remainingTimeSECSSECSRemaining time in seconds (if set on treadmill).
forceOnBeltNEWTONSNEWTONSForce applied to the belt.
powerWATTSWATTSPower output.
stepCountSTEPSSTEPSTotal step count.

Walking

FieldTypeDescription
modestringActive walking mode: "Disabled", "Dynamic", or "Override".
velocitynumberCombined locomotion magnitude sent to VRChat (0.0 to 1.0).
horizontalnumberHorizontal (strafe) locomotion component (-1.0 to 1.0).
verticalnumberForward/backward locomotion component (0.0 to 1.0).
isManualOverridebooleantrue when a manual speed override is active.
configobjectActive walking configuration. See below.

Walking Config

FieldTypeDescription
maxSpeednumberReference speed used for locomotion normalization.
walkingTrimnumberSpeed multiplier applied to normalized output (0.02.0).
smoothingFactornumberLocomotion output smoothing factor (0.01.0).
maxTurnAnglenumberMaximum yaw angle before direction adjusts (degrees).
updateIntervalMsnumberOSC update interval in milliseconds.
thumbstickRampSpeednumberThumbstick speed ramp rate (0.010.5).
overrideSpeedsnumber[]Preset speeds for Override mode (0.01.0).
currentOverrideIndexnumberIndex of the active preset in overrideSpeeds.