---
title: "addActionSet(withName:completionHandler:)"
framework: homekit
role: symbol
role_heading: Instance Method
path: "homekit/hmhome/addactionset(withname:completionhandler:)"
---

# addActionSet(withName:completionHandler:)

Adds a new action set to the home.

## Declaration

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

```swift
func addActionSet(named actionSetName: String) async throws -> HMActionSet
```

## 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.

## See Also

### Creating action sets

- [actionSets](homekit/hmhome/actionsets.md)
- [removeActionSet(_:completionHandler:)](homekit/hmhome/removeactionset(_:completionhandler:).md)
- [executeActionSet(_:completionHandler:)](homekit/hmhome/executeactionset(_:completionhandler:).md)
- [builtinActionSet(ofType:)](homekit/hmhome/builtinactionset(oftype:).md)
- [HMActionSet](homekit/hmactionset.md)
