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

# HMCharacteristicWriteAction

An action in an action set that writes a value to a characteristic.

```
class HMCharacteristicWriteAction<TargetValueType> where TargetValueType : NSCopying
```

## Overview

Action sets are instances of [`HMActionSet`](/documentation/HomeKit/HMActionSet).

## Topics

### New Methods

[`-  initWithCharacteristic:targetValue:`](/documentation/HomeKit/HMCharacteristicWriteAction/init(characteristic:targetValue:))

Initialize a characteristic write action with a specified characteristic and target value.

[`characteristic`](/documentation/HomeKit/HMCharacteristicWriteAction/characteristic)

The characteristic whose value is to be written by the action.

[`targetValue`](/documentation/HomeKit/HMCharacteristicWriteAction/targetValue)

The value that will be written to the characteristic when the action is executed.

[`-  updateTargetValue:completionHandler:`](/documentation/HomeKit/HMCharacteristicWriteAction/updateTargetValue(_:completionHandler:))

Updates the target value.

## Relationships

### Conforms To

[`CustomDebugStringConvertible`](/documentation/Swift/CustomDebugStringConvertible)

[`Hashable`](/documentation/Swift/Hashable)

[`CVarArg`](/documentation/Swift/CVarArg)

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`CustomStringConvertible`](/documentation/Swift/CustomStringConvertible)

[`Sendable`](/documentation/Swift/Sendable)

[`NSObjectProtocol`](/documentation/ObjectiveC/NSObjectProtocol)

[`Equatable`](/documentation/Swift/Equatable)

### Inherits From

[`HMAction`](/documentation/HomeKit/HMAction)

---

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)