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

# ElectricVehicleLoadEvent

A measurement of the electricity consumed or generated by an electric vehicle while connected to a charger.

```
struct ElectricVehicleLoadEvent
```

## Overview

Submit load events to track session-based energy consumption and enable the framework to provide insights about electricity usage and adherence to [`ElectricityGuidance`](/documentation/EnergyKit/ElectricityGuidance). Load events focus on energy flow during active charging sessions. Load events include an indication of continuity, specifying the event’s beginning, active state, and end.

Include [`ElectricVehicleStatusEvent`](/documentation/EnergyKit/ElectricVehicleStatusEvent) in your load events to explain why charging behavior occurs and provide rich activity logs in the Home app. When you adopt the <doc://com.apple.documentation/documentation/BundleResources/Entitlements/com.apple.developer.energykit.loadevents-experience>, the Home app displays your device’s energy usage with the device name and performance metrics you provide.

> Important: The system stores and syncs the energy data that you provide through load events with end-to-end encryption through the entire process, ensuring the data isn’t accessible to anyone, even Apple. For more information, see [EnergyKit data security](https://support.apple.com/guide/security/secd0a47c14c).

### Submit electrical vehicle load events

Sample load events more frequently as charging conditions become more volatile. During stable charging — when power remains constant, with no user interventions — one sample every 15 minutes (at 0, 15, 30, and 45-minute marks) is sufficient. During volatile periods — when charging power fluctuates, a person pauses or resumes charging, or the vehicle adjusts its charge rate — submit additional events to capture the transitions.

Significant changes may include:

- A person initiated an action
- A pause in power consumption such as going idle
- The power changed

Unplugged or idle vehicles between charging sessions don’t generate events. The device that requested [`ElectricityGuidance`](/documentation/EnergyKit/ElectricityGuidance) must submit the corresponding load events.

> Note: The Home app displays all load events for a given ``doc://com.apple.energykit/documentation/EnergyKit/EnergyVenue``.

### Separate charging and discharging sessions

If your vehicle supports vehicle-to-grid (V2G) or vehicle-to-home (V2H) capabilities, use separate sessions for charging and discharging. Separate charging and discharging into individual sessions, even if they occur simultaneously, to allow the system to distinguish between them in the data.

## Topics

### Creating an electrical load event

[`init(timestamp: Date, measurement: ElectricVehicleLoadEvent.ElectricalMeasurement, session: ElectricVehicleLoadEvent.Session, device: ElectricalLoadDevice)`](/documentation/EnergyKit/ElectricVehicleLoadEvent/init(timestamp:measurement:session:device:))

Creates an electric vehicle load event.

### Getting load event information

[`let id: UUID`](/documentation/EnergyKit/ElectricVehicleLoadEvent/id)

The unique identifier of the electrical load event.

[`let timestamp: Date`](/documentation/EnergyKit/ElectricVehicleLoadEvent/timestamp)

The timestamp for when the event occurred.

[`let session: ElectricVehicleLoadEvent.Session`](/documentation/EnergyKit/ElectricVehicleLoadEvent/session-swift.property)

The session information.

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

A session that tracks the event.

### Getting device information

[`let deviceID: String`](/documentation/EnergyKit/ElectricVehicleLoadEvent/deviceID)

The device’s unique stable identifier.

[`var deviceName: String`](/documentation/EnergyKit/ElectricVehicleLoadEvent/deviceName)

A human-readable name for the device.

### Getting electrical measurements

[`let measurement: ElectricVehicleLoadEvent.ElectricalMeasurement`](/documentation/EnergyKit/ElectricVehicleLoadEvent/measurement)

The electricity consumption or generation of a device.

[`struct ElectricalMeasurement`](/documentation/EnergyKit/ElectricVehicleLoadEvent/ElectricalMeasurement)

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

### Deprecated

[`init(timestamp: Date, measurement: ElectricVehicleLoadEvent.ElectricalMeasurement, session: ElectricVehicleLoadEvent.Session, deviceID: String)`](/documentation/EnergyKit/ElectricVehicleLoadEvent/init(timestamp:measurement:session:deviceID:))

Creates an electric vehicle load event.

## Relationships

### Conforms To

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

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

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

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

[`ElectricalLoadEventProtocol`](/documentation/EnergyKit/ElectricalLoadEventProtocol)

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

---

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)