Skip to content
Stand with Ukraine flag

Led indicator

  • Widget
  • v1.0.0
  • Sep 1, 2026
  • MIT license
  • v4.2+ | Built-in
Led indicator

Visualize the state of the device. Fetches the value from the device from the attribute or using RPC.

Widget Type
  • Control
Category
  • Gauges & Indicators
  • Controls
Use Cases
  • Industrial Automation
  • SCADA
  • Smart Building

Who it’s for

Anyone building a control panel that needs a lamp — the indicator beside a switch confirming that the thing actually turned on, a run light on a mimic diagram, a fault lamp on a machine overview. The reader expects a lamp to reflect the equipment, not the command that was sent to it.

What it does

The LED indicator lights or darkens a colored lamp according to a value read back from the device. It can subscribe to an attribute or a time series key, or actively call an RPC method to ask the device its status, with a parse function turning whatever comes back into lit or unlit.

  • The lamp reads the device, not the dashboard — an RPC status check confirms the actual state rather than echoing the last command.
  • Three ways to get the state: subscribe to an attribute, subscribe to a time series key, or call an RPC method on a schedule.
  • A parse function converts any response shape into the on or off the lamp needs, so no upstream translation is required.
  • The lamp title and color are set directly, so a bank of lamps can use the color conventions the panel already follows.
  • Persistent RPC is supported with a polling interval, for devices that answer asynchronously rather than in the request.
  • An initial value decides what the lamp shows before the first response arrives.
  • The LED indicator is an indicator: it sends no commands and changes nothing, so the switching belongs on a switch or button widget beside it.

How to set up

Data keys

The LED indicator takes its state from a subscription or an RPC status check rather than from the datasource key list.

AttributeScopeOperationDescription
Configured keyAnyReadWith Subscribe for attribute selected, the lamp follows this attribute. Subscribe for time series follows a telemetry key instead.
MethodDirectionParametersSent when
Status check methodTwo-way (request-response)As configuredWith Perform RPC device status check on, this method is called to ask the device its current state.

Behavior

SettingDefaultEffect
Initial valueUnsetWhat the lamp shows before the first reading arrives
Perform RPC device status checkOffActively polls the device instead of subscribing
Retrieve led status value using methodUnsetThe RPC method called for the status check
Parse led status value functionUnsetConverts the response into lit or unlit
RPC request timeoutPlatform defaultHow long a status check waits
RPC request persistentOffFor devices answering asynchronously, with a polling interval

Prefer a subscription over an RPC status check where the device already reports its state. A subscription costs nothing and updates immediately, while polling adds traffic to every device on the dashboard and is only necessary when the device answers questions but volunteers nothing.

How to customize

  • To follow reported state instead of polling — select Subscribe for attribute or Subscribe for time series and name the key.
  • To ask the device directly — turn on Perform RPC device status check and set the method it answers.
  • To handle a non-boolean response — supply a Parse led status value function returning true or false.
  • To match the panel’s conventions — set the LED color and the LED title.
  • To decide what shows before the first reading — set the Initial value.
  • To support a slow device — turn on RPC request persistent and set the polling interval for the command response.
  • To fail faster on an unreachable device — lower the RPC request timeout.

Tips

  • Pair every switch with a lamp fed from the device rather than from the switch. The pair is what tells an operator that a command was not merely sent but acted on, and that distinction is the entire reason a physical panel has both.
  • Set the initial value to the safe assumption rather than to off. A lamp that shows dark before the first reading arrives is indistinguishable from a lamp reporting that the equipment is stopped, and on a fault indicator that is the wrong way round.

Share Your Widget with the Community

Built a custom widget? Export it as a JSON from ThingsBoard and publish it to the IoT Hub through a simple 4-step wizard (Upload, Listing, Readme, Review & Submit). Share it with thousands of ThingsBoard developers worldwide and get featured in the catalog.