Ocpp Message ++++++++++++++ .. admonition:: IMPORTANT. :class: warning This message supports only the OCPP messages listed in the table below. How the envelope is used ------------------------ The ``ocpp_message`` envelope is used in three ways. Which one applies depends on the OCPP message being sent and on who sends it: **A. OEM impersonates the CSMS.** The OEM sends a CSMS-to-CS request on ``cs/josev``. Josev handles it locally, exactly as if the CSMS had sent it, and answers on ``josev/cs`` with the response the CSMS would have received. Nothing is sent to the CSMS. **B. Josev forwards a CSMS request to the OEM.** The CSMS sends a request that Josev cannot answer itself. Josev forwards it on ``josev/cs`` (or ``ocpp/smart_charging``), the OEM (or smart charging service) answers on the inverted topic, and Josev relays that answer to the CSMS. **C. OEM sends a CS-to-CSMS message through Josev.** The OEM sends a CS-to-CSMS request on ``cs/josev``. Josev sends it to the CSMS over the websocket and relays the CSMS response back on ``josev/cs``. In every case the response carries the request's ``id``. A failure is returned as a response with ``message_type`` ``CallError``, never as a missing response. .. list-table:: Allowed messages and how Josev handles them :header-rows: 1 :widths: 22 12 66 * - Message - Usage - Behaviour * - GetVariables - A - Josev answers from its device model. * - SetVariables - A - Josev applies the change to its device model and answers as the CS would. * - SetNetworkProfile - A - Josev stores the connection profile in the given slot. * - RequestStartTransaction - A - Josev runs its remote start flow, as for a CSMS remote start. * - GetInstalledCertificateIds - A or B - Depends on who manages the certificates. If Josev does (default), the OEM can send this to get the certificates installed in Josev's keystore (A). If certificate management is delegated to the OEM (``EXTERNAL_CERTIFICATE_MANAGER=true``), Josev forwards the CSMS request to the OEM, which must answer with its own certificates (B). * - InstallCertificate - A or B - Same as GetInstalledCertificateIds: installed in Josev's keystore (A), or forwarded to the OEM when certificate management is external (B). * - DeleteCertificate - A or B - Same as GetInstalledCertificateIds. * - CertificateSigned - A or B - Same as GetInstalledCertificateIds. If ``requestId`` is given it must match a SignCertificate Josev is waiting on, or the request is rejected. * - SetChargingProfile - B - Forwarded by Josev on ``ocpp/smart_charging``; the smart charging service answers. An OEM that sends it on ``cs/josev`` is also forwarded there. * - ClearChargingProfile - B - Same as SetChargingProfile. * - GetChargingProfiles - B - Same as SetChargingProfile. * - GetCompositeSchedule - B - Same as SetChargingProfile. * - UpdateDynamicSchedule - B - Same as SetChargingProfile (OCPP 2.1 only). * - SignCertificate - C - Sent to the CSMS; the CSMS response is relayed. The signed certificate arrives later as a CertificateSigned request from the CSMS. * - NotifyEVChargingNeeds - C - Sent to the CSMS (OCPP 2.1); the CSMS response is relayed. * - NotifyEvent - C - Sent to the CSMS; the CSMS response is relayed. * - SecurityEvent - C - Sent to the CSMS as ``SecurityEventNotification``; the CSMS response is relayed. * - ReportChargingProfiles - C - Sent to the CSMS; the CSMS response is relayed. * - SetDefaultTariff - A - OCPP 2.1. Allowed in the schema; not yet handled by Josev, which answers ``CallError``. * - GetTariffs - A - OCPP 2.1. Allowed in the schema; not yet handled by Josev, which answers ``CallError``. * - NotifySettlement - C - OCPP 2.1. Allowed in the schema; not yet handled by Josev, which answers ``CallError``. ------------------- OcppMessageRequest ------------------- .. admonition:: Description. :class: seealso Used to embed OCPP request and response messages, allowing the OEM and Josev to exchange OCPP messages. OCPP request messages can be sent by OEM or Josev using the MQTT OcppMessageRequest, where the CALL fields "Action" and "Payload" as defined in the OCPP specification (OCPP Ed.3 part 4 section 4.2.1) correspond to the "message_name" and the "payload" fields in the MQTT message. .. jsonschema:: ../../../schemas/OcppMessageRequest.json :hide_key: /**/additionalProperties Example:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "GetVariables", "payload": { "getVariableData": [ {"component": {"name": "TxCtrlr"}, "variable": {"name": "TxStartPoint"}} ] } } } --------------------- OcppMessageResponse --------------------- Ocpp response messages can be sent by OEM or Josev using the MQTT OcppMessageResponse, where the CALLRESULT field "Payload" as defined in the OCPP specification (OCPP Ed.3 part 4 section 4.2.2) corresponds to the "payload" field in the MQTT message. .. jsonschema:: ../../../schemas/OcppMessageResponse.json :hide_key: /**/additionalProperties Example:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "getVariableResult":[ { "attributeStatus":"Accepted", "component":{"name":"TxCtrlr"}, "variable":{"name":"TxStartPoint"}, "attributeType":"Actual", "attributeValue":"Authorized,EVConnected" } ] } } } If an error is encounter while processing the request, the response will contain a message type CallError as described in the example below. Example:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallError", "ocpp_version": "ocpp2.0.1", "error_code": "FormatViolation", "error_description": "Payload for Action is syntactically incorrect or structure for Action" "error_details": { "details": "An internal error occurred" } } } --------------------------------------------- OcppMessageRequest message examples: --------------------------------------------- Example GetVariables Multiple Variables:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.0.1", "message_name":"GetVariables", "payload":{ "getVariableData":[ { "attributeType":"Actual", "component":{ "name":"OCPPCommCtrlr" }, "variable":{ "name":"OfflineThreshold" } }, { "attributeType":"Actual", "component":{ "name":"AuthCtrlr" }, "variable":{ "name":"LocalAuthorizeOffline" } } ] } } } Example GetInstalledCertificateIds:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.0.1", "message_name":"GetInstalledCertificateIds", "payload":{ "certificateType": [ "CSMSRootCertificate" ] } } } Example SetVariables:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "SetVariables", "payload": { "setVariableData": [ { "attributeType": "Actual", "attributeValue": "300", "component": { "name": "OCPPCommCtrlr" }, "variable": { "name": "OfflineThreshold" } }, { "attributeType": "Actual", "attributeValue": "true", "component": { "name": "AuthCtrlr" }, "variable": { "name": "LocalAuthorizeOffline" } } ] } } } Example InstallCertificate:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "InstallCertificate", "payload": { "certificate": "-----BEGIN CERTIFICATE-----\nMIIB6TCCAY+gAwIBAgIBBDAKBggqhkjOPQQDAjBbMRcwFQYDVQQDDA5PQ1RUIFJv\nb3QgQ0EgMjEdMBsGA1UECgwUT3BlbiBDaGFyZ2UgQWxsaWFuY2UxCzAJBgNVBAYT\nAk5MMRQwEgYKCZImiZPyLGQBGRYET0NUVDAgFw0yNDA1MzAxMzE3MjBaGA8yMDY0\nMDUyMDEzMTcyMFowWzEXMBUGA1UEAwwOT0NUVCBSb290IENBIDIxHTAbBgNVBAoM\nFE9wZW4gQ2hhcmdlIEFsbGlhbmNlMQswCQYDVQQGEwJOTDEUMBIGCgmSJomT8ixk\nARkWBE9DVFQwWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAATuV4ikq+qqgURL2m4g\ncWRNHvUffxvZQVf2W66PIMAcIUShWQBGxeoTh4dA50lppIZ9VnCGqqUPuzp9o76K\nZh0jo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNVHQ4E\nFgQUofbdHSg6eZ0gV58pJ9cGYcj9AgEwCgYIKoZIzj0EAwIDSAAwRQIgMxFfJo32\nXJMda8wNqIa5InptZd1uqBT6RUgItUBEi7QCIQDZywzquLFUV2xWPzm4vV2jWUlZ\nyS1DpSC11DclzOkvUw==\n-----END CERTIFICATE-----\n", "certificateType": "CSMSRootCertificate" } } } Example DeleteCertificate:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "DeleteCertificate", "payload": { "certificateHashData": { "hashAlgorithm": "SHA256", "issuerKeyHash": "6fb6606900c9143982873363e815ae67163667c5792cd919afd37783bbff3095", "issuerNameHash": "d1c53ae0a9d11dda803bf38fc580dc9869ffb234b561fa624a20e618ce4bb656", "serialNumber": "4" } } } } Example SetNetworkProfile:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "SetNetworkProfile", "payload": { "configurationSlot": 2, "connectionData": { "messageTimeout": 75, "ocppCsmsUrl": "wss://324595e6999a17ae.octt.openchargealliance.org:18603", "ocppInterface": "Wired0", "ocppTransport": "JSON", "ocppVersion": "OCPP20", "securityProfile": 2 } } } } Example CertificateSigned:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "CertificateSigned", "payload": { "certificateChain": "-----BEGIN CERTIFICATE-----\nMIIBjzCCATagAwIBAgIBATAKBggqhkjOPQQDAjBZMRUwEwYDVQQDDAxPQ1RUIFJv\nb3QgQ0ExHTAbBgNVBAoMFE9wZW4gQ2hhcmdlIEFsbGlhbmNlMQswCQYDVQQGEwJO\nTDEUMBIGCgmSJomT8ixkARkWBE9DVFQwHhcNMjUwNDAzMTIyNzA5WhcNMjYwNDAz\nMTIyNzA5WjBKMRYwFAYDVQQDDA05NzgzMTYxNDg0MTAwMQ8wDQYDVQQKDAZTd2l0\nY2gxCzAJBgNVBAYTAkdCMRIwEAYKCZImiZPyLGQBGRYCQ1MwWTATBgcqhkjOPQIB\nBggqhkjOPQMBBwNCAARoXZcBZ1c6zGw0aXBYq3vSsFMFYIXe9H8MJRnWXb2ha0Hh\nGW8tzH4VGk3+NFOBZdbvg2FaXzrGSYSsLgTQNObuMAoGCCqGSM49BAMCA0cAMEQC\nIHQLQ5rtbakvDYA43IDhfDR8zU+BT01SFy7ViCLs5++xAiBrRkvMA0ZbtUNS81RA\nrgqq1n32rktoZEUzP2W29xmKkQ==\n-----END CERTIFICATE-----", "certificateType": "V2GCertificate" } } } Example SignCertificate:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "request", "data": { "ocpp_version": "ocpp2.0.1", "message_name": "SignCertificate", "payload": { "csr": "-----BEGIN CERTIFICATE REQUEST-----\nMIIBNTCB2wIBADBKMRYwFAYDVQQDDA05NzgzMTYxNDg0MTAwMQ8wDQYDVQQKDAZT\nd2l0Y2gxCzAJBgNVBAYTAkdCMRIwEAYKCZImiZPyLGQBGRYCQ1MwWTATBgcqhkjO\nPQIBBggqhkjOPQMBBwNCAARoXZcBZ1c6zGw0aXBYq3vSsFMFYIXe9H8MJRnWXb2h\na0HhGW8tzH4VGk3+NFOBZdbvg2FaXzrGSYSsLgTQNObuoC8wLQYJKoZIhvcNAQkO\nMSAwHjAOBgNVHQ8BAf8EBAMCB4AwDAYDVR0TAQH/BAIwADAKBggqhkjOPQQDAgNJ\nADBGAiEAsQIGFrb+KkXhpwRHoNA9g/7dp9rKzmhxLvSH81Zwj+MCIQC9RiTISte0\nSnBGle3oydnj7SskFtucdCqA7jeomE0fNw==\n-----END CERTIFICATE REQUEST-----\n", "certificateType": "ChargingStationCertificate" } } } Example SetChargingProfile:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.0.1", "message_name":"SetChargingProfile", "payload":{ "chargingProfile":{ "evseId":1, "chargingProfile":{ "id":1, "stackLevel":1, "chargingProfilePurpose":"TxProfile", "chargingProfileKind":"Dynamic", "chargingSchedule":[ { "id":1, "chargingRateUnit":"W", "chargingSchedulePeriod":[ { "startPeriod":1, "operationMode":"CentralSetpoint", "setpoint":5000, "setpointReactive":0 } ] } ] } } } } } Example NotifyEVChargingNeeds:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.1", "message_name":"NotifyEVChargingNeeds", "payload":{ "evseId":1, "chargingNeeds":{ "requestedEnergyTransfer":"DC_BPT", "controlMode":"DynamicControl", "mobilityNeedsMode":"EVCC", "v2xChargingParameters":{ "minChargePower":500, "maxChargePower":7000, "minDischargePower":500, "maxDischargePower":7000, "minChargeCurrent":2.2, "maxChargeCurrent":30, "minDischargeCurrent":2.2, "maxDischargeCurrent":30, "minVoltage":300, "maxVoltage":450, "evTargetEnergyRequest":65000, "evMinEnergyRequest":50000, "evMaxEnergyRequest":70000, "targetSoC":80 }, "departureTime":"2025-09-23T10:00:00Z" } } } } Example UpdateDynamicSchedule:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version": "ocpp2.1", "message_name": "UpdateDynamicSchedule", "payload": { "chargingProfileId": 1, "scheduleUpdate": { "setpoint": 5000, "setpointReactive": 0 } } } } Example NotifySettlement:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.1", "message_name":"NotifySettlement", "payload":{ "transactionId":"b1c2d3e4-5f60-4a7b-8c9d-0e1f2a3b4c5d", "pspRef":"PSP-2026-000123456", "status":"Settled", "settlementAmount":12.45, "settlementTime":"2026-09-22T14:32:10Z" } } } Example SetDefaultTariff:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.1", "message_name":"SetDefaultTariff", "payload":{ "evseId":0, "tariff":{ "tariffId":"tariff-default-2026-q4", "currency":"EUR", "description":[ { "language":"en", "content":"0.35 EUR/kWh" } ], "energy":{ "prices":[ {"priceKwh":0.35} ], "taxRates":[ {"type":"VAT","tax":21.0} ] }, "validFrom":"2026-10-01T00:00:00Z" } } } } Example GetTariffs:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.1", "message_name":"GetTariffs", "payload":{ "evseId":1 } } } Example RequestStartTransaction:: message = { "id":"2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name":"ocpp_message", "type":"request", "data":{ "ocpp_version":"ocpp2.0.1", "message_name":"RequestStartTransaction", "payload":{ "remoteStartId":12345, "evseId":1, "idToken":{ "idToken":"046DE3A0BA2A80", "type":"ISO14443" } } } } --------------------------------------------- OcppMessageResponse message examples: --------------------------------------------- Example GetInstalledCertificateIds response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "status":"Accepted", "certificateHashDataChain":[{ "certificateType": "CSMSRootCertificate", "certificateHashData":{ "hashAlgorithm":"SHA256", "issuerNameHash":"de61235ee2958b67c7a47469cccb7ccbf77501d57af72c437ca092467fa00cac", "issuerKeyHash":"84c8c4dfdec3696e58c124c76ed430f20c6fbcfaec0c4fbbe77b834c54d12e27", "serialNumber":"2" } }] } } } Example SetVariables response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "setVariableResult": [ { "attributeStatus": "Accepted", "component": { "name": "OCPPCommCtrlr" }, "variable": { "name": "OfflineThreshold" }, "attributeType": "Actual" }, { "attributeStatus": "Accepted", "component": { "name": "AuthCtrlr" }, "variable": { "name": "LocalAuthorizeOffline" }, "attributeType": "Actual" } ] } } } Example CertificateSigned response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "status": "Accepted" } } } Example CertificateSigned response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "status": "Accepted" } } Example SetChargingProfile response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "status": "Accepted" # or "Rejected" } } } Example NotifyEVChargingNeeds response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.1", "payload": { "status": "Accepted" # or "Rejected" or "Processing" } } } Example UpdateDynamicSchedule response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.1", "payload": { "status": "Accepted" # or "Rejected" } } } Example RequestStartTransaction response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.0.1", "payload": { "status": "Accepted", # or "Rejected" "transactionId": "b1c2d3e4-5f60-4a7b-8c9d-0e1f2a3b4c5d" } } } Example GetTariffs response:: message = { "id": "2b0aa109-21a1-4f2f-bdbd-6cdf139e7bb1", "name": "ocpp_message", "type": "response", "data": { "message_type": "CallResult", # or "CallError" "ocpp_version": "ocpp2.1", "payload": { "status": "Accepted", # or "Rejected" "tariff": { "tariffId": "tariff-default-2026-q4", "currency": "EUR", "validFrom": "2026-10-01T00:00:00Z" } } } }