<!--
{
  "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/HMService/associatedServiceType",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Property",
  "symbol" : {
    "kind" : "Instance Property",
    "modules" : [
      "HomeKit"
    ],
    "preciseIdentifier" : "c:objc(cs)HMService(py)associatedServiceType"
  },
  "title" : "associatedServiceType"
}
-->

# associatedServiceType

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

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

## 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`](/documentation/HomeKit/HMCharacteristicTypePowerState), other than [`HMServiceTypeOutlet`](/documentation/HomeKit/HMServiceTypeOutlet) or [`HMServiceTypeSwitch`](/documentation/HomeKit/HMServiceTypeSwitch).

See [Accessory Service Types](/documentation/HomeKit/accessory-service-types) for a list of service types.

---

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)