# ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct


```
class ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct : ClusterStruct
```

<br />

*** ** * ** ***

Indicates the amount of energy measured during a given measurement 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/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct.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/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#EnergyMeasurementStruct(kotlin.Long,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue,com.google.home.matter.serialization.OptionalValue)( energy: https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html, startTimestamp: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>, endTimestamp: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>, startSystime: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html>, endSystime: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html>, apparentEnergy: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html>, reactiveEnergy: https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html> )` Creates the EnergyMeasurementStruct 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/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#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/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#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://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/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#apparentEnergy()` The reported apparent energy. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#endSystime()` The time, in milliseconds, since boot at the end of the measurement period. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#endTimestamp()` The timestamp in UTC of the end of the measurement period. |
| `https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#energy()` The reported energy. |
| `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/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#reactiveEnergy()` The reported reactive energy. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-long/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#startSystime()` The time, in milliseconds, since boot at the start of the measurement period. |
| `https://developers.home.google.com/reference/kotlin/com/google/home/matter/serialization/OptionalValue<https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-u-int/index.html>` | `https://developers.home.google.com/reference/kotlin/com/google/home/matter/standard/ElectricalEnergyMeasurementTrait.EnergyMeasurementStruct#startTimestamp()` The timestamp in UTC of the start of the measurement period. |

## Public constructors

### EnergyMeasurementStruct

```
EnergyMeasurementStruct(
    energy: Long = 0,
    startTimestamp: OptionalValue<UInt> = OptionalValue.absent(),
    endTimestamp: OptionalValue<UInt> = OptionalValue.absent(),
    startSystime: OptionalValue<ULong> = OptionalValue.absent(),
    endSystime: OptionalValue<ULong> = OptionalValue.absent(),
    apparentEnergy: OptionalValue<Long> = OptionalValue.absent(),
    reactiveEnergy: OptionalValue<Long> = OptionalValue.absent()
)
```

Creates the EnergyMeasurementStruct 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

### apparentEnergy

```
val apparentEnergy: OptionalValue<Long>
```

The reported apparent energy.

### endSystime

```
val endSystime: OptionalValue<ULong>
```

The time, in milliseconds, since boot at the end of the measurement period.

### endTimestamp

```
val endTimestamp: OptionalValue<UInt>
```

The timestamp in UTC of the end of the measurement period.

### energy

```
val energy: Long
```

The reported energy.

### reactiveEnergy

```
val reactiveEnergy: OptionalValue<Long>
```

The reported reactive energy.

### startSystime

```
val startSystime: OptionalValue<ULong>
```

The time, in milliseconds, since boot at the start of the measurement period.

### startTimestamp

```
val startTimestamp: OptionalValue<UInt>
```

The timestamp in UTC of the start of the measurement period.