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

# addActionSet(withName:completionHandler:)

Adds a new action set to the home.

```
func addActionSet(withName actionSetName: String, completionHandler completion: @escaping @Sendable (HMActionSet?, (any Error)?) -> Void)
```

## Parameters

`actionSetName`

The name of the new action set. Must not be `nil`, and must not be the name of an action set already in the home.

`completion`

The block executed after the request is processed.

- actionSet: The newly created action set.
- error: `nil` on success; otherwise, error object indicating the reason for failure.

---

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)