Skip to content

Data Models

The canonical VDV 261 types live in src/vdv_261/models.py and are published through the schema endpoints and the generated OpenAPI file.

Configuration Models

Model Purpose
V2ICPVehicleConfig Vehicle-side configuration for endpoint address, optional path, and password.
V2ICPBackendConfig Backend-side address, path, preconditioning policy, and VIN-indexed credentials.
V2ICPCredential Password policy model for a single VIN.

Wire Models

Model Purpose
VehicleParameterSet Vehicle telemetry and requests sent to the backend.
BackendParameterSet Depot directives and contextual values returned to the vehicle.
V2ICPVehicleRequest Full POST payload for /vdv261/v2icp/messages; exposes parameters on the wire as params in Python.
V2ICPBackendResponse Response payload returned by /vdv261/v2icp/messages.
DiagnosticEvent Vehicle-side diagnostic report submitted to /vdv261/v2icp/diagnostics.

Key Enums And Constraints

  • AddressType: 0 disabled, 1 fixed IP, 2 URL.
  • PreconditioningMode: vehicle chooses the type or backend specifies it.
  • ChargeStatus, HydrogenStatus, BatteryStatus, PreconditioningRequest, HvacDirective, and DiagnosticTrigger capture the protocol enumerations used in the models.
  • seq is constrained to 0..255.
  • VIN fields are constrained to 11..17 characters.
  • URL-based vehicle configs must provide v2icp_url, and the value must start with an alphabetic character.
  • Backend configs cannot use AddressType.DISABLED.
  • Credential passwords must be visible ASCII, at least eight characters long, and contain lowercase, uppercase, numeric, and approved special characters.

Extension Behaviour

  • VehicleParameterSet and BackendParameterSet both allow additional project-specific fields via extra="allow".
  • The models capture field-level constraints, while router logic enforces the extra VDV 261 rule that delta payloads (seq > 0) must include both h2_stat and bat_stat.
  • Generated schema artifacts live at ./schema/openapi.json and are rendered by VDV_261_API_Reference.md.