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
| Field | Type | Req | Description |
|---|---|---|---|
cable_max_current | Int | — | The maximum current of the connected cable in Ampere (A). |
custom_data | CustomData | — | |
event_type | TransactionEvent | ✓ | |
evse | Evse | — | |
id_token | IdTokenType | — | |
meter_value | List(MeterValue) | — | |
number_of_phases_used | Int | — | 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 via device management. |
offline | Bool | — | Indication that this transaction event happened when the Charging Station was offline. Default = false, meaning: the event occurred when the Charging Station was online. |
reservation_id | Int | — | This contains the Id of the reservation that terminates as a result of this transaction. |
seq_no | Int | ✓ | Incremental sequence number, helps with determining if all messages of a transaction have been received. |
timestamp | DateTime | ✓ | The date and time at which this transaction event occurred. |
transaction_info | Transaction | ✓ | |
trigger_reason | TriggerReason | ✓ |
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
-
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, )
| Field | Type | Req | Description |
|---|---|---|---|
charging_priority | Int | — | 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 overrules the one in IdTokenInfoType. |
custom_data | CustomData | — | |
id_token_info | IdTokenInfo | — | |
total_cost | Float | — | SHALL 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_message | MessageContent | — |
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
-
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, ), )
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 response_decoder() -> decode.Decoder(Response)
Decode a Response from its OCPP-J JSON object, enforcing schema constraints.