Fan Control
Plugins can expose fan speed control and temperature reporting to SignalRGB’s Cooling system. When enabled, users can set fan curves, monitor RPM, and view temperature readings directly in SignalRGB.
The general pattern for a plugin that supports fan control is:
- Export
SupportsFanControl()returningtrueto tell SignalRGB this device has controllable fans. - Detect which fans are connected (via device-specific commands or RPM polling).
- Call
device.createFanControl()for each detected fan inInitialize(). - Each frame in
Render(): read the current RPM from the device and report it withdevice.setRPM(), then read the desired speed fromdevice.getFanLevel()and apply it to the device.
Always check device.fanControlDisabled() before calling any fan level functions. Fan control may be unavailable because the user doesn’t have SignalRGB Pro, or because the user has disabled it manually.
Plugin Export
Section titled “Plugin Export”SupportsFanControl()
Section titled “SupportsFanControl()”Exported from the plugin to declare that this device supports fan control. SignalRGB calls this during initialization to decide whether to show the Cooling UI for the device.
export function SupportsFanControl() { return true; }If this export is absent or returns false, the fan control API is still accessible but the Cooling UI will not appear for the device.
Fan Controller Methods
Section titled “Fan Controller Methods”device.fanControlDisabled()
Section titled “device.fanControlDisabled()”Returns true if fan control is currently unavailable — either because the user doesn’t have SignalRGB Pro, or the user has manually disabled the Cooling system.
Always check this before calling device.getFanLevel() or device.getNormalizedFanLevel().
| Return | Type | Description |
|---|---|---|
| Disabled | boolean | true if the Cooling API is unavailable |
if (device.fanControlDisabled()) { return;}device.createFanControl(fanId)
Section titled “device.createFanControl(fanId)”Creates a fan controller with the given ID. Call this in Initialize() for each fan the device exposes. If a controller with the given ID already exists, the call is ignored.
| Parameter | Type | Description | Example |
|---|---|---|---|
| FanId | string | Unique identifier for this fan controller | "Fan1" |
device.createFanControl("Fan1");device.createFanControl("Fan2");device.removeFanControl(fanId)
Section titled “device.removeFanControl(fanId)”Removes the fan controller with the given ID. Use this if a fan is no longer detected or the device disconnects.
| Parameter | Type | Description | Example |
|---|---|---|---|
| FanId | string | ID of the fan controller to remove | "Fan1" |
device.getFanLevel(fanId)
Section titled “device.getFanLevel(fanId)”Returns the desired fan speed for the given fan controller as a percentage (0–100), derived from the user’s current fan curve settings.
| Parameter | Type | Description | Example |
|---|---|---|---|
| FanId | string | Fan controller ID | "Fan1" |
| Return | Type | Description | Example |
|---|---|---|---|
| FanSpeed | int | Desired speed, 0–100 | 42 |
let speed = device.getFanLevel("Fan1"); // e.g. 42 (meaning 42%)device.getNormalizedFanLevel(fanId)
Section titled “device.getNormalizedFanLevel(fanId)”Returns the desired fan speed as a normalized float (0.0–1.0). Useful when the device expects a fractional duty cycle rather than a percentage.
| Parameter | Type | Description | Example |
|---|---|---|---|
| FanId | string | Fan controller ID | "Fan1" |
| Return | Type | Description | Example |
|---|---|---|---|
| FanSpeed | float | Desired speed, 0.0–1.0 | 0.42 |
let speed = device.getNormalizedFanLevel("Fan1"); // e.g. 0.42device.setRPM(fanId, rpm)
Section titled “device.setRPM(fanId, rpm)”Reports the current measured RPM for a fan controller. This value is displayed in the Cooling UI and system monitoring graphs.
| Parameter | Type | Description | Example |
|---|---|---|---|
| FanId | string | Fan controller ID | "Fan1" |
| RPM | int | Current fan speed in RPM | 1337 |
let rpm = ReadRPMFromDevice("Fan1");device.setRPM("Fan1", rpm);Temperature Sensor Methods
Section titled “Temperature Sensor Methods”Plugins can also expose temperature readings to SignalRGB’s Cooling system. These values appear in system monitoring and can be used as the input source for fan curves.
device.createTemperatureSensor(sensorId)
Section titled “device.createTemperatureSensor(sensorId)”Creates a temperature sensor with the given ID. Call this in Initialize() for each temperature source the device exposes.
| Parameter | Type | Description | Example |
|---|---|---|---|
| SensorId | string | Unique identifier for this sensor | "Coolant Temp" |
device.createTemperatureSensor("Coolant Temp");device.removeTemperatureSensor(sensorId)
Section titled “device.removeTemperatureSensor(sensorId)”Removes the temperature sensor with the given ID.
| Parameter | Type | Description | Example |
|---|---|---|---|
| SensorId | string | ID of the sensor to remove | "Coolant Temp" |
device.SetTemperature(sensorId, temperature)
Section titled “device.SetTemperature(sensorId, temperature)”Reports the current temperature for the given sensor. Call this each frame after reading the value from the device.
| Parameter | Type | Description | Example |
|---|---|---|---|
| SensorId | string | Sensor ID | "Coolant Temp" |
| Temperature | float | Current temperature in degrees Celsius | 34.5 |
let temp = ReadTemperatureFromDevice();device.SetTemperature("Coolant Temp", temp);Full Example
Section titled “Full Example”export function SupportsFanControl() { return true; }
export function Initialize() { device.createFanControl("Fan1"); device.createFanControl("Fan2"); device.createTemperatureSensor("Coolant Temp");}
export function Render() { // Report current RPM — required every frame or speed will hardlock device.setRPM("Fan1", ReadRPM(1)); device.setRPM("Fan2", ReadRPM(2));
// Report current temperature device.SetTemperature("Coolant Temp", ReadTemp());
// Apply desired speed to hardware if (!device.fanControlDisabled()) { SetDeviceFanSpeed(1, device.getFanLevel("Fan1")); SetDeviceFanSpeed(2, device.getFanLevel("Fan2")); }}
export function Shutdown() { device.removeFanControl("Fan1"); device.removeFanControl("Fan2"); device.removeTemperatureSensor("Coolant Temp");}