Skip to main content

Widget types

WidgetKindData types (usual first)Device sends withDevice receives with
ButtonControlBoolean, Integeriot.button()iot.onButton()
SwitchControlBoolean, Integer—iot.onSwitch()
LEDDisplay, can controlBoolean, Integeriot.led()iot.onLED()
SliderControlFloat, Integeriot.slider()iot.onSlider()
GaugeDisplayFloat, Integeriot.gauge()—
ChartDisplay, with historyFloat, Integeriot.chart()—
Value DisplayDisplayFloat, Integer, String, Booleaniot.display()iot.onValue()
LabelDisplayString, Integer, Float, Booleaniot.label()—
TerminalBothStringiot.terminal()iot.onTerminal() (commands are sent once)
RGBControlStructured—iot.onRGB()
TimerControlStructured—iot.onTimer()
MapDisplayStructurediot.map()—
JoystickControlStructured—iot.onJoystick()
Status (Status Indicator)DisplayFloat, Integer, String, Booleaniot.status()—
Selector (Dropdown)ControlInteger, String, Floatiot.selector()iot.onSelector(), iot.onSelectorText()
Number InputControlFloat, Integeriot.numberInput()iot.onNumberInput()
Progress BarDisplayFloat, Integeriot.progress()—
Text InputControlString—iot.onTextInput()
KeypadControlInteger, String, Float—iot.onKeypad(), iot.onKeypadText()
Text (Note)Fixed text———
Computed ValueSummary———
Event LogSummary———
Multi ChartSummary———
Table (List)Summary———

Notes​

  • Boolean values travel as 1 and 0.
  • Structured widgets carry extra fields besides the value, such as colour channels or coordinates; see MQTT protocol.
  • Summary widgets have no pin of their own. They work from the device's other widgets: a formula (Computed Value), a list of recent changes (Event Log), several pins on one chart (Multi Chart), or every widget in a table (Table).
  • Keypad, Text Input and Terminal commands are sent once. Other controls are kept by the broker, so a device that was offline gets its latest settings when it reconnects; these one-off commands are not repeated.
  • Charts and alerts use numbers only. A widget set to String does not appear in charts and cannot trigger alerts.
  • Any widget can also be sent to with iot.publish("Type", "V1", value) and received with iot.onWidget("Type", "V1", cb) or iot.onWidgetText(...).

Where each widget is set up and used: