Dynamic Widget Params

Dynamic parameters for device widgets

Overview

The Device Monitoring Dashboard — configured per Device Model in the Models area — supports several Widget types. Most Widgets are configured with static values (which Telemetry key to render, the display unit, scale, etc.). A few support dynamic parameters, where the Widget reads its configuration from the Device's Configuration or Details at view time.

Widgets that currently support dynamic parameters:

  1. Spline Chart.

Spline Chart

Static setup

In static mode, the manufacturer defines the list of measurements to plot, identical for every Device of the Device Model. Each measurement has:


  1. Display Name — measurement label shown to the End Customer.
  2. Telemetry — Telemetry key tracked by this measurement (must be numeric).
  3. Unit(optional) unit shown next to the value.

Dynamic setup

Dynamic mode lets the measurement list adapt per Device, driven by that Device's Configuration or Details. This avoids noisy charts where most measurements are inactive.

For example, a Device Model that supports up to 10 temperature sensors might emit Telemetry keys temperature_1temperature_10. In static mode you'd plot all 10 lines, even on Devices that have only two sensors installed. Switching the Spline Chart to dynamic mode lets each Device advertise only the sensors actually present — see Data Types.

The Device's measurement list is a JSON array of objects, each with the following keys:

KeyTypeDescription
namestringMeasurement label shown to the End Customer.
unitstring(Optional.) Unit shown next to the value.
telemetrystringName of the Telemetry key emitted by the Device for this measurement.
descriptionstring(Optional.) Longer description. Reserved for future use; not currently displayed.

The array can live anywhere in the Device's Configuration or Details — including deeply nested locations — see Data Types. The Widget's Path field is the dotted path to that array.

For example, given the following Configuration JSON:

{
  "inputs": 10,
  "sensors": [
    {
      "temperature": [
        {
          "name": "Outside porch",
          "unit": "c",
          "telemetry": "temperature_outside_3",
          "description": "Outside porch temperature sensor"
        },
        {
          "name": "Living room",
          "unit": "c",
          "telemetry": "temperature_inside_2",
          "description": "Living room sensor"
        }
      ]
    }
  ]
}

The Path parameter would be config.sensors[0].temperature, where:

  1. config — pull from the Configuration object (use details to pull from the Device's Details instead).
  2. sensors — the sensors key.
  3. sensors[0] — the first element of the sensors array.
  4. temperature — the temperature key of that element.

When the End User opens the Device view, the Widget reads this path and renders only the measurements declared on that specific Device.