Skip to main content

Gauge Widget

Widget Type: rc-gauge

Gauge

A digital readout for a numeric telemetry value. The value is updated from a telemetry source via an expression.

Configuration

mode (optional) Display mode. Currently only digital is supported. Defaults to digital.

label (optional) Label shown above the value.

units (optional) Units shown next to the value (e.g. m/s, °C).

precision (optional) Number of decimal places to display. Defaults to 2.

min (optional) Minimum of the displayed range. Defaults to 0.

max (optional) Maximum of the displayed range. Defaults to 0.

timeoutMs (optional) Time without an update before the value is dimmed/timed out. Defaults to 5000.

valueSource Telemetry source that provides the value.

  • sourceType: telemetry
  • source: telemetry path (include an interval, e.g. int=1s)
  • expression: stringified JavaScript function returning the numeric value

Example

{
"mode": "digital",
"label": "Wind Speed",
"units": "m/s",
"precision": 2,
"min": 0,
"max": 30,
"timeoutMs": 5000,
"valueSource": {
"sourceType": "telemetry",
"source": "/rocos/agent/telemetry/heartbeat?int=1s",
"expression": "(msg) => msg.payload?.wind_speed ?? 0"
}
}