Skip to content
Stand with Ukraine flag

Sand Filter

Sand filter SCADA symbol

This widget belongs to the Traditional SCADA fluid system bundle — a collection of pipe segments, fittings, valves, pumps, and gauges designed for building fluid system diagrams on ThingsBoard dashboards. It represents a sand filter with a running state indicator, a set of filtration mode buttons (Filter, Waste, Backwash, Recirculate, Rinse, Closed), and direct mode-switching control from the dashboard.

  • Display the current filtration mode by highlighting the active mode button.
  • Switch the filtration mode directly from the dashboard by clicking a mode button.
  • Show or hide individual mode buttons to match the actual capabilities of the connected device.
  • Indicate the running state of the filter.
  • Trigger a dashboard action when the widget symbol is clicked.
  • Receive state data from device attributes, time series, alarm status, or dashboard state.

The widget connects to a single data source: either a Device or an Entity alias that resolves to a device. This device provides the telemetry or attribute values used to drive the widget’s visual state.

The SCADA symbol defines the visual shape of the widget. The Sand filter widget has a pre-selected symbol from the Traditional SCADA fluid system bundle. To use a different symbol, click Browse SCADA symbol from gallery and choose one from the library, or upload your own.

Behavior parameters control what the widget displays and what actions it sends to the connected device. See Read parameter configuration and Write parameter configuration for configuration details.

ParameterDefaultValuesDescription
RunningUse attribute 'running'True, FalseWhether the filter is currently running.
Filtration modeUse attribute 'filtrationMode'numberInteger value indicating the currently active filtration mode. The value maps to the mode buttons shown on the widget: 0 — Filter, 1 — Waste, 2 — Backwash, 3 — Recirculate, 4 — Rinse, 5 — Closed.
Filtration mode update stateSet 'filtrationMode' attribute to: valueAction sent to the device when the user clicks a mode button to switch the filtration mode.
On clickDo nothingAction triggered when the user clicks the widget symbol.

Defines what happens when the user clicks the SCADA symbol on the dashboard. Select one action type from the list below.

  • Do nothing

    The symbol is clickable but performs no action. Use while testing layouts or as a placeholder.

  • Navigate to new dashboard state

    Switches to a different view within the same dashboard, like opening a device details screen.

    ParameterDescription
    Target dashboard stateThe state to open (required).
    Open right dashboard layout (mobile view)Opens a side panel instead of replacing the view (mobile only).
    Set entity from widgetPasses the current entity to the target state.
    State entity parameter nameThe key the entity is passed under.
    Dashboard state display optionNormal (same view), In separate dialog (popup), or In popover (inline overlay).
  • Update current dashboard state

    Updates the context of the current view, like switching the selected device, without navigating away.

    ParameterDescription
    Target dashboard stateThe state to switch to (optional).
    Open right dashboard layout (mobile view)Opens a side panel on mobile.
    Set entity from widgetPasses the current entity to the updated state.
    State entity parameter nameThe key the entity is passed under.
  • Navigate to other dashboard

    Opens a completely different dashboard, like jumping from this system view to a global alarms view.

    ParameterDescription
    Target dashboardThe dashboard to open (required).
    Target dashboard stateThe specific view to open within that dashboard.
    Open in a new browser tabOpens the dashboard without leaving the current page.
    Set entity from widgetPasses the current entity to the other dashboard.
    State entity parameter nameThe key the entity is passed under.
  • Custom action

    Runs custom JavaScript on click to implement any behavior not covered by the built-in options. Use it to make HTTP requests, open custom dialogs, call other widget APIs, or interact with external services. The function receives: $event, widgetContext, entityId, entityName, additionalParams, entityLabel.

  • Custom action (with HTML template)

    Same as Custom action, but also renders a custom HTML panel or dialog when the symbol is clicked. The function receives an additional htmlTemplate parameter: $event, widgetContext, entityId, entityName, htmlTemplate, additionalParams, entityLabel.

    ParameterDescription
    ResourcesExternal scripts and styles loaded before the action runs.
    CSSStyling for the HTML template.
    HTMLLayout of the rendered dialog or panel.
    JSAction logic.
  • Mobile action

    Triggers a native device feature inside a ThingsBoard mobile app, like the camera or QR scanner.

    ParameterDescription
    Mobile action typeTake picture from gallery, Take photo, Open map directions, Open map location, Scan QR Code, Make phone call, Get phone location, Take screenshot, or Device provision.
  • Open URL

    Opens a website or external link when clicked.

    ParameterDescription
    URLThe address to open (required).
    Open in a new browser tabKeeps the current dashboard open while opening the link.

To configure Running or Filtration mode, click the parameter’s edit icon. When Action is set to Do nothing, the Value field accepts:

ParameterValue
RunningTrue or False
Filtration modeAny integer — used as the active mode until the device sends data.

