---
title: associatedServiceType
framework: homekit
role: symbol
role_heading: Instance Property
path: homekit/hmservice/associatedservicetype
---

# associatedServiceType

The type of the service associated with an outlet or a switch.

## Declaration

```swift
var associatedServiceType: String? { get }
```

## Discussion

Discussion Because different things can be plugged into outlets or controlled by switches, there is a tight association between a switch or outlet service and another service that it controls—for example, a lamp plugged into an outlet associates a lightbulb service with the outlet, even if the lamp itself is not a supported HomeKit accessory. The associated service can be any service defined by the HomeKit Accessory Profile that supports HMCharacteristicTypePowerState, other than HMServiceTypeOutlet or HMServiceTypeSwitch. See Accessory Service Types for a list of service types.

## See Also

### Associating a secondary service

- [updateAssociatedServiceType(_:completionHandler:)](homekit/hmservice/updateassociatedservicetype(_:completionhandler:).md)
