<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 8.0.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "HomeKit",
  "identifier" : "/documentation/HomeKit/HMTrigger",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMTrigger"
  },
  "title" : "HMTrigger"
}
-->

# HMTrigger

An abstract base class for triggering actions based on a set of conditions.

```
class HMTrigger
```

## Overview

This class defines the basic behavior of triggers, but does not itself specify any criteria for firing a trigger. Use instances of subclasses of [`HMTrigger`](/documentation/HomeKit/HMTrigger) to set up concrete triggers for actions.

## Topics

### Managing Triggers

[`name`](/documentation/HomeKit/HMTrigger/name)

The name of the trigger.

[`-  updateName:completionHandler:`](/documentation/HomeKit/HMTrigger/updateName(_:completionHandler:))

Updates the name of the trigger.

[`enabled`](/documentation/HomeKit/HMTrigger/isEnabled)

State of the trigger.

[`-  enable:completionHandler:`](/documentation/HomeKit/HMTrigger/enable(_:completionHandler:))

Changes the enabled state of the trigger.

[`lastFireDate`](/documentation/HomeKit/HMTrigger/lastFireDate)

The last time this trigger fired.

[`uniqueIdentifier`](/documentation/HomeKit/HMTrigger/uniqueIdentifier)

A unique identifier for this trigger.

### Managing Action Sets

[`actionSets`](/documentation/HomeKit/HMTrigger/actionSets)

Array of all action sets that will be executed by the trigger.

[`-  addActionSet:completionHandler:`](/documentation/HomeKit/HMTrigger/addActionSet(_:completionHandler:))

Adds an action set to the trigger.

[`-  removeActionSet:completionHandler:`](/documentation/HomeKit/HMTrigger/removeActionSet(_:completionHandler:))

Removes an action set from the trigger.

## Relationships

### Conforms To

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Sendable`](/documentation/Swift/Sendable)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Equatable`](/documentation/Swift/Equatable)

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

### Inherits From

[`NSObject-swift.class`](/documentation/ObjectiveC/NSObject-swift.class)

### Inherited By

[`HMTimerTrigger`](/documentation/HomeKit/HMTimerTrigger)

[`HMEventTrigger`](/documentation/HomeKit/HMEventTrigger)

---

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)