For all other actions, the configuration dialog works the same way regardless of which parameter you are editing:

  • Execute RPC

    Read the parameter value from an RPC response.

    ParameterDescription
    MethodRPC method to call, like getState or getFiltrationMode.
    Action result converterNone — parameter is activated when the result matches the value you specify; Function — parameter is activated when your f(data) returns true.
    ’[parameter]’ when result isThe value or condition that activates this parameter (not shown for Filtration mode, which uses the raw numeric result).
    RPC request timeout (ms)How long to wait for a device response before timing out (Advanced settings).
    RPC request persistentStores and retries the command until the device comes online (Advanced settings).
  • Get attribute

    Read the parameter value from a device attribute.

    ParameterDescription
    Attribute scopeWhere the attribute is stored: Any, Client, Server, or Shared.
    Attribute keyAttribute name to read, like running or filtrationMode.
    Action result converterNone — parameter is activated when the attribute equals the value you specify; Function — parameter is activated when your f(data) returns true.
    ’[parameter]’ when result isThe value or condition that activates this parameter (not shown for Filtration mode, which uses the raw numeric result).
  • Get time series

    Read the parameter value from the latest telemetry reading.

    ParameterDescription
    Time series keyTelemetry key to monitor, like filtrationMode or running.
    Action result converterNone — parameter is activated when the telemetry value equals what you specify; Function — parameter is activated when your f(data) returns true.
    ’[parameter]’ when result isThe value or condition that activates this parameter (not shown for Filtration mode, which uses the raw numeric result).
  • Get alarm status

    Activate the parameter when a specific alarm is active on the device.

    ParameterDescription
    Alarm severityWhich severity levels trigger the active state: Critical, Major, Minor, Warning, or Indeterminate.
    Alarm typesAny alarm, or a specific alarm type.
  • Get dashboard state id

    Activate the parameter based on which dashboard state is currently open.

    ParameterDescription
    Action result converterNone — parameter is activated when the state name matches the text you enter; Function — parameter is activated when your f(data) returns true.
    ’[parameter]’ when result isThe state name or condition that activates this parameter.
  • Get dashboard state object

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

    ParameterDescription
    Parse value functionWrite a f(data) function that returns the parameter value.

Filtration mode update state defines what is sent to the device when the user clicks a mode button. Click the parameter’s edit icon to configure it.

  • Execute RPC

    Call an RPC method on the device.

    ParameterDescription
    MethodRPC method name, like setState or setFiltrationMode.
    ParametersValue — pass the selected mode value; Function — write a f(value) function to transform the value before sending; None — send no parameters.
    RPC request timeout (ms)How long to wait before timing out (Advanced settings).
    RPC request persistentStores and retries the command until the device comes online (Advanced settings).
  • Set attribute

    Write the mode value to a device attribute.

    ParameterDescription
    Attribute scopeTarget scope: Server or Shared.
    Attribute keyAttribute name to write, like filtrationMode.
    ValueValue — pass the selected mode value directly; Function — write a f(value) function to compute the value.
  • Add time series

    Write the mode value to a device time series key.

    ParameterDescription
    Time series keyTelemetry key to write, like filtrationMode or state.
    ValueValue — pass the selected mode value directly; Function — write a f(value) function to compute the value.

The Appearance section controls the widget title, which mode buttons are visible, and the colors used for active and default states.

SettingDefaultDescription
TitleSand filterWidget title displayed in the header. Supports entityName and entityLabel variables.
Card iconIcon shown in the widget header. Configure its size and color.
FilterEnabledShow or hide the Filter mode button.
WasteEnabledShow or hide the Waste mode button.
BackwashEnabledShow or hide the Backwash mode button.
RecirculateEnabledShow or hide the Recirculate mode button.
RinseEnabledShow or hide the Rinse mode button.
ClosedEnabledShow or hide the Closed mode button.
Sand filter colorTransparentColor of the filter body.
Mode box backgroundTransparentBackground color of the mode button area.
Border color (Active)GreenBorder color of the currently active mode button.
Border color (Default)TransparentBorder color of inactive mode buttons.
Label color (Active)DarkLabel text color of the currently active mode button.
Label color (Default)GrayLabel text color of inactive mode buttons.

The Card appearance section controls the widget container style.

SettingDefaultDescription
BackgroundTransparentCard background color.
Show card buttonsFullscreenButtons shown on the card when hovered.
Card border radius0pxRounding of card corners.
Card padding12pxInner spacing between the card edge and widget content.

Active mode button does not highlight

CauseSolution
Filtration mode action is set to Do nothingOpen the Filtration mode edit dialog, set the correct Action, and specify the attribute key.
Attribute key mismatchVerify that the key name in the behavior configuration matches exactly what the device reports.
Target device is not connectedConfirm that the selected device is online and actively sending data.

Clicking a mode button has no effect on the device

CauseSolution
Filtration mode update state action is misconfiguredOpen the Filtration mode update state edit dialog and verify the attribute key, scope, and value match the device’s expected format.
Target device is not connectedConfirm that the selected device is online and reachable.

These widgets are used in the following ready-made solution templates built on the Traditional SCADA fluid system bundle:

  • SCADA Swimming pool — a complete swimming pool monitoring dashboard built with pipe, pump, valve, and gauge widgets from the Traditional SCADA fluid system bundle.