UI Server: add WS Insomnia requests collection
[e-mobility-charging-stations-simulator.git] / README.md
index 7bdb708667baf9543ded62b4276d3ce07fa3b71a..637f20da0494dc5c33baa3c19569386ee12d0c76 100644 (file)
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@
 
 ## Summary
 
-Simple [node.js](https://nodejs.org/) software to simulate a set of charging stations based on the OCPP-J 1.6 protocol as part of SAP e-Mobility solution.
+Simple [node.js](https://nodejs.org/) software to simulate and scale a set of charging stations based on the OCPP-J 1.6 protocol as part of SAP e-Mobility solution.
 
 ## Prerequisites
 
@@ -170,7 +170,8 @@ But the modifications to test have to be done to the files in the build target d
 | mainVoltageMeterValues             | true/false | true                                                              | boolean                                                                                                                            | include charging stations main voltage MeterValues on three phased charging stations                                                                                                                  |
 | phaseLineToLineVoltageMeterValues  | true/false | true                                                              | boolean                                                                                                                            | include charging stations line to line voltage MeterValues on three phased charging stations                                                                                                          |
 | customValueLimitationMeterValues   | true/false | true                                                              | boolean                                                                                                                            | enable limitation on custom fluctuated value in MeterValues                                                                                                                                           |
-| commandsSupport                    |            | {<br />"incomingCommands": {},<br />"outgoingCommands": {}<br />} | {<br /> incomingCommands: Record<IncomingRequestCommand, boolean>;<br />outgoingCommands?: Record<RequestCommand, boolean>;<br />} | Configuration section for OCPP commands support. Empty section or subsections means all implemented commands are supported                                                                            |
+| commandsSupport                    |            | {<br />"incomingCommands": {},<br />"outgoingCommands": {}<br />} | {<br /> incomingCommands: Record<IncomingRequestCommand, boolean>;<br />outgoingCommands?: Record<RequestCommand, boolean>;<br />} | Configuration section for OCPP commands support. Empty section or subsections means all implemented OCPP commands are supported                                                                       |
+| messageTriggerSupport              |            | {}                                                                | Record<MessageTrigger, boolean>                                                                                                    | Configuration section for OCPP commands trigger support. Empty section means all implemented OCPP trigger commands are supported                                                                      |
 | Configuration                      |            |                                                                   | ChargingStationConfiguration                                                                                                       | charging stations OCPP parameters configuration section                                                                                                                                               |
 | AutomaticTransactionGenerator      |            |                                                                   | AutomaticTransactionGenerator                                                                                                      | charging stations ATG configuration section                                                                                                                                                           |
 | Connectors                         |            |                                                                   | Connectors                                                                                                                         | charging stations connectors configuration section                                                                                                                                                    |
@@ -309,7 +310,7 @@ make SUBMODULES_INIT=true
 - :white_check_mark: ChangeAvailability
 - :white_check_mark: ChangeConfiguration
 - :white_check_mark: ClearCache
-- :x: DataTransfer
+- :white_check_mark: DataTransfer
 - :white_check_mark: GetConfiguration
 - :white_check_mark: Heartbeat
 - :white_check_mark: MeterValues
@@ -410,7 +411,7 @@ Protocol to control the simulator via a Websocket or HTTP server.
 
 ### HTTP Protocol
 
-To learn how to use the HTTP protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
+To learn how to use the HTTP protocol to pilot the simulator, an [Insomnia](https://insomnia.rest/) HTTP requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
 
 ### Websocket Protocol
 
@@ -427,6 +428,8 @@ SRPC protocol over Websocket. PDU stands for 'Protocol Data Unit'.
   `uuid`: String uniquely linking the response to the request  
   `PDU`: Response parameters to requested procedure
 
+An [Insomnia](https://insomnia.rest/) WebSocket requests collection is available in [src/assets/ui-protocol](./src/assets/ui-protocol) directory.
+
 #### Version 0.0.1
 
 Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
@@ -467,48 +470,12 @@ Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
   `chargingStations`: ChargingStationData[]  
   }
 
-###### Start Transaction
-
-- Request:  
-  `ProcedureName`: 'startTransaction'  
-  `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `connectorId`: connector id integer,  
-  `idTag`: RFID tag string  
-  }
-
-- Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
-
-###### Stop Transaction
-
-- Request:  
-  `ProcedureName`: 'stopTransaction'  
-  `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `transactionId`: transaction id integer  
-  }
-
-- Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
-
 ###### Start Charging Station
 
 - Request:  
   `ProcedureName`: 'startChargingStation'  
   `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `responsesFailed`: failed responses payload array (optional)  
+  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations)  
   }
 
 - Response:  
@@ -516,6 +483,7 @@ Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
   `status`: 'success' | 'failure',  
   `hashIdsSucceeded`: charging station unique identifier strings array,  
   `hashIdsFailed`: charging station unique identifier strings array (optional)  
+  `responsesFailed`: failed responses payload array (optional)  
   }
 
 ###### Stop Charging Station
@@ -600,40 +568,94 @@ Set the Websocket header _Sec-Websocket-Protocol_ to `ui0.0.1`.
   `responsesFailed`: failed responses payload array (optional)  
   }
 
-###### Status Notification
+###### OCPP commands trigger
 
 - Request:  
-  `ProcedureName`: 'StatusNotification'  
+  `ProcedureName`: 'commandName' (the OCPP command name in camel case)  
   `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  `connectorId`: connector id integer,  
-  `errorCode`: connector error code,  
-  `status`: connector status  
-  }
+   `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+   ...`commandPayload`  
+   } (the OCPP command payload with some optional fields added to target the simulated charging stations)
 
 - Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
+   `PDU`: {  
+   `status`: 'success' | 'failure',  
+   `hashIdsSucceeded`: charging station unique identifier strings array,  
+   `hashIdsFailed`: charging station unique identifier strings array (optional),  
+   `responsesFailed`: failed responses payload array (optional)  
+   }
+
+Examples:
+
+- **Start Transaction**
+
+  - Request:  
+    `ProcedureName`: 'startTransaction'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    `connectorId`: connector id integer,  
+    `idTag`: RFID tag string  
+    }
 
-###### Heartbeat
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
 
-- Request:  
-  `ProcedureName`: 'Heartbeat'  
-  `PDU`: {  
-  `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
-  }
+- **Stop Transaction**
 
-- Response:  
-  `PDU`: {  
-  `status`: 'success' | 'failure',  
-  `hashIdsSucceeded`: charging station unique identifier strings array,  
-  `hashIdsFailed`: charging station unique identifier strings array (optional),  
-  `responsesFailed`: failed responses payload array (optional)  
-  }
+  - Request:  
+    `ProcedureName`: 'stopTransaction'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    `transactionId`: transaction id integer  
+    }
+
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
+
+- **Status Notification**
+
+  - Request:  
+    `ProcedureName`: 'statusNotification'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    `connectorId`: connector id integer,  
+    `errorCode`: connector error code,  
+    `status`: connector status  
+    }
+
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
+
+- **Heartbeat**
+
+  - Request:  
+    `ProcedureName`: 'heartbeat'  
+    `PDU`: {  
+    `hashIds`: charging station unique identifier strings array (optional, default: all charging stations),  
+    }
+
+  - Response:  
+    `PDU`: {  
+    `status`: 'success' | 'failure',  
+    `hashIdsSucceeded`: charging station unique identifier strings array,  
+    `hashIdsFailed`: charging station unique identifier strings array (optional),  
+    `responsesFailed`: failed responses payload array (optional)  
+    }
 
 ## Support, Feedback, Contributing