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

## SmartTapToRunAbility.getBindTapToRunRules

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

> 💡 Supports single devices only; groups are not supported. Note: The sample response is for reference only and contains fields beyond the defined response parameters. Do not use any data other than what is defined in this document, otherwise it may cause application errors.

### Description

Query the list of automations bound to Tap-to-Run

### Parameters

`Params`

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

### Return Value

Type: `Promise<BindTapToRunRules>`

List of bound 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` BindTapToRunRules

List of bound Tap-to-Run automation rules

```typescript
export type BindTapToRunRules = BindTapToRunRule[];
```

##### `type` BindTapToRunRule

Bound Tap-to-Run item

| Property | Type | Description |
| --- | --- | --- |
| `associativeEntityId` | `string` | Associated entity ID, in the format dpId#dpValue |
| `associativeEntityValueList` | `BindTapToRunLinkedRule[]` | List of values for the associated entity |
| `bindId` | `number` | Bind ID |
| `bizDomain` | `string` | Business domain; for Tap-to-Run this is fixed as wirelessSwitchBindScene |
| `enable` | `boolean` | Whether enabled |
| `sourceEntityId` | `string` | Source device ID |

##### `type` BindTapToRunLinkedRule

Bound Tap-to-Run target rule

| Property | Type | Description |
| --- | --- | --- |
| `ruleType` | `number` | Rule type |
| `triggerRuleEnable` | `boolean` | Whether the rule is enabled |
| `triggerRuleId` | `string` | Execution rule ID, typically used for triggering |

##### `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 bindRules = await sdm.tapToRun.getBindTapToRunRules();
bindRules.forEach(item => {
  console.log('Bound ID:', item.bindId);
  item.associativeEntityValueList.forEach(rule => {
    console.log('Bound rule:', rule.id, rule.name);
  });
});
```
