<!--
{
  "availability" : [
    "iOS: 26.0.0 - 27.0.0",
    "iPadOS: 26.0.0 - 27.0.0",
    "macCatalyst: -"
  ],
  "documentType" : "symbol",
  "framework" : "EnergyKit",
  "identifier" : "/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement/init(stateOfCharge:direction:power:energy:)",
  "metadataVersion" : "0.1.0",
  "role" : "Initializer",
  "symbol" : {
    "kind" : "Initializer",
    "modules" : [
      "EnergyKit"
    ],
    "preciseIdentifier" : "s:9EnergyKit24ElectricVehicleLoadEventV21ElectricalMeasurementV13stateOfCharge9direction5power6energyAESi_AA24ElectricityFlowDirectionO10Foundation0H0VySo11NSUnitPowerCGANySo0sA0CGtcfc"
  },
  "title" : "init(stateOfCharge:direction:power:energy:)"
}
-->

# 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>)
```

## Parameters

`stateOfCharge`

The remaining capacity available in a battery

`direction`

Specifies whether electricity is being imported from the grid or exported to the grid.

`power`

Power in milli-watts

`energy`

The accumulated electrical energy consumed or generated by the device in milli-watt hours. The accumulator is reset on `ElectricalLoadEvent/Session/State/end`.

---

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)