# DeviceEnergyManagementTrait.ConstraintsStruct

# DeviceEnergyManagementTrait.ConstraintsStruct


```
class DeviceEnergyManagementTrait.ConstraintsStruct : ClusterStruct
```

<br />

*** ** * ** ***

Allows a client such as an EMS to inform an ESA about a constraint period.

## Summary

| ### Nested types |
|---|
| `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi enum https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct.StructFields : https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-enum/index.html, https://developers.home.google.com/reference/kotlin/com/google/home/Field` Descriptor enum for this struct's fields. |

| ### Public constructors |
|---|
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#ConstraintsStruct(kotlin.UInt,kotlin.UInt,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue)( startTime: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html, duration: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html, nominalPower: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html>, maximumEnergy: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html>, loadControl: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html> )` Creates the ConstraintsStruct class. |

| ### Public functions |
|---|---|
| `open https://developers.home.google.com/reference/kotlin/com/google/home/StructDescriptor` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#getDescriptor()()` Returns the descriptor for the struct. |
| `open https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html?` | `@https://developers.home.google.com/reference/kotlin/com/google/home/annotation/HomeExperimentalGenericApi https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#getFieldValueById(kotlin.UInt)(tagId: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html)` Returns the value of the field for the given tag ID. |

| ### Public properties |
|---|---|
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#duration()` The duration, in seconds, of the constraint period. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-byte/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#loadControl()` Indicates the turn-up or turn-down value for the ESA during the constraint period. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#maximumEnergy()` The maximum amount of energy, in megawatt hours, that the ESA can use during the constraint period. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#nominalPower()` The nominal power, in milliwatts, at which the EMS requests the ESA to operate during the constrained period. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/DeviceEnergyManagementTrait.ConstraintsStruct#startTime()` The start time, in UTC, of the constraint period. |

## Public constructors

### ConstraintsStruct

```
ConstraintsStruct(
    startTime: UInt,
    duration: UInt,
    nominalPower: OptionalValue<Long> = OptionalValue.absent(),
    maximumEnergy: OptionalValue<Long> = OptionalValue.absent(),
    loadControl: OptionalValue<Byte> = OptionalValue.absent()
)
```

Creates the ConstraintsStruct class.

## Public functions

### getDescriptor

```
@HomeExperimentalGenericApi
open fun getDescriptor(): StructDescriptor
```

Returns the descriptor for the struct.

### getFieldValueById

```
@HomeExperimentalGenericApi
open fun getFieldValueById(tagId: UInt): Any?
```

Returns the value of the field for the given tag ID.

## Public properties

### duration

```
val duration: UInt
```

The duration, in seconds, of the constraint period.

### loadControl

```
val loadControl: OptionalValue<Byte>
```

Indicates the turn-up or turn-down value for the ESA during the constraint period. This is expressed as a signed value between -100 and +100. A negative value indicates a request to use less energy, and a positive value indicates a request to use more energy. A value of 0 is neutral.

### maximumEnergy

```
val maximumEnergy: OptionalValue<Long>
```

The maximum amount of energy, in megawatt hours, that the ESA can use during the constraint period. This is a signed value and can be used to indicate charging or discharging.

### nominalPower

```
val nominalPower: OptionalValue<Long>
```

The nominal power, in milliwatts, at which the EMS requests the ESA to operate during the constrained period.

### startTime

```
val startTime: UInt
```

The start time, in UTC, of the constraint period.