Skip to content
Stand with Ukraine flag

RPC Button

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

Allows to send RPC command when the user presses the button.

Widget Type
  • Control
Category
  • Controls
Use Cases
  • Industrial Automation
  • Smart Building
  • Robotics

Who it’s for

Anyone who needs a plain button that fires one RPC method at a device — a maintenance action, a diagnostic trigger, a reset. This is the direct, long-standing form of that control: name the method, name the parameters, and the button sends them.

What it does

The RPC Button sends a named RPC method with fixed parameters when pressed. Configured with method rpcCommand and {} as parameters, it sends that call one-way by default, and can report a command execution error back on the dashboard when the call fails.

  • The method and its parameters are written directly, which suits a device whose API is already known and fixed.
  • One-way or two-way — a fire-and-forget command, or a call that waits for the device to answer.
  • Command execution errors can be surfaced on the dashboard, so a failed call is visible rather than silent.
  • Persistent RPC is supported with a polling interval, for devices that acknowledge asynchronously.
  • The button’s label and style are set directly, including a raised or flat appearance.
  • The RPC Button sends a fixed payload: a command whose parameters depend on the situation belongs on the Command button, which can compute the value it sends.

How to set up

Data keys

The RPC Button takes no data keys — the command is defined entirely in its settings.

MethodDirectionParametersSent when
rpcCommandOne-way by default; two-way when Is one way command is off{} — the JSON written into RPC method paramsOn every button press

RPC

SettingDefaultEffect
RPC methodrpcCommandThe method name sent to the device
RPC method params{}The JSON payload sent with it
Is one way commandOnOne-way fires and forgets; off waits for a response
RPC request timeout5000How long a two-way call waits, in milliseconds
Show RPC command execution errorOffSurfaces a failed call on the dashboard
RPC request persistentOffFor devices acknowledging asynchronously, with a polling interval
Button labelSend RPCThe text on the button

Take the method name and parameter shape from the device’s own firmware or connector documentation. The button sends exactly what is written here, and a device that does not recognize the method fails silently unless error reporting is turned on.

How to customize

  • To send a different command — set RPC method and write the payload into RPC method params.
  • To confirm the device acted — turn off Is one way command, which makes the call wait for a response.
  • To see failures — turn on Show RPC command execution error, so a rejected or timed-out command is reported instead of appearing to succeed.
  • To label the action — set the Button label to the verb the operator would use, replacing the default Send RPC.
  • To support a slow device — turn on RPC request persistent and set the polling interval.
  • To fail faster — lower the RPC request timeout from its 5-second default.
  • To match the dashboard’s styling — set the button to raised or flat, and primary or not.

Tips

  • Turn on error reporting on any button an operator will press unsupervised. A one-way command is indistinguishable from a successful one at the dashboard, and a silent failure on a maintenance action is usually discovered much later than it should be.
  • Keep the parameter JSON minimal and put the logic on the device. Parameters written into a widget are invisible to anyone reading the device’s code, and they drift out of step with the firmware in a way nothing on either side detects.

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.