English
Device Action
Device Action is the batch command scheduling module in ThinkLink. It sends RPC commands to one or multiple devices on a schedule. Typical use cases:
- Timed operations (e.g., reset device state every night at midnight)
- Periodic data collection (e.g., read sensor parameters every hour)
- Bulk attribute updates (e.g., push configuration parameters to all devices)
A Device Action must be bound to a Scheduled Task to take effect. The scheduled task controls when to trigger; the device action controls what command to send and which devices to target.

Configuration Fields
| Field | Description |
|---|---|
| Name | Custom label for identification in the list |
| Enable | Disabling pauses this action without affecting the bound scheduled task |
| Scheduled Task | Select from dropdown — must be created first in the Scheduled Tasks page |
| Device Send Interval (ms) | Delay between consecutive device commands during batch execution. Default: 3000 ms. Prevents flooding a large number of devices with rapid successive commands |
| RPC | Select an RPC defined in the Thing Model; fill in parameters if required |
| Target Devices | Add one or more devices by EUI. Batch execution sends commands sequentially with the configured interval between each device |

Execution Types
| Type | Behavior |
|---|---|
| Unlimited | Executes on every trigger until manually disabled |
| Fixed Count | Auto-disables after reaching the configured number of executions |
Execute and Stop
- Execute Now: Click "Execute" on the list page to trigger immediately, without waiting for the scheduled task
- Stop: A running batch task can be interrupted — devices already processed are not rolled back
- Execution progress is broadcast via platform MQTT and visible in real time on the list page
Execution Logs
Enable Log Storage to record each execution result (success/failure, device EUI, response payload). A log cutoff time can be configured to stop writing after a set date.
Configuration Workflow
- Create a cron task in the Scheduled Tasks page, setting the desired schedule
- Go to Device Action, click Add, enter a name and bind the task from step 1
- Select the RPC command and fill in any required parameters
- Add target devices to the device list
- Enable the action and save
Note: Changes to RPC parameters or the target device list only take effect from the next execution cycle after saving.
Cancellation and scheduling boundaries
RPC sleepTimeMs, trigger delayms and Cron are separate mechanisms. Device/RPC-scoped cancelRpc can cancel registered trigger-delayed calls and active RPCs. A pending call whose script has not declared a batch cannot match that batch_id. Cancelling current execution does not disable future triggers or Cron. Disabling a schedule/device action prevents future dispatch and does not cancel an RPC already started. Device batch-stop stops subsequent device dispatch and inter-device waits; it does not guarantee termination of a single-device RPC already entered. Commands sent cannot be recalled; read back results before restarting.
Trigger abort_previous_timer clears the preceding timer and pending calls for that trigger and input device; it does not cancel every RPC on the target device or guarantee cancellation of dispatched RPCs. Execution state is process-local: restart does not resume it and instances share no lock. See RPC execution control and retries for examples, batch deduplication and the ten-level limit.