Josev MQTT API example (cs_status_and_limits)

%%{init: {"theme":"light", "sequenceDiagram": {"htmlLabels": false}} }%% sequenceDiagram participant J as Josev participant CS as Charging Station J-)+CS: 4. cs_status_and_limits_request Note right of CS: channel/topic: josev/cs CS-)-J: 5. cs_status_and_limits_response Note right of CS: channel/topic: cs/josev CS--)J: 16. cp_status_update Note right of CS: channel/topic: cs/josev

Charging Session

%%{init: {"theme":"light", "sequenceDiagram": {"htmlLabels": false}} }%% sequenceDiagram participant J as Josev participant CS as Charging Station rect rgb(0,128,145) Note over J,CS: Boot Sequence CS-)CS: 1. HW and SW boot J-)+CS: 2. device_model_request CS-)-J: 3. device_model_response J-)+CS: 4. cs_status_and_limits_request CS-)-J: 5. cs_status_and_limits_response J-)+CS: 6. cs_parameters_request CS-)-J: 7. cs_parameters_response(max_current, status_code, ..) end rect rgb(15,128,2) Note over J,CS: Charging Session CS-)CS: 8. Vehicle Plugged (State B) CS--)J: 9. cp_status_update(state="B1"...) CS--)J: 10. meter_values_update(total_active_energy_exported...) Note right of CS: can be sent at any time J--)CS: 11. hlc_charging_update(evse_id...) Note right of CS: HLC means High Level Communication alt authorization triggered by iso15118 or CSMS J--)CS: 12. external_authorization_update(evse_id...) end alt EIM (ie.Card reader) CS-)+J: 13. cs_authorization_request(evse_id, idToken...) J-)-CS: 14. cs_authorization_response(status: "Accepted"...) end loop Charging Loop CS-)CS: 15. Vehicle Charging (State C) CS--)J: 16. cp_status_update(state="C2"...) end rect rgb(0,90,2) Note over J,CS: End of Charging Session alt EIM triggers stop_charge on CS side CS-)CS: 17. EIM detected CS-)+J: 18. cs_authorization_request(evse_id, idToken...) J-)-CS: 19. cs_authorization_response(status: "Accepted") end alt Remote stop from CSMS J-)+CS: 20. stop_charging_request(evse_id...) CS-)-J: 21. stop_charging_response(status:"accepted") end CS--)J: 22.cp_status_update(state="C1"...) CS-)CS: 23. Vehicle Stop Charging(State B1) CS--)J: 24.cp_status_update(state="B1"...) CS-)CS: 25. Vehicle Unplugged (State A) CS--)J: 26.cp_status_update(state="A1"...) end end rect rgb(0,102,153) Note over J,CS: Reset Sequence J-)+CS: 27. reset_request(id...) CS-)-J: 28. reset_response(status:"accepted") CS-)CS: 29. HW and SW Boot end


%%{init: {"flowchart": {"htmlLabels": false}} }%% flowchart TB subgraph EV["`**Electric Vehicle**`"] ev[Electric Vehicle Charge Controller] end subgraph CS["`**Charging Station**`"] subgraph hardware["`**Station Hardware**`"] plc["Power Line Communication"] end subgraph Josev["`**Josev Stack**`"] ocpp["OCPP service"] smart_charging["Smart Charging"] mqtt["MQTT Broker"] subgraph 15118["`**ISO-15118-implementation**`"] slac["SLAC"] exi["EXI module"] iso["ISO 15118 module"] end end mqtt<-->hardware mqtt<-->smart_charging mqtt<-->ocpp mqtt<--->iso mqtt<-->slac slac<--->plc iso<---->plc exi<-->iso end csms["`**CSMS**`"] subgraph MOCA["`**Mobility Operator CA**`"] validator["Contract certificate issuing authority"] end manager[Charging Station Manager] config manager-->config-->Josev ev<-->hardware ocpp<-->csms csms<-->MOCA

Slac sequence diagram

%%{init: {"theme":"light", "sequenceDiagram": {"htmlLabels": false}} }%% sequenceDiagram participant CS as Charging Station box Gray RSlac participant SM as Service Manager participant Service as Service(evse_id) end participant PLC Note over CS,Service: Startup SM-)CS: service_status Update(starting) opt if Parameters and Limits cannot be loaded from file SM-)+CS: cs_parameters Request CS-)-SM: cs_parameters Response SM-)+CS: cs_status_and_limits Request CS-)-SM: cs_status_and_limits Response end SM-)Service: spawn(evse_id) Service-)SM: set_hlc SM-)+CS: cp_pwm Request(evse_id, high_level_charging) Note over SM: High Level Charging may be<br/>configured in cs_parameters<br/>or config file CS-)-SM: cp_pwm Response Note over CS,Service: Matching Process CS-)SM: cp_status Update(evse_id, B2) SM-)Service: start PLC-->Service: SLAC matching process alt SLAC match succesful rect rgb(21,128,0) Service-)SM: matching SM-)CS: slac_service_status Update(evse_id, matching) Service-)SM: matched SM-)CS: slac_service_status Update(evse_id, matched) end end alt SLAC match failed rect rgb(153,0,0) Service-)SM: matching SM-)CS: slac_service_status Update(evse_id, matching) Service-)SM: failed SM-)CS: slac_service_status Update(evse_id, failed) end end alt SLAC initialization timeout (Basic Charging fallback) rect rgb(0,102,153) Note over SM, Service: after 20 seconds SM-)CS: slac_service_status Update(evse_id, basic_charging) SM-)+CS: cp_pwm Request(evse_id, F) CS-)-SM: cp_pwm Response Note over SM, Service: wait 5 seconds SM-)+CS: cp_pwm Request(evse_id, X1) CS-)-SM: cp_pwm Response Note over SM, Service: wait 0.5 seconds SM-)+CS: cp_pwm Request(evse_id, X2(nominal_current)) CS-)-SM: cp_pwm Response end end

Smart Charging

Boot Sequence

sequenceDiagram autonumber title Boot sequence Smart Charging Service participant oem as OEM participant sms as Smart Charging Service participant void as void sms -->> void: ServiceStatusUpdate(status="Starting") sms -->> oem: CsParametersRequest(...) oem ->> sms: CsParamaterResponse(...) sms -->> oem: CsStatusAndLimitsRequest(...) oem ->> sms: CsStatusAndLimitsResponse(...) sms -->> void: ServiceStatusUpdate(status="Ready")

Environment changes handling

sequenceDiagram autonumber title Handle changes in charger's environment participant oem as OEM participant ocpp as OCPP Service participant sms as Smart Charging Service participant rslac participant iso15118 loop par oem -->> sms: CpStatusUpdate(evse_id, connector_id, state, ..) and rslac -->> sms: SlacStatusUpdate(evse_id, status, ...) and ocpp -->> sms: SetChargingProfile(evse_id, ...) and sms -->> oem: CpPwmRequest(evse_id, current, ...) and sms -->> iso15118: Iso15118ChargeLimit(evse_id, limit, unit) end end