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.
Key capabilities
Section titled “Key capabilities”- 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.
Adding the widget
Section titled “Adding the widget”- 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.
- In the widget bundle selection dialog, find and click Buttons.
- Select the Command button widget.
- Configure the datasource, behavior, and appearance, then click Add.
Configuration
Section titled “Configuration”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.
Datasource
Section titled “Datasource”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.
Behavior
Section titled “Behavior”The Behavior section defines what fires when the button is clicked and when the button becomes disabled. Disabled state is optional.
On click
Section titled “On click”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.
Parameter Description Attribute scope Server or Shared. Attribute key The attribute to update, like commandorstate.Value Constant — a fixed value like "triggered"ortrue; 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.
Parameter Description Time series key The telemetry key to write to, like commandLogorlastAction.Value Constant — a fixed value; Function — a JS function that returns the value.
Disabled state
Section titled “Disabled state”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.
Parameter Description Value On — button is always disabled; Off — button is always enabled. -
Get attribute
Disable the button based on a HMI Device attribute, like an
activeflag orlockedstatus.Parameter Description Attribute scope Where the attribute is stored: Any, Client, Server, or Shared. Attribute key The attribute name to read, like activeorenabled.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 returnstrue. -
Get time series
Disable the button based on the latest telemetry value.
Parameter Description Time series key The telemetry key to monitor, like availabilityorstatus.Condition (None) Disabled when the telemetry value equals the value you specify. Condition (Function) Disabled when your f(data)function returnstrue. -
Get alarm status
Disable the button while a specific alarm is active, like blocking control during a critical fault.
Parameter Description Alarm severity Critical, Major, Minor, Warning, or Indeterminate. Alarm types Any alarm, or a specific alarm type. -
Get dashboard state id
Disable the button based on the currently open dashboard state.
Parameter Description Condition (None) Disabled when the current state name matches the text you enter. Condition (Function) Disabled when your f(data)function returnstrue. -
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.
Parameter Description Condition (Function only) Write a f(data)function that returnstrueto disable the button.
Appearance
Section titled “Appearance”Controls the widget header and title area.
| Setting | Description |
|---|---|
| Auto scale | Automatically adjusts font size and element proportions when the widget is resized. |
| Title | Text displayed in the widget header. Supports entity variables: $\{entityName\}, $\{entityLabel\}. |
| Card icon | Material Design icon shown alongside the title. Configurable size (px). |
Button appearance
Section titled “Button appearance”Controls the button’s visual style.
| Setting | Description |
|---|---|
| Layout | Button visual style: Outlined (bordered), Filled (solid fill), Underlined (underline only), or Basic (plain text). |
| Label | Text displayed on the button, like Restart, Reboot HMI Device, or Trigger relay. Supports entity variables: $\{entityName\}, $\{entityLabel\}. |
| Icon | Material Design icon shown on the button. Configurable size (px). |
| Border radius | Roundness of button corners (px). |
| Color palette | Main: button fill or text color; Background: surrounding area color. |
| Custom styles | Per-interaction style overrides: Enabled (default), Hovered, Pressed, Activated (momentary style shown immediately after a successful action), Disabled. Each supports Main, Background, and Shadow settings. |
Card appearance
Section titled “Card appearance”| Setting | Description |
|---|---|
| Background | Solid color or image used as the card background. |
| Show card buttons | Toggle visibility of the Fullscreen button in the card header. |
| Card border radius | Roundness of card corners. |
| Card padding | Spacing between card content and its border. |
Actions
Section titled “Actions”The Command button widget supports the Widget header button action — adds a button to the widget header that triggers a configured action when clicked.
Example
Section titled “Example”Ventilation restart button
Section titled “Ventilation restart button”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.
Troubleshooting
Section titled “Troubleshooting”Button click has no effect
| Cause | Solution |
|---|---|
| Wrong attribute key or scope | For Set attribute actions, confirm the key and scope (Server or Shared) match the HMI Device’s attribute. |
| Wrong value type | Ensure the constant value type (String, Boolean, Integer) matches what the HMI Device or attribute expects. |
Button is always disabled
| Cause | Solution |
|---|---|
| Attribute key not found | Open Devices → Attributes and confirm the key exists with a value. |
| Wrong attribute scope | Match the scope to the actual attribute type (Client / Server / Shared). |
| Condition value inverted | Check 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 true | Review the Function converter; check for a missing return statement or incorrect comparison. |