ocpp/v2_0_1/message/transaction_event

OCPP 2.0.1 TransactionEvent action.

Request/Response payload types with their OCPP-J codecs (request_to_json/request_decoder, response_to_json/ response_decoder). Transport-agnostic; the action-string mapping lives in ocpp/v2_0_1/dispatch.

Types

FieldTypeReqDescription
cable_max_currentIntThe maximum current of the connected cable in Ampere (A).
custom_dataCustomData
event_typeTransactionEvent
evseEvse
id_tokenIdTokenType
meter_valueList(MeterValue)
number_of_phases_usedIntIf the Charging Station is able to report the number of phases used, then it SHALL provide it. When omitted the CSMS may be able to determine the number of phases used via device management.
offlineBoolIndication that this transaction event happened when the Charging Station was offline. Default = false, meaning: the event occurred when the Charging Station was online.
reservation_idIntThis contains the Id of the reservation that terminates as a result of this transaction.
seq_noIntIncremental sequence number, helps with determining if all messages of a transaction have been received.
timestampDateTimeThe date and time at which this transaction event occurred.
transaction_infoTransaction
trigger_reasonTriggerReason

Schema: TransactionEventRequest

pub type Request {
  Request(
    cable_max_current: option.Option(Int),
    custom_data: option.Option(custom_data.CustomData),
    event_type: transaction_event.TransactionEvent,
    evse: option.Option(evse.Evse),
    id_token: option.Option(id_token_type.IdTokenType),
    meter_value: option.Option(List(meter_value.MeterValue)),
    number_of_phases_used: option.Option(Int),
    offline: option.Option(Bool),
    reservation_id: option.Option(Int),
    seq_no: Int,
    timestamp: timestamp.Timestamp,
    transaction_info: transaction.Transaction,
    trigger_reason: trigger_reason.TriggerReason,
  )
}

Constructors

FieldTypeReqDescription
charging_priorityIntPriority from a business point of view. Default priority is 0, The range is from -9 to 9. Higher values indicate a higher priority. The chargingPriority in TransactionEventResponse is temporarily, so it may not be set in the IdTokenInfoType afterwards. Also the chargingPriority in TransactionEventResponse overrules the one in IdTokenInfoType.
custom_dataCustomData
id_token_infoIdTokenInfo
total_costFloatSHALL only be sent when charging has ended. Final total cost of this transaction, including taxes. In the currency configured with the Configuration Variable: Currency. When omitted, the transaction was NOT free. To indicate a free transaction, the CSMS SHALL send 0.00.
updated_personal_messageMessageContent

Schema: TransactionEventResponse

pub type Response {
  Response(
    charging_priority: option.Option(Int),
    custom_data: option.Option(custom_data.CustomData),
    id_token_info: option.Option(id_token_info.IdTokenInfo),
    total_cost: option.Option(Float),
    updated_personal_message: option.Option(
      message_content.MessageContent,
    ),
  )
}

Constructors

Values

pub fn new_request(
  event_type event_type: transaction_event.TransactionEvent,
  seq_no seq_no: Int,
  timestamp timestamp: timestamp.Timestamp,
  transaction_info transaction_info: transaction.Transaction,
  trigger_reason trigger_reason: trigger_reason.TriggerReason,
) -> Request

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

pub fn new_response() -> Response

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

pub fn request_decoder() -> decode.Decoder(Request)

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

pub fn request_to_json(value: Request) -> json.Json

Encode a Request to its OCPP-J JSON object.

pub fn response_decoder() -> decode.Decoder(Response)

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

pub fn response_to_json(value: Response) -> json.Json

Encode a Response to its OCPP-J JSON object.

Search Document