Skip to content
Stand with Ukraine flag

Led Indicator

The Led indicator widget provides a visual representation of a device’s current state using a colored LED icon. It subscribes to attribute or time-series data, or polls the device via RPC, and lights up or dims to reflect the current ON/OFF state.

The LED indicator follows two functional principles:

  1. State detection — on dashboard load, the widget reads the current device state from a configured source (RPC call, attribute subscription, or time-series subscription) and sets the LED to the matching color.
  2. Real-time update — when the device state changes externally, the widget receives the update and adjusts the LED color immediately, without any page reload.
  • LED title and active color are independently configurable.
  • Three state sources: RPC poll, attribute subscription, or time-series subscription.
  • Custom f(data) converter transforms raw attribute, telemetry, or RPC values into a boolean ON/OFF state.
  • Configurable fallback state when no data is available.
  1. Open the dashboard in edit mode. Click Add widget in the top toolbar, or click the Add new widget icon in the center of an empty dashboard.
  2. In the widget bundle selection dialog, find and click Control widgets.
  3. Select the Led indicator widget.
  4. Configure the datasource, appearance, and value settings, then click Add.

All settings in this section use Basic mode — a quick-start configuration covering the essentials. For finer widget controls like title font, card style, and tooltip, switch to the Advanced tab.

Select the source of state data:

  • Device — a specific device; the widget reads state for this device.
  • Entity alias — a set of entities matched by an entity alias; use this when the target device is selected dynamically at runtime.

Controls the LED label, color, and fallback message.

SettingDescription
”No data to display” alternative messageFallback text shown when the entity state data is unavailable.
LED titleLabel displayed above the LED icon, like Ventilation or Power.
LED colorColor of the LED when it is in the active (ON) state. The LED is gray when inactive (OFF).

Defines how the widget determines the current ON/OFF state.

Initial value — the default state shown when no data has been received yet. Checked means ON, unchecked means OFF.

Check status settings — how the widget reads the current device state:

ModeDescriptionConfiguration
Perform RPC device status check enabledExecutes an RPC call to fetch device status on load.RPC Method: e.g. checkStatus
Perform RPC device status check disabledSubscribes to device data updates.Retrieve LED status value using: Subscribe for attribute (e.g. powerState) or Subscribe for time series (e.g. led_state)

Parse LED status value function f(data) — a JavaScript function that converts the raw attribute, time-series, or RPC response value into a boolean. Return true for ON, false for OFF.

return data ? true : false;

Summary of LED state sources:

Source typeDescriptionExample
RPCPolls the device using a configured RPC method.checkStatus() returns true
AttributeSubscribes to attribute updates.shared.powerState = true
Time seriesReads the latest telemetry value.led_state = 1
SettingDescription
BackgroundSolid color or image background for the card.
Show card buttonsEnable the Fullscreen toolbar button.
Card border radiusCorner rounding in pixels.
Card paddingSpacing between card content and its border.

The Led indicator supports the Widget header button action — a button placed in the widget header that triggers a configured action when clicked.

Scenario: A Ventilation Relay device maintains a shared attribute powerState (Boolean). When powerState = true, the relay is ON; when powerState = false, the relay is OFF.

Goal: Add a Led indicator widget that reads powerState and shows a green LED when the relay is ON, and a gray LED when it is OFF.

Prerequisites: Create a device named Ventilation Relay and add a shared attribute:

  • Key name: powerState
  • Data type: Boolean
  • Value: true

Step 1. Add the widget. Open the dashboard in edit mode, click Add widget, select Control widgets, then choose Led indicator.

Step 2. Configure the datasource. Set Datasource type to Device, then select Ventilation Relay.

Step 3. Configure appearance. In the Appearance tab, set the following:

  • “No data to display” alternative message: No telemetry available
  • LED title: Ventilation LED
  • LED color: #4CAF50

Step 4. Configure value settings. In the Value settings section, set the following:

  • Initial value: Unchecked (OFF)
  • Perform RPC device status check: Disabled
  • Retrieve LED status value using: Subscribe for attribute
  • Device attribute containing LED status value: powerState
  • Parse LED status value function: return data ? true : false;

Step 5. Save. Click Add, resize and reposition as needed, then click Save on the dashboard toolbar.

Result: The widget reads powerState from the Ventilation Relay device. If powerState = true, the LED glows green, indicating the relay is ON. If powerState = false, the LED is gray, indicating the relay is OFF.

Interaction: Add a Single switch widget to the same dashboard to control the powerState attribute directly. Flipping the switch to ON sets powerState = true and the LED turns green; flipping to OFF sets powerState = false and the LED turns gray.

LED does not reflect the correct state

CauseSolution
Wrong attribute key or subscription typeVerify the key name in value settings. If using an attribute, select Subscribe for attribute; if using telemetry, select Subscribe for time series. Names are case-sensitive.
Parse function returns wrong valueCheck the f(data) function returns true or false correctly for the expected data values.
Attribute not set on deviceOpen Devices → Attributes and confirm the attribute exists and has a value.

LED stays gray even when the device is ON

CauseSolution
No data received yetVerify the device is connected and sending data. Check the attribute or time-series key name matches what the device publishes.
Initial value unchecked and data not yet loadedWait for the first data update from the device, or set Initial value to Checked as a temporary placeholder.

LED does not update when device state changes

CauseSolution
RPC mode used instead of subscriptionRPC mode only polls on dashboard load — it does not subscribe to updates. Switch to Subscribe for attribute or Subscribe for time series if you need real-time updates.
Wrong subscription typeUse Subscribe for attribute for shared or client attributes; use Subscribe for time series for telemetry keys.