SmartAlarmAbility.deleteCustomAlarm(options: DeleteCustomAlarmParams)

Requires:
@ray-js/panel-sdk≥1.8.0

Description

Delete a custom alert rule

Parameters

ParameterTypeRequiredDescription
YesOperation parameters

Return Value

Type: Promise<DeleteCustomAlarmResult>
Tuple [whether the deletion succeeded, the updated full rule list]

Referenced Types

typeDeleteCustomAlarmResult
[boolean, CustomAlarmList]
typeCustomAlarmList
export type CustomAlarmList = CustomAlarmRule[];
typeCustomAlarmRule
PropertyTypeDescription
triggerRuleIdstringID of the rule executed by the alarm
Details of the rule that triggers the alarm; see AlarmTriggerRuleVO
bizDomainstringBusiness domain identifier, fixed as miniAppPanelSDKAlarm in the alarm SDK
associativeEntityValuestringUsed 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.
sourceEntityIdstringDevice ID associated with the current alarm
namestringName or note
iconstringIcon
bindIdnumberBinding ID
associativeEntityIdstringDP ID associated with the current alarm
enablebooleanWhether enabled
typeAlarmTriggerRuleVO
PropertyTypeDescription
ownerIdstringHome ID
enabledbooleanWhether the alarm rule is enabled
idstringExecution rule ID
namestringAlarm name or note
Preconditions for executing actions; see AlarmPreCondition
Conditions for executing actions; see CustomAlarmCondition
Actions to execute; see CustomAlarmSceneAction
typeAlarmPreCondition
PropertyTypeDescription
Condition expression
condType"timeCheck"Condition type, fixed as timeCheck in the alarm SDK
idstringCondition ID
typeCustomAlarmCondition
PropertyTypeDescription
idstringCondition ID
ruleIdstringRule ID
entityIdstringData ID
entitySubIdsstringAbstract sub-data ID
exprstringCondition expression
typeCustomAlarmSceneAction
PropertyTypeDescription
idstringCondition ID
ruleIdstringScene ID
actionExecutorstringAction type, fixed as appPushTrigger in the alarm SDK
typeCustomAlarmPreConditionExpr
PropertyTypeDescription
timeZoneIdstringTime zone ID, e.g., Asia/Shanghai
startstringStart time in HH:mm, e.g., 00:00
timeIntervalstringTime interval, fixed as 'custom'
loopsstringRepeat days; '1111111' means all seven days are on, starting from Sunday
endstringEnd time in HH:mm, e.g., 23:59

Examples

Example

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