Skip to content

Command Button

The Command button widget adds a one-click action control to any dashboard. Use it to send update a HMI Device attribute, or write a telemetry record with a single button press. Unlike toggle or power buttons, the Command button has no persistent state — it fires an action and returns to its idle appearance.

  • One-click, fire-and-forget action for any HMI Device or entity.
  • Three action types on click: Set attribute, and Add time series.
  • Optional disabled state based on attributes, telemetry, alarms, or dashboard state.
  • Visual feedback for Hover, Pressed, Activated (post-action flash), and Disabled interaction states.
  • Configurable label, icon, layout, and color palette.
  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 Buttons.
  3. Select the Command button widget.
  4. Configure the datasource, behavior, and appearance, then click Add.

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

Select the datasource for the widget:

  • Device — a specific HMI Device; the widget sends actions to this HMI Device on click and reads its data for the disabled condition.
  • Entity alias — a set of entities matched by an entity alias; use this when the target HMI Device is selected dynamically at runtime.

The Behavior section defines what fires when the button is clicked and when the button becomes disabled. Disabled state is optional.

Defines the action executed when the user presses the button. Select one action type from the list below.

  • Set attribute

    Updates a HMI Device attribute when the button is pressed.

    ParameterDescription
    Attribute scopeServer or Shared.
    Attribute keyThe attribute to update, like command or state.
    ValueConstant — a fixed value like "triggered" or true; Function — a JS function that returns the value.
  • Add time series

    Writes a time-series record when the button is pressed, useful for logging actions.

    ParameterDescription
    Time series keyThe telemetry key to write to, like commandLog or lastAction.
    ValueConstant — a fixed value; Function — a JS function that returns the value.

The Disabled state makes the button non-interactive when a configured condition is met. In this state the button turns gray and clicks are ignored. This section is optional — skip it if the button should always be clickable.

  • Do nothing

    Set the disabled state manually. No live data needed.

    ParameterDescription
    ValueOn — button is always disabled; Off — button is always enabled.
  • Get attribute

    Disable the button based on a HMI Device attribute, like an active flag or locked status.

    ParameterDescription
    Attribute scopeWhere the attribute is stored: Any, Client, Server, or Shared.
    Attribute keyThe attribute name to read, like active or enabled.
    Condition (None)Disabled when the attribute equals the value you specify (String, Integer, Double, Boolean, or JSON).
    Condition (Function)Disabled when your f(data) function returns true.
  • Get time series

    Disable the button based on the latest telemetry value.

    ParameterDescription
    Time series keyThe telemetry key to monitor, like availability or status.
    Condition (None)Disabled when the telemetry value equals the value you specify.
    Condition (Function)Disabled when your f(data) function returns true.
  • Get alarm status

    Disable the button while a specific alarm is active, like blocking control during a critical fault.

    ParameterDescription
    Alarm severityCritical, Major, Minor, Warning, or Indeterminate.
    Alarm typesAny alarm, or a specific alarm type.
  • Get dashboard state id

    Disable the button based on the currently open dashboard state.

    ParameterDescription
    Condition (None)Disabled when the current state name matches the text you enter.
    Condition (Function)Disabled when your f(data) function returns true.
  • Get dashboard state object

    Disable the button using the full dashboard state context; use this when you need to evaluate multiple state parameters at once.

    ParameterDescription
    Condition (Function only)Write a f(data) function that returns true to disable the button.

Controls the widget header and title area.

SettingDescription
Auto scaleAutomatically adjusts font size and element proportions when the widget is resized.
TitleText displayed in the widget header. Supports entity variables: $\{entityName\}, $\{entityLabel\}.
Card iconMaterial Design icon shown alongside the title. Configurable size (px).

Controls the button’s visual style.

SettingDescription
LayoutButton visual style: Outlined (bordered), Filled (solid fill), Underlined (underline only), or Basic (plain text).
LabelText displayed on the button, like Restart, Reboot HMI Device, or Trigger relay. Supports entity variables: $\{entityName\}, $\{entityLabel\}.
IconMaterial Design icon shown on the button. Configurable size (px).
Border radiusRoundness of button corners (px).
Color paletteMain: button fill or text color; Background: surrounding area color.
Custom stylesPer-interaction style overrides: Enabled (default), Hovered, Pressed, Activated (momentary style shown immediately after a successful action), Disabled. Each supports Main, Background, and Shadow settings.
SettingDescription
BackgroundSolid color or image used as the card background.
Show card buttonsToggle visibility of the Fullscreen button in the card header.
Card border radiusRoundness of card corners.
Card paddingSpacing between card content and its border.

The Command button widget supports the Widget header button action — adds a button to the widget header that triggers a configured action when clicked.

Scenario: A smart ventilation system has a HMI Device called Ventilation Relay. Add a Restart Ventilation button to the dashboard that to restart the ventilation process. The button disables automatically when the HMI Device reports it is not ready to receive commands.

Prerequisites:

  • Create a HMI Device named Ventilation Relay in iRis Cloud and register its license (see iRis HMI Device Connectivity Guide).
  • Add a shared attribute: Key — active, Data type — Boolean, Value — true.

Step 1. Add the widget. Open your dashboard in edit mode, click Add widget, select the Buttons bundle, then choose Command button.

Step 2. Configure the datasource. Set Target device to Ventilation Relay.

Step 3. Configure behavior.

On click: Set Attribute — Method: restartVentilation, Parameters: Constant — true (Boolean).

Disabled state: Get attribute — Scope: Shared, Key: active, Condition: None — Disabled when result is false (Boolean).

Step 4. Configure button appearance. Layout — Outlined, Label — Restart Ventilation, Icon — restart_alt, Color palette Main — #2196F3, Background — #D0EBFF70.

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

Result: When active = true, the button is blue and clickable. Pressing it sends {"method": "restartVentilation", "params": true} to the HMI Device. If the HMI Device is offline, the command is queued and delivered once it reconnects. When active = false, the button turns gray and clicks are ignored.

Button click has no effect

CauseSolution
Wrong attribute key or scopeFor Set attribute actions, confirm the key and scope (Server or Shared) match the HMI Device’s attribute.
Wrong value typeEnsure the constant value type (String, Boolean, Integer) matches what the HMI Device or attribute expects.

Button is always disabled

CauseSolution
Attribute key not foundOpen Devices → Attributes and confirm the key exists with a value.
Wrong attribute scopeMatch the scope to the actual attribute type (Client / Server / Shared).
Condition value invertedCheck that the Condition value matches the value that should disable the button. If the attribute is false when the button should be disabled, set the condition value to false.
Function converter always returns trueReview the Function converter; check for a missing return statement or incorrect comparison.