Skip to main content

Sensors Data Provider

Sensor data transfer between iCUE and HTML widgets: sensor types, units, values, device names, and more.

Overview

  • Module name: widgetbuilder.sensorsdataprovider
  • Plugin name: Sensors
  • Version: 1.0

Manifest entry:

"required_plugins": [
  "widgetbuilder.sensorsdataprovider:Sensors:1.0"
]

All data retrieval methods are asynchronous using requestId for correlation.

Async Request Pattern

  1. Call a method with unique requestId
  2. Listen for asyncResponse(requestId, value) signal
  3. Match response requestId to request
let nextRequestId = 0;
const requestId = nextRequestId++;
window.plugins.Sensorsdataprovider.asyncResponse.connect((id, value) => {
    if (id === requestId) {
        console.log("Sensor value:", value);
    }
});
window.plugins.Sensorsdataprovider.getSensorValue(requestId, sensorId);

Methods

getSensorValue(requestId, sensorId)

Gets current sensor value.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: string

getSensorUnits(requestId, sensorId)

Gets units of measurement.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: string (e.g., "C", "%", "RPM")

getSensorName(requestId, sensorId)

Gets sensor display name.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: string

getSensorDeviceName(requestId, sensorId)

Gets device name containing the sensor.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: string

getSensorType(requestId, sensorId)

Gets sensor type.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: string - See sensor types

getSensorKind(requestId, sensorId)

Gets sensor kind/category.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: string - See sensor kind

getAllSensorIds(requestId)

Gets all available sensor identifiers.

ParameterTypeDescription
requestIdintRequest ID

Response: string[]

sensorIsConnected(requestId, sensorId)

Checks sensor availability.

ParameterTypeDescription
requestIdintRequest ID
sensorIdstringSensor identifier

Response: bool

getDefaultSensorId(requestId, sensorType, preferredSensorKind)

Gets default sensor ID for a given type with an optional preferred kind hint.

The lookup follows this priority order:

  1. First sensor matching both sensorType and preferredSensorKind
  2. First sensor matching sensorType only (if no kind match found)
  3. First available sensor of any type (if no type match found)

If preferredSensorKind is an empty string, the kind is not used as a filter and the first sensor matching sensorType is returned.

ParameterTypeDescription
requestIdintRequest ID
sensorTypestringSensor type (see sensor types)
preferredSensorKindstringPreferred sensor kind (see sensor kind). Pass "" to match any kind.

Response: string - Sensor ID, or empty string if no sensors are available


getDefaultSensorIdBlock(sensorType, preferredSensorKind)

Synchronously gets default sensor ID for a given type with an optional preferred kind hint. Blocking call.

Applies the same lookup priority as getDefaultSensorId.

ParameterTypeDescription
sensorTypestringSensor type (see sensor types)
preferredSensorKindstringPreferred sensor kind (see sensor kind). Pass "" to match any kind.

Returns: string - Sensor ID, or empty string if no sensors are available

Signals

asyncResponse(requestId, value)

Emitted when async method completes.

ParameterTypeDescription
requestIdintOriginal request ID
valuevarResponse value

sensorAdded(sensorId)

Emitted when new sensor becomes available.

ParameterTypeDescription
sensorIdstringAdded sensor ID

sensorRemoved(sensorId)

Emitted when sensor is no longer available.

ParameterTypeDescription
sensorIdstringRemoved sensor ID

sensorDataChanged(sensorId)

Emitted when sensor data changes.

ParameterTypeDescription
sensorIdstringChanged sensor ID

sensorValueChanged(sensorId, value)

Emitted when sensor value changes.

ParameterTypeDescription
sensorIdstringSensor ID
valuestringNew sensor value

sensorUnitsChanged(sensorId, units)

Emitted when sensor units change (e.g., Celsius to Fahrenheit).

ParameterTypeDescription
sensorIdstringSensor ID
unitsstringNew units

SimpleSensorApiWrapper

Promise-based wrapper for the Sensors plugin. Converts the callback-based Qt async API into Promises.

Important: Use Local Wrapper Files

Copy common/plugins/ from the documentation bundle into your widget folder and include wrappers via local <script src> paths.

Do not reference iCUE installation paths (for example ../common/plugins/...) in third-party widgets.

Initialization

const api = new SimpleSensorApiWrapper(sensorsplugin);
ParameterTypeDefaultDescription
pluginobject-Plugin instance (window.plugins.Sensorsdataprovider)
timeoutMsnumber5000Request timeout (ms)

Methods

All methods return a Promise.

MethodReturnsDescription
getSensorValue(sensorId)Promise<string>Current sensor reading
getSensorUnits(sensorId)Promise<string>Units string (e.g. "°C", "RPM")
getSensorName(sensorId)Promise<string>Human-readable sensor name
getSensorDeviceName(sensorId)Promise<string>Device the sensor belongs to
getSensorType(sensorId)Promise<string>Sensor type identifier
getSensorKind(sensorId)Promise<string>Sensor kind
getAllSensorIds()Promise<string[]>All available sensor IDs
sensorIsConnected(sensorId)Promise<boolean>Whether sensor is active

Required local files

<script src="common/plugins/IcueWidgetApiWrapper.js"></script>
<script src="common/plugins/SimpleSensorApiWrapper.js"></script>

### Example

`manifest.json`

```json
"required_plugins": [
  "widgetbuilder.sensorsdataprovider:Sensors:1.0"
]

index.html

// After including IcueWidgetApiWrapper and SimpleSensorApiWrapper in <head>:
const sensorApi = new SimpleSensorApiWrapper(window.plugins.Sensorsdataprovider);

async function displayAllSensors() {
    const sensorIds = await sensorApi.getAllSensorIds();
    for (const sensorId of sensorIds) {
        const [name, value, units] = await Promise.all([
            sensorApi.getSensorName(sensorId),
            sensorApi.getSensorValue(sensorId),
            sensorApi.getSensorUnits(sensorId),
        ]);
        console.log(`${name}: ${value} ${units}`);
    }
}
displayAllSensors();

Appendixes

Sensor Types

ValueDescription
temperatureTemperature
pumpPump speed
fanFan speed
voltageVoltage
loadLoad/usage
ledLED (deprecated)
cas-latencyCAS latency (RAM)
command-rateCommand rate (RAM)
cycle-timeCycle time (RAM)
dram-frequencyDRAM frequency
ras-prechargeRAS precharge (RAM)
ras-to-cas-delayRAS to CAS delay (RAM)
currentCurrent
powerPower
battery-chargeBattery charge level
battery-statusBattery status
efficiencyEfficiency
fpsFrames per second
pin-protectPin protection

Sensor Kind

ValueDescription
defaultDefault
coreProcessor core
packageCPU package
power-inInput power
power-outOutput power
power-3-33.3V power
power-55V power
power-1212V power
total-power-drawTotal power consumption
voltage-batBattery voltage
voltage-coreCore voltage
voltage-inInput voltage
voltage-3-33.3V voltage
voltage-55V voltage
voltage-1212V voltage
voltage-vddVDD voltage (RAM)
voltage-vddqVDDQ voltage (RAM)
voltage-vppVPP voltage (RAM)
current-3-33.3V current
current-55V current
current-item-12v12V item current
current-item-12v-2x612V 2x6 current
current-12v12V current
current-item-atxATX current
current-item-sataSATA current
cpu-tempCPU temperature
gpu-tempGPU temperature
cpu-pumpCPU pump
gpu-pumpGPU pump
gpu-loadGPU load
pin-protect-statusPin protection status
pin-protect-currentPin protection current
pin-protectPin protection
memory-loadMemory load
frame-buffer-loadFrame buffer load
video-engine-loadVideo engine load
bus-interface-loadBus interface load
invalidInvalid kind