<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMTrigger/enable(_:completionHandler:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMTrigger(im)enable:completionHandler:"
  },
  "title" : "enable(_:completionHandler:)"
}
-->

# enable(_:completionHandler:)

Changes the enabled state of the trigger.

```
func enable(_ enable: Bool, completionHandler completion: @escaping @Sendable ((any Error)?) -> Void)
```

## Parameters

`enable`

`TRUE` to enable the trigger, <doc://com.apple.documentation/documentation/Swift/false> to disable it.

`completion`

The block executed after the request is processed.

- error: `nil` on success; otherwise, error object indicating the reason for failure.

## Discussion

Triggers can only be enabled when they are in a home. You add triggers to a home using the [`addTrigger(_:completionHandler:)`](/documentation/HomeKit/HMHome/addTrigger(_:completionHandler:)) method of [`HMHome`](/documentation/HomeKit/HMHome).

When a trigger is enabled its firing conditions are checked for validity and the system starts tracking the trigger and when it will next fire.

In addition to having valid firing conditions, to be successfully enabled a trigger must have at least one action set associated with it, and every action set associated with the trigger must have at least one action.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)