---
title: "init(characteristic:triggerValue:)"
framework: homekit
role: symbol
role_heading: Initializer
path: "homekit/hmcharacteristicevent/init(characteristic:triggervalue:)"
---

# init(characteristic:triggerValue:)

Creates a new characteristic event which triggers when the specified characteristic reaches the specified value.

## Declaration

```swift
init(characteristic: HMCharacteristic, triggerValue: TriggerValueType?)
```

## Parameters

- `characteristic`: The characteristic that the event is observing.
- `triggerValue`: The value of the characteristic that triggers the event. Specifying nil causes the event to fire every time the value of the characteristic changes.

## Return Value

Return Value An initialized characteristic event for the specified characteristic and trigger value.

## Discussion

Discussion Use a characteristic that supports notification; otherwise this initializer throws an exception.
