One Logo Pool Ball
EnergyKit · IOS API REFERENCE

ElectricVehicleLoadEvent

struct · iOS 26.0+ · SDK 27.1

struct ElectricVehicleLoadEvent

A measurement of the electricity consumed or generated by an electric vehicle while connected to a charger. Submit events representing electricity consumption or generate to provide insights about electricity usage and their managed devices’ adherence to ``ElectricityGuidance``. These events, called ``ElectricVehicleLoadEvent``s are data points recorded at specific points in time for a given ``EnergyVenue`` that allow the venue to determine when the device used electricity and its cleanliness based on historical `ElectricityGuidance`. Additionally, relative cost can be determined using the rate plan at the `EnergyVenue`, if available. You can submit ``ElectricVehicleLoadEvent``s as your managed devices consume or produce electricity. You can request insights based on submitted ``ElectricVehicleLoadEvent``s . Insights are only available upon your submission of ``ElectricVehicleLoadEvent``s . ### Submit ElectricVehicleLoadEvent Save data to the ``ElectricVehicleLoadEvent`` with a sampling rate that's proportional to the rate of change of electrical quantities such a power or state of charge (SoC). Generally, one sample every 15 minutes (at 0, 15, 30, and 45-minute marks) is sufficient when the device's session is active and no significant changes occur to its power state. Significant changes may include: * A person initiated an action. * A pause in power consumption such as going idle. * The power changed. Unplugged or plugged in vehicles while idle between charging sessions don’t generate idle events. The device that requested ``ElectricityGuidance`` must submit the corresponding load events. Load events for an ``EnergyVenue`` are accessible to all people that use the Home app.

Members (8)

get · iOS 27.0+

deviceName

TypeScript
get deviceName(): string
Swift declaration
var deviceName: String { get }

A human-readable name for the device. The max length is `250 UTF-16` characters. Names that violate these rules are automatically sanitized: - Isn't empty, and less than or equal to 250 characters. - Contains only alphanumeric, whitespace, punctuation, or symbol characters.

get · iOS 26.0+

measurement

TypeScript
get measurement(): ElectricVehicleLoadEvent_ElectricalMeasurement
Swift declaration
let measurement: ElectricVehicleLoadEvent.ElectricalMeasurement

The electricity consumption or generation of a device.

get · iOS 26.0+

id

TypeScript
get id(): string
Swift declaration
let id: UUID

The unique identifier of the electrical load event.

get · iOS 26.0+

session

TypeScript
get session(): ElectricVehicleLoadEvent_Session
Swift declaration
let session: ElectricVehicleLoadEvent.Session

The session information. An electric vehicle between charging or discharging sessions can be idling and load events must not be generated

get · iOS 26.0+

deviceID

TypeScript
get deviceID(): string
Swift declaration
let deviceID: String

The device's unique stable identifier. The max length is `64 UTF-8` bytes. UUID strings are permitted. The following are enforced as preconditions: - Isn't empty, and less than or equal to 64 UTF-8 bytes. - Uses only alphanumeric, space, hyphen, and apostrophe characters. - Starts and ends with an alphanumeric character.

get · iOS 26.0+

timestamp

TypeScript
get timestamp(): globalThis.Date
Swift declaration
let timestamp: Date

The timestamp for when the event occurred.

init · iOS 27.0+

init

TypeScript
static initTimestampMeasurementSessionDevice(timestamp: globalThis.Date, measurement: ElectricVehicleLoadEvent_ElectricalMeasurement, session: ElectricVehicleLoadEvent_Session, device: ElectricalLoadDevice): ElectricVehicleLoadEvent
Swift declaration
init(timestamp: Date, measurement: ElectricVehicleLoadEvent.ElectricalMeasurement, session: ElectricVehicleLoadEvent.Session, device: ElectricalLoadDevice)

Creates an electric vehicle load event. - Parameters: - timestamp: The timestamp for when the event occurred. - measurement: The electricity consumption or generation of a device. - session: The session information - device: The electrical load device that generated this event.

init · iOS 26.0+ · Deprecated in iOS 27.0

init

TypeScript
static initTimestampMeasurementSessionDeviceID(timestamp: globalThis.Date, measurement: ElectricVehicleLoadEvent_ElectricalMeasurement, session: ElectricVehicleLoadEvent_Session, deviceID: string): ElectricVehicleLoadEvent
Swift declaration
init(timestamp: Date, measurement: ElectricVehicleLoadEvent.ElectricalMeasurement, session: ElectricVehicleLoadEvent.Session, deviceID: String)

Creates an ``ElectricVehicleLoadEvent`` - Parameters: - timestamp: The timestamp for when the event occurred. - measurement: The electricity consumption or generation of a device. - session: The session information - deviceID: The device's unique stable identifier. - Throws: ``EnergyKit.invalidDeviceID``

Skipped declarations

No declarations were skipped in this snapshot.

All EnergyKit types →