<!--
{
  "availability" : [
    "iOS: 26.0.0 -",
    "iPadOS: 26.0.0 -",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "EnergyKit",
  "identifier" : "/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "EnergyKit"
    ],
    "preciseIdentifier" : "s:9EnergyKit24ElectricVehicleLoadEventV21ElectricalMeasurementV"
  },
  "title" : "ElectricVehicleLoadEvent.ElectricalMeasurement"
}
-->

# ElectricVehicleLoadEvent.ElectricalMeasurement

A description of the electricity consumed or generated by a device.

```
struct ElectricalMeasurement
```

## Topics

### Creating an electrical measurement

[`init(stateOfCharge: Int, direction: ElectricityFlowDirection, power: Measurement<UnitPower>, energy: Measurement<UnitEnergy>)`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/init(stateOfCharge:direction:power:energy:))

Initializes an electrical measurement for the electrical load event.

[`init(stateOfCharge: Int, direction: ElectricityFlowDirection, power: Measurement<UnitPower>, energy: Measurement<UnitEnergy>, performanceMetrics: ElectricVehicleLoadEvent.ElectricalMeasurement.PerformanceMetrics?)`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/init(stateOfCharge:direction:power:energy:performanceMetrics:))

Creates an electrical measurement with optional performance metrics.

### Getting electrical measurements

[`let stateOfCharge: Int`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/stateOfCharge)

The remaining capacity available in a battery
An integer ranging from `0` to `100` that’s proportional
to the percentage of remaining capacity available in the battery
where `0` and `100` correspond to the min and max
state of charge respectively.

[`let direction: ElectricityFlowDirection`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/direction)

The electricity being imported or exported to the grid.

[`let power: Measurement<UnitPower>`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/power)

The instantaneous power in milli-watts [mW] of the
reporting device.

[`let energy: Measurement<UnitEnergy>`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/energy)

The cumulative energy in milli-watt-hours [mWh] of the reporting device rounded to the nearest integer.

### Getting performance metrics

[`var performanceMetrics: ElectricVehicleLoadEvent.ElectricalMeasurement.PerformanceMetrics?`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/performanceMetrics-swift.property)

Performance metrics for an electrical measurement.

[`struct PerformanceMetrics`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/PerformanceMetrics-swift.struct)

Performance metrics for the current electrical measurement.

## Relationships

### Conforms To

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

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

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

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

---

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)