Node-RED UI Level Indicator

0.1.46 · active · verified Wed Apr 22

node-red-contrib-ui-level is a custom Node-RED node designed to provide a linear level indicator widget for the Node-RED Dashboard. It enables users to visually represent numerical data as a customizable bar graph. The current stable version provided is 0.1.46. This node is part of the Node-RED ecosystem, typically seeing updates driven by Node-RED and Node-RED Dashboard releases, and new feature additions. Key differentiators include its support for three layouts (Single Horizontal, Pair Horizontal, Single Vertical), extensive color customization options (multiple segments, single color, interpolated), an optional 'Peak mode' with adjustable hold times, and dynamic configuration of properties like min/max values, segments, and labels via `msg.control` inputs. It also offers multiple stripe resolutions and animation options, providing flexibility for various dashboard designs.

Common errors

Warnings

Install

Imports

Quickstart

This conceptual code demonstrates how `msg.payload` and `msg.control` properties are structured and sent to a Node-RED UI Level node to update its display, dynamically adjust parameters, and control features like peak mode.

// Conceptual JavaScript to simulate messages for the UI Level node
// In Node-RED, you would use an Inject node connected to a UI Level node.

function simulateFlow() {
  // Scenario 1: Basic value update
  let msg1 = { payload: 42 };
  console.log('Sending basic value:', msg1.payload);
  // In Node-RED, this 'msg1' would go to the 'ui-level' node's input.

  // Scenario 2: Change min/max and segment values dynamically
  let msg2 = {
    payload: 75,
    control: { min: 0, max: 100, seg1: 25, seg2: 50, seg3: 75 }
  };
  console.log('Sending value with dynamic control:', msg2.payload, msg2.control);
  // This 'msg2' updates the level, its range, and segment thresholds.

  // Scenario 3: Update label dynamically
  let msg3 = {
    payload: 12.3,
    control: { label: 'Pressure (PSI)' }
  };
  console.log('Sending value with dynamic label:', msg3.payload, msg3.control.label);

  // Scenario 4: Reset peak mode (if enabled)
  let msg4 = {
    payload: 90,
    control: { peakreset: true }
  };
  console.log('Sending value and resetting peak:', msg4.payload);
}

simulateFlow();

view raw JSON →