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

## SmartTapToRunAbility.bind

> [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

Bind automation trigger conditions to a Tap-to-Run

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `BindParams` | Yes | Binding parameters |

### Return Value

Type: `Promise<BindTapToRunResult>`

Binding result

### Referenced Types

##### `type` BindParams

| Property | Type | Description |
| --- | --- | --- |
| `devId` | `string` | Device ID; defaults to the one from the default device environment |
| `dpId` | `string` | DP ID, to be used together with dpValue; when a device report satisfies dpId == dpValue, the bound Tap-to-Run will be triggered automatically |
| `dpValue` | `boolean \| number \| string` | DP value, to be used together with dpId; when a device report satisfies dpId == dpValue, the bound Tap-to-Run will be triggered automatically |
| `ruleId` | `string` | List of scene IDs to bind; when dpId == dpValue, the automation bound to the current rule ID will be triggered |
| `name` | `string` | Name |
| `icon` | `string` | Icon |
| `gid` | `string` | Home ID; if omitted, use the current app home ID |

##### `type` BindTapToRunResult

Tap-to-Run binding result

| Property | Type | Description |
| --- | --- | --- |
| `associativeEntityId` | `string` | Associated entity ID, in the format dpId#dpValue |
| `associativeEntityValue` | `string` | Associated rule ID |
| `bindId` | `number` | Bind ID, typically used for unbinding |
| `bizDomain` | `string` | Business domain; for Tap-to-Run this is fixed as wirelessSwitchBindScene |
| `id` | `number` | Data ID |
| `ownerId` | `string` | Home ID |
| `sourceEntityId` | `string` | Device ID |
| `triggerRuleId` | `string` | Trigger rule ID |

##### `type` DpValue

Datapoint value type, which can be boolean, number, or string.

```typescript
export type DpValue = boolean | number | string;
```


### Examples

#### Example

```typescript
const result = await sdm.tapToRun.bind({
  dpId: '1',
  dpValue: 'single_click',
  ruleId: 'scene_abc123',
});
console.log('Bind result:', result);
```
