---
name: "SmartTapToRunAbility.getTapToRunRules"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.11.0" }
title: "getTapToRunRules"
---

## SmartTapToRunAbility.getTapToRunRules

> [VERSION] @ray-js/panel-sdk >= 1.11.0

> 💡 Supports single devices only; group environments are not supported. Note: The response example is for reference only and includes fields beyond the defined response parameters. Do not use any data other than the parameters defined here; otherwise, it may cause application errors.

### Description

Query the list of Tap-to-Run actions that can be bound under the current home; invalid or automation rules will be filtered out.

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `TapToRunQueryParams` | No | Query parameters |

### Return Value

Type: `Promise<TapToRunRules>`

List of bindable Tap-to-Run rules

### Referenced Types

##### `type` TapToRunQueryParams

Tap-to-Run query parameters

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID; if not provided, use the current device |
| `gid` | `string` | Home ID; if not provided, use the current app home |
| `containStandardZigBee` | `boolean` | Whether to include standard Zigbee scenes |

##### `type` TapToRunRules

List of bindable Tap-to-Run rules

```typescript
TapToRunRule[]
```

##### `type` TapToRunRule

Bindable one-tap execution rules

| Property | Type | Description |
| --- | --- | --- |
| `actions` | `TapToRunAction[]` | Action list |
| `background` | `string` | Background image URL |
| `boundForPanel` | `boolean` | Panel binding |
| `boundForWiFiPanel` | `boolean` | WiFi panel binding |
| `coverIcon` | `string` | Icon |
| `displayColor` | `string` | Background color |
| `enabled` | `boolean` | Whether the rule is enabled |
| `id` | `string` | Execution rule ID |
| `name` | `string` | Automation name or note |

##### `type` TapToRunAction

One-tap action item

| Property | Type | Description |
| --- | --- | --- |
| `actionDisplay` | `string` | Action display name |
| `actionExecutor` | `string` | Action executor |
| `actionStrategy` | `string` | Action execution policy |
| `entityId` | `string` | Owning entity ID |
| `gmtModified` | `number` | Last modified timestamp |
| `id` | `string` | Unique action ID |
| `orderNum` | `number` | Action sequence number |
| `ruleId` | `string` | Rule ID |
| `status` | `boolean` | Action status |


### Examples

#### Example

```typescript
const rules = await sdm.tapToRun.getTapToRunRules();
rules.forEach(rule => {
  console.log(rule.id, rule.name);
});
```
