---
name: "SmartAlarmAbility.deleteCustomAlarm"
mode: "api"
versionRequirements:
  - { name: "@ray-js/panel-sdk", version: "1.8.0" }
title: "deleteCustomAlarm"
---

## SmartAlarmAbility.deleteCustomAlarm

> [VERSION] @ray-js/panel-sdk >= 1.8.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

Delete a custom alert rule

### Parameters

`Params`

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `options` | `DeleteCustomAlarmParams` | Yes | Operation parameters |

### Return Value

Type: `Promise<DeleteCustomAlarmResult>`

Tuple [whether the deletion succeeded, the updated full rule list]

### Referenced Types

##### `type` DeleteCustomAlarmParams

| Property | Type | Description |
| --- | --- | --- |
| `bindId` | `number` | Alarm rule binding ID to delete |

##### `type` DeleteCustomAlarmResult

```typescript
[boolean, CustomAlarmList]
```

##### `type` CustomAlarmList

```typescript
export type CustomAlarmList = CustomAlarmRule[];
```

##### `type` CustomAlarmRule

| Property | Type | Description |
| --- | --- | --- |
| `triggerRuleId` | `string` | ID of the rule executed by the alarm |
| `triggerRuleVO` | `AlarmTriggerRuleVO` | Details of the rule that triggers the alarm; see AlarmTriggerRuleVO |
| `bizDomain` | `string` | Business domain identifier, fixed as miniAppPanelSDKAlarm in the alarm SDK |
| `associativeEntityValue` | `string` | Used when associativeEntityId is not sufficient to distinguish cases—for example, when the same DP is used but alarm types must be differentiated. You can use DpValue; generally not required. |
| `sourceEntityId` | `string` | Device ID associated with the current alarm |
| `name` | `string` | Name or note |
| `icon` | `string` | Icon |
| `bindId` | `number` | Binding ID |
| `associativeEntityId` | `string` | DP ID associated with the current alarm |
| `enable` | `boolean` | Whether enabled |

##### `type` AlarmTriggerRuleVO

| Property | Type | Description |
| --- | --- | --- |
| `ownerId` | `string` | Home ID |
| `enabled` | `boolean` | Whether the alarm rule is enabled |
| `id` | `string` | Execution rule ID |
| `name` | `string` | Alarm name or note |
| `preConditions` | `AlarmPreCondition[] \| unknown[]` | Preconditions for executing actions; see AlarmPreCondition |
| `conditions` | `CustomAlarmCondition[] \| unknown[]` | Conditions for executing actions; see CustomAlarmCondition |
| `actions` | `CustomAlarmSceneAction[] \| unknown[]` | Actions to execute; see CustomAlarmSceneAction |

##### `type` DpValue

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

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

##### `type` AlarmPreCondition

| Property | Type | Description |
| --- | --- | --- |
| `expr` | `CustomAlarmPreConditionExpr` | Condition expression |
| `condType` | `"timeCheck"` | Condition type, fixed as timeCheck in the alarm SDK |
| `id` | `string` | Condition ID |

##### `type` CustomAlarmCondition

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` | Condition ID |
| `ruleId` | `string` | Rule ID |
| `entityId` | `string` | Data ID |
| `entitySubIds` | `string` | Abstract sub-data ID |
| `expr` | `string` | Condition expression |

##### `type` CustomAlarmSceneAction

| Property | Type | Description |
| --- | --- | --- |
| `id` | `string` | Condition ID |
| `ruleId` | `string` | Scene ID |
| `actionExecutor` | `string` | Action type, fixed as appPushTrigger in the alarm SDK |

##### `type` CustomAlarmPreConditionExpr

| Property | Type | Description |
| --- | --- | --- |
| `timeZoneId` | `string` | Time zone ID, e.g., Asia/Shanghai |
| `start` | `string` | Start time in HH:mm, e.g., 00:00 |
| `timeInterval` | `string` | Time interval, fixed as 'custom' |
| `loops` | `string` | Repeat days; '1111111' means all seven days are on, starting from Sunday |
| `end` | `string` | End time in HH:mm, e.g., 23:59 |


### Examples

#### Example

```typescript
const [success, remainingRules] = await sdm.alarm.deleteCustomAlarm({
  bindId: 12345,
});
console.log('Delete result:', success, 'Remaining rule count:', remainingRules.length);
```
