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

# addZone(withName:completionHandler:)

Adds a new zone to the home.

## Declaration

```swift
func addZone(withName zoneName: String, completionHandler completion: @escaping @Sendable (HMZone?, (any Error)?) -> Void)
```

```swift
func addZone(named zoneName: String) async throws -> HMZone
```

## Parameters

- `zoneName`: The name of the new zone. Must not be nil, and must not be the name of a zone already in the home.
- `completion`: The block executed after the request is processed.

## See Also

### Grouping rooms into zones

- [zones](homekit/hmhome/zones.md)
- [removeZone(_:completionHandler:)](homekit/hmhome/removezone(_:completionhandler:).md)
- [HMZone](homekit/hmzone.md)
