ocpp/v2_1/datatype/total_usage

OCPP 2.1 TotalUsage data type (schema TotalUsageType).

to_json/decoder map to/from its OCPP-J JSON object; new (when present) builds a value from the required fields only.

Types

This contains the calculated usage of energy, charging time and idle time during a transaction.

FieldTypeReqDescription
charging_timeIntTotal duration of the charging session (including the duration of charging and not charging), in seconds.
custom_dataCustomData
energyFloat
idle_timeIntTotal duration of the charging session where the EV was not charging (no energy was transferred between EVSE and EV), in seconds.
reservation_timeIntTotal time of reservation in seconds.

Schema: TotalUsageType

pub type TotalUsage {
  TotalUsage(
    charging_time: Int,
    custom_data: option.Option(custom_data.CustomData),
    energy: Float,
    idle_time: Int,
    reservation_time: option.Option(Int),
  )
}

Constructors

Values

pub fn decoder() -> decode.Decoder(TotalUsage)

Decode a TotalUsage from its OCPP-J JSON object, enforcing schema constraints.

pub fn new(
  charging_time charging_time: Int,
  energy energy: Float,
  idle_time idle_time: Int,
) -> TotalUsage

Construct a TotalUsage from its required fields, with every optional field set to None.

pub fn to_json(value: TotalUsage) -> json.Json

Encode a TotalUsage to its OCPP-J JSON object.

Search Document