---
name: "getBindRuleList"
mode: "api"
versionRequirements:
  - { name: "Base Library", version: "2.14.0" }
title: "device.getBindRuleList - 查询已绑定规则列表"
---

## getBindRuleList

> [VERSION] Base Library >= 2.14.0

### Description

Query the list of automation rules bound under the home

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `params` | `IGetBindRuleList` | Yes | Query parameters |

### Return Value

Type: `Promise<IBindRuleItem[]>`

List of bound automation rules

##### IBindRuleItem

| Property | Type | Description |
| --- | --- | --- |
| `associativeEntityId` | `string` | Establish a binding relationship with a panel/device, typically device ID, DP, group, rule, dpId#value, etc. |
| `associativeEntityValueList` | `ISceneListItemV2 & Object[]` | List of values of the associated entity |
| `bindId` | `number` | Binding ID, usually used for unbinding |
| `bizDomain` | `string` | Business domain |
| `enable` | `boolean` | Whether enabled |
| `sourceEntityId` | `string` | Device ID |

### Referenced Types

##### `interface` IGetBindRuleList

| Property | Type | Description |
| --- | --- | --- |
| `bizDomain` | `string` | Business domain |
| `devId` | `string` | Device ID |
| `sourceEntityId` | `string` | Source entity ID, uses devId by default |
| `entityType` | `"EntityType.DEVICE" \\| "EntityType.RULE"` | Entity type |
| `gid` | `string` | Home ID |

##### `interface` ISceneListItemV2

| Property | Type | Description |
| --- | --- | --- |
| `actions` | `ISceneAction[]` | Execute action |
| `alarmIssue` | `boolean` | Whether it's an alarm issue |
| `attribute` | `number` | Attributes Perform bitwise operations using powers of two of enum values |
| `auditStatus` | `number` | Review status 0. Not reviewed 1. Approved 2. Rejected |
| `background` | `string` | Background image URL |
| `boundForPanel` | `boolean` | Panel binding |
| `boundForWiFiPanel` | `boolean` | Whether bound to a WiFi panel |
| `code` | `string` | Rule code |
| `commonField` | `string` | Generic JSON field; for example, local automation stores the gateway ID, gwId |
| `containDeviceDelete` | `boolean` | Whether to include deleted devices |
| `coverIcon` | `string` | Icon |
| `description` | `string` | Rule description |
| `disableTime` | `number` | Disable duration, in milliseconds |
| `displayColor` | `string` | Background color |
| `enabled` | `boolean` | Whether the rule is enabled |
| `forceCloudTrigger` | `boolean` | Whether to force cloud trigger |
| `id` | `string` | ID of the rule to execute |
| `iotAutoAlarm` | `boolean` | Whether IoT automatic alarm |
| `isAlarmIssue` | `boolean` | Whether an alarm issue (compatibility field) |
| `isLogicRule` | `boolean` | Whether a logic rule |
| `linkageType` | `number` | Automation type |
| `localLinkage` | `boolean` | Whether local automation |
| `logicRule` | `boolean` | Whether a logic rule (compatibility field) |
| `matchType` | `number` | Match type 1. Any condition: trigger if any condition is met (OR). 2. All conditions: trigger only if all conditions are met. 3. Expression-based: determined by the expr in the rule field; trigger when satisfied. |
| `name` | `string` | Automation name or note |
| `needCleanGidSid` | `boolean` | Whether to clear gid/sid |
| `needValidOutOfWork` | `boolean` | Whether to validate expiration |
| `newLocalScene` | `boolean` | Whether a new-version local scene |
| `offGwSync` | `boolean` | Whether to disable gateway sync |
| `offGwSyncSuccess` | `boolean` | Whether disabling gateway sync succeeded |
| `orderWeight` | `number` | Sorting weight |
| `outOfWork` | `number` | Invalidation status |
| `ownerId` | `string` | Home ID |
| `panelType` | `number` | Panel type |
| `permissionCode` | `string` | Permission code |
| `ruleGenre` | `number` | Rule pattern |
| `ruleSource` | `number` | Rule source |
| `ruleType` | `number` | Rule type 1. System-defined 2. Merchant-defined 3. User-defined 4. Security rule 5. Service-defined (e.g., DP point forwarding) |
| `runtimeEnv` | `string` | Runtime environment |
| `scenarioRule` | `boolean` | Whether a scene rule |
| `status` | `boolean` | Rule status |
| `statusConditions` | `any[]` | List of state conditions |
| `stickyOnTop` | `boolean` | Whether to display at the top of the home page |
| `subMatchType` | `number` | Sub-match type |
| `uid` | `string` | User ID |

##### `enum` EntityType

| Enum Value | Actual Value | Description |
| --- | --- | --- |
| `EntityType.DEVICE` | `1` | Associated entity is a device |
| `EntityType.RULE` | `2` | Associated entity is an automation rule |

##### `interface` ISceneAction

| Property | Type | Description |
| --- | --- | --- |
| `actionDisplay` | `string` | Action display name |
| `actionExecutor` | `string` | Action executor |
| `actionStrategy` | `string` | Action strategy |
| `attribute` | `number` | Attribute value |
| `devDelMark` | `boolean` | Device deletion flag, indicates whether the device is deleted |
| `enabled` | `boolean` | Whether the action is enabled |
| `entityId` | `string` | Entity ID, the ID of the entity the action belongs to |
| `gmtModified` | `number` | Update timestamp |
| `id` | `string` | Unique action ID |
| `offGwSync` | `boolean` | Gateway sync flag, indicates whether gateway sync is enabled |
| `orderNum` | `number` | Action sequence number |
| `ruleId` | `string` | Rule ID, the ID of the rule the action belongs to |
| `status` | `boolean` | Action status |
| `uid` | `string` | User ID, the ID of the user the action belongs to |


### Examples

#### Get the list of bound rules

```ts
ty.getBindRuleList({
  bizDomain: 'switch',
  devId: 'abc123',
  entityType: 1,
  gid: '456789',
}).then((list) => {
  console.log('Bound rules', list);
});
```
