ocpp/v2_1/message/transaction_event

OCPP 2.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_1/dispatch.

Types

FieldTypeReqDescription
cable_max_currentInt—The maximum current of the connected cable in Ampere (A).
cost_detailsCostDetails—
custom_dataCustomData—
event_typeTransactionEvent✓
evseEvse—
evse_sleepBool—(2.1) True when EVSE electronics are in sleep mode for this transaction. Default value (when absent) is false.
id_tokenIdToken—
meter_valueList(MeterValue)—(≥ 1 items)
number_of_phases_usedInt—If 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 as follows: + 1: The numberPhases in the currently used ChargingSchedule. + 2: The number of phases provided via device management. (0–3)
offlineBool—Indication that this transaction event happened when the Charging Station was offline. Default = false, meaning: the event occurred when the Charging Station was online.
preconditioning_statusPreconditioningStatus—
reservation_idInt—This contains the Id of the reservation that terminates as a result of this transaction. (≥ 0)
seq_noInt✓Incremental sequence number, helps with determining if all messages of a transaction have been received. (≥ 0)
timestampDateTime✓The 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),
    cost_details: option.Option(cost_details.CostDetails),
    custom_data: option.Option(custom_data.CustomData),
    event_type: transaction_event.TransactionEvent,
    evse: option.Option(evse.Evse),
    evse_sleep: option.Option(Bool),
    id_token: option.Option(id_token.IdToken),
    meter_value: option.Option(List(meter_value.MeterValue)),
    number_of_phases_used: option.Option(Int),
    offline: option.Option(Bool),
    preconditioning_status: option.Option(
      preconditioning_status.PreconditioningStatus,
    ),
    reservation_id: option.Option(Int),
    seq_no: Int,
    timestamp: timestamp.Timestamp,
    transaction_info: transaction.Transaction,
    trigger_reason: trigger_reason.TriggerReason,
  )
}

Constructors

FieldTypeReqDescription
charging_priorityInt—Priority 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 has a higher priority than the one in IdTokenInfoType.
custom_dataCustomData—
id_token_infoIdTokenInfo—
total_costFloat—When eventType of TransactionEventRequest is Updated, then this value contains the running cost. When eventType of TransactionEventRequest is Ended, then this contains the final total cost of this transaction, including taxes, in the currency configured with the Configuration Variable: Currency. Absence of this value does not imply that the transaction was free. To indicate a free transaction, the CSMS SHALL send a value of 0.00.
transaction_limitTransactionLimit—
updated_personal_messageMessageContent—
updated_personal_message_extraList(MessageContent)—(1–4 items)

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),
    transaction_limit: option.Option(
      transaction_limit.TransactionLimit,
    ),
    updated_personal_message: option.Option(
      message_content.MessageContent,
    ),
    updated_personal_message_extra: option.Option(
      List(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