Hi,
I planing to built an smart Load Manager for charging stations, whitch can handle grid load limitation (german §14a EnWG), PV optimized and can use dynamic grid pricing.
The Load Manager should use a OCPP integration to set the load profiles in the EVCS.
The use case is a charging station that can provide a charging point for guest with ad-hoc payment (over QR-code no APP) and provide me a uncharged port for private charging, by app or NFC autorization.
Used setup:
-
EV-ChargingStation: ABL eMH3(3W2263C)
-
EMS: CerboGX with NodeRED activated
-
OCPP-Integration: node-red-contrib-ocpp by argonne-vci
-
OCPP-Backend: bill.bo LITE (no fix costs)
Hint:
In ABL Web Configuration you have to add your URL with the specific Port and if you use standart port 80 for ws:// innode-red-contrib-ocpp the NodeRED crashes
Below you can find the sceme of my intention:
flowchart LR
subgraph LPM[LoadProfilManager]
direction TB
LPN{{LoadProfil 0 A if GridPrice >= 35ct}}
LPP{{if PV-Power > 5kW}}
EU{{adapt LoadProfile if SurplusPower && isActiv LoadProfile}}
LL([maxChargPower])
M1{is lower}
M2{is greater}
M3{is greater}
M4{is lower}
LL --> M1
M1 --> M2
M2 --> M3
M3 --> M4
end
subgraph DESS
direction LR
DAP[Day-Ahead-Grid-Price]
PVP[PV-Forcast]
P14[§14a EnWG LoadLimitation EEBUS]
NM[GridMeasurement]
NV[SteValue<br>GridPoint]
end
CSMS[ChargeStationManager]
CS[ChargeStation]
DAP --> LPN
PVP --> LPP
P14 -->|ChargePowerLimit| M4
EU --> |5min PV-optimization|M3
NM --> |PV-Surplus >=5kW|EU
LPP -->|LoadProfile: PV-Surplus|M2
LPN -->|Loadprofile: PauseCharghing | M1
M4 --> CSMS <==> |OCPP| CS
Backend <=======> CSMS
CSMS --> NV
My OCPP-Proxy looks like this now and is prepared for interaction with EMS. But still with some uncached ecceptions:
Edit 16.06.2026: By working withn implementing Tags for identifying the source of the request, themassage routing is done nicely. By sending the responce only to the source of the request.
Edit 18.06.2026: Resolve the different massage input of the OCPP-Nodes, thad caused untransvered responses.
[
{
"id": "17b017b2265d4eef",
"type": "tab",
"label": "CSMS",
"disabled": false,
"info": "",
"env": [
{
"name": "HeartbeatInterval",
"value": "10",
"type": "num"
}
]
},
{
"id": "b352eadf12178be2",
"type": "switch",
"z": "17b017b2265d4eef",
"d": true,
"name": "OCPP CS Command Switch",
"property": "payload.command",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "BootNotification",
"vt": "str"
},
{
"t": "eq",
"v": "Authorize",
"vt": "str"
},
{
"t": "eq",
"v": "Heartbeat",
"vt": "str"
},
{
"t": "eq",
"v": "StatusNotification",
"vt": "str"
},
{
"t": "eq",
"v": "MeterValues",
"vt": "str"
},
{
"t": "eq",
"v": "StartTransaction",
"vt": "str"
},
{
"t": "eq",
"v": "StopTransaction",
"vt": "str"
},
{
"t": "else"
}
],
"checkall": "true",
"repair": false,
"outputs": 8,
"x": 820,
"y": 540,
"wires": [
[
"ac9cb8a8468ddc1a"
],
[
"b4194f31fe89a932"
],
[
"f3500ade9ca34666"
],
[
"82e4927dbcad7eb4"
],
[
"82e4927dbcad7eb4",
"4c7791b26456419c"
],
[
"74dc3d5bb9fdb379"
],
[
"b4194f31fe89a932",
"e7a35d84afd408e3"
],
[]
]
},
{
"id": "ac9cb8a8468ddc1a",
"type": "function",
"z": "17b017b2265d4eef",
"d": true,
"name": "BootNotification",
"func": "msg.payload = {\n interval: 120,\n currentTime: new Date().toISOString(),\n status: \"Accepted\"\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1080,
"y": 421,
"wires": [
[
"19faa1904fd4d362",
"1002fb0a2ee1197f"
]
]
},
{
"id": "74dc3d5bb9fdb379",
"type": "function",
"z": "17b017b2265d4eef",
"d": true,
"name": "Start Transaction",
"func": "msg.payload = {\n idTagInfo: {\n status: \"Accepted\",\n },\n transactionId: getRndInteger(0,100000)\n}\nreturn msg;\n\nfunction getRndInteger(min, max) {\n return Math.floor(Math.random() * (max - min + 1) ) + min;\n}\n",
"outputs": 1,
"noerr": 0,
"x": 1090,
"y": 601,
"wires": [
[]
]
},
{
"id": "e7a35d84afd408e3",
"type": "function",
"z": "17b017b2265d4eef",
"d": true,
"name": "Stop Transaction",
"func": "msg.payload = { idTagInfo: { status: \"Accepted\"} };\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 1290,
"y": 621,
"wires": [
[]
]
},
{
"id": "f3500ade9ca34666",
"type": "change",
"z": "17b017b2265d4eef",
"d": true,
"name": "Heartbeat",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{}",
"tot": "json"
},
{
"t": "set",
"p": "payload.currentTime",
"pt": "msg",
"to": "$now()",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1060,
"y": 499,
"wires": [
[
"19faa1904fd4d362"
]
]
},
{
"id": "b4194f31fe89a932",
"type": "change",
"z": "17b017b2265d4eef",
"d": true,
"name": "Generic Status=Accepted",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{\"idTagInfo\":{\"status\":\"Accepted\"}}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1110,
"y": 461,
"wires": [
[
"d680f9d5fe35cdc5"
]
]
},
{
"id": "82e4927dbcad7eb4",
"type": "change",
"z": "17b017b2265d4eef",
"d": true,
"name": "Generic Return",
"rules": [
{
"t": "set",
"p": "ocpp.data",
"pt": "msg",
"to": "payload.data",
"tot": "msg"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "{}",
"tot": "json"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 1080,
"y": 541,
"wires": [
[]
]
},
{
"id": "d680f9d5fe35cdc5",
"type": "debug",
"z": "17b017b2265d4eef",
"d": true,
"name": "Accept",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1310,
"y": 441,
"wires": []
},
{
"id": "4c7791b26456419c",
"type": "debug",
"z": "17b017b2265d4eef",
"d": true,
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload.data.meterValue[0]",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1130,
"y": 660,
"wires": []
},
{
"id": "19faa1904fd4d362",
"type": "debug",
"z": "17b017b2265d4eef",
"d": true,
"name": "bootN",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1390,
"y": 480,
"wires": []
},
{
"id": "a80a4115ba81f248",
"type": "link in",
"z": "17b017b2265d4eef",
"d": true,
"name": "Command Switch in",
"links": [
"537fd9734c5e4e03",
"aff46675fec074f0"
],
"x": 635,
"y": 560,
"wires": [
[
"b352eadf12178be2"
]
]
},
{
"id": "832f5e0119acc621",
"type": "inject",
"z": "17b017b2265d4eef",
"d": true,
"name": "StopTransaction",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"ocpp\":{\"ocppVersion\":\"1.6j\",\"MessageId\":\"d7e4b786-5540-4588-b712-92b7fd9bb3fb\",\"msgType\":2,\"command\":\"RemoteStopTransaction\"},\"payload\":{\"command\":\"RemoteStopTransaction\",\"data\":{\"transactionId\":123456789}},\"msgId\":\"a6252592-0d99-49ff-987a-1dc86f1e610d\",\"_msgid\":\"db384751d7fc8d8b\"}",
"payloadType": "json",
"x": 460,
"y": 560,
"wires": [
[]
]
},
{
"id": "6136f6304fcaa278",
"type": "inject",
"z": "17b017b2265d4eef",
"name": "BootNotification",
"props": [
{
"p": "ocpp",
"v": "{\"msgType\":2,\"command\":\"BootNotification\",\"data\":{\"chargePointVendor\":\"ABL\",\"chargePointModel\":\"3W2263\",\"chargePointSerialNumber\":\"chargePointSerialNumber\",\"chargeBoxSerialNumber\":\"chargeBoxSerialNumber\",\"firmwareVersion\":\"1.8p4\"}}",
"vt": "json"
},
{
"p": "ocpp.MessageId",
"v": "$floor($random()*899999 + 1000000)",
"vt": "jsonata"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 140,
"y": 700,
"wires": [
[
"f03815ae9c3523ba"
]
]
},
{
"id": "5ccbda76a0f5c624",
"type": "inject",
"z": "17b017b2265d4eef",
"name": "Trigger MeterValues",
"props": [
{
"p": "payload"
},
{
"p": "payload.MessageId",
"v": "06bd3eff-6c0d-5424-8214-b96ecc2ccf74",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"msgType\":2,\"command\":\"TriggerMessage\",\"data\":{\"requestedMessage\":\"MeterValues\",\"connectorId\":1}}",
"payloadType": "json",
"x": 150,
"y": 540,
"wires": [
[
"cde258b40613cc08"
]
]
},
{
"id": "370f02afbe26096a",
"type": "inject",
"z": "17b017b2265d4eef",
"name": "SendLocalList",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"msgType\":2,\"command\":\"SendLocalList\",\"data\":{\"localAuthorizationList\":[{\"idTag\":\"Tag_Identifier_01\",\"idTagInfo\":{\"status\":\"Accepted\"}},{\"idTag\":\"Tag_Identifier_02\",\"idTagInfo\":{\"status\":\"Accepted\"}}],\"updateType\":\"Full\"}}",
"payloadType": "json",
"x": 130,
"y": 660,
"wires": [
[
"2a43e0e79e62b90f"
]
]
},
{
"id": "2a43e0e79e62b90f",
"type": "function",
"z": "17b017b2265d4eef",
"name": "parse LocalList",
"func": "context.data = context.data || {};\n\nif ((msg.ocpp?.msgType == 2 || msg.payload?.msgType == 2) &&\n msg.payload?.command == \"SendLocalList\" ) {\n context.data = msg.payload.data;\n msg.payload = {\"msgType\": 2,\"command\":\"GetLocalListVersion\",\"data\":{}};\n return msg;\n} else if((msg.ocpp?.msgType == 3 || msg.payload?.msgType == 3) &&\n (msg.ocpp?.command == \"GetLocalListVersion\" || msg.payload?.command == \"GetLocalListVersion\")){\n var listVersion = msg.payload.data.listVersion +1;\n msg = {};\n msg.payload = {\"msgType\": 2,\"command\":\"SendLocalList\"};\n msg.payload.data = context.data;\n msg.payload.data.listVersion = listVersion;\n\n // msg.payload.msgType = 3;\n // msg.payload.command = context.msg.ocpp.command;\n //msg.payload = context.msg.payload.data;\n return msg;\n }\n \nreturn null;\n\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 180,
"y": 600,
"wires": [
[
"cde258b40613cc08"
]
]
},
{
"id": "47336589637de3ab",
"type": "link in",
"z": "17b017b2265d4eef",
"name": "CSMS feedback",
"links": [
"537fd9734c5e4e03"
],
"x": 55,
"y": 620,
"wires": [
[
"2a43e0e79e62b90f"
]
]
},
{
"id": "537fd9734c5e4e03",
"type": "link out",
"z": "17b017b2265d4eef",
"name": "CSMS out",
"mode": "link",
"links": [
"47336589637de3ab",
"a80a4115ba81f248"
],
"x": 925,
"y": 260,
"wires": []
},
{
"id": "1002fb0a2ee1197f",
"type": "debug",
"z": "17b017b2265d4eef",
"d": true,
"name": "BootNotification",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1320,
"y": 400,
"wires": []
},
{
"id": "5f62be1caad50bf3",
"type": "debug",
"z": "17b017b2265d4eef",
"name": "request EVSE",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1100,
"y": 220,
"wires": []
},
{
"id": "a42b1bdbb37a9685",
"type": "CP client JSON",
"z": "17b017b2265d4eef",
"name": "Backend",
"cbId": "CP_Identifier",
"remotecs": "92124697.6658f",
"ocppver": "1.6j",
"command": "",
"cmddata": "",
"log": false,
"pathlog": "/data/home/nodered/logs/OCPP.log",
"wsdelayconnect": false,
"wstomin": 5,
"wstomax": 360,
"wstoinc": 5,
"x": 160,
"y": 200,
"wires": [
[
"f03815ae9c3523ba"
]
]
},
{
"id": "531856ac3c6f1dd0",
"type": "CS server",
"z": "17b017b2265d4eef",
"name": "OCPP listener",
"port": "8020",
"portType": "num",
"enabled15": false,
"path15": "",
"enabled16": false,
"path16": "",
"enabled16j": true,
"path16j": "/ocpp",
"log": false,
"pathlog": "/data/home/nodered/logs/OCPP.log",
"x": 130,
"y": 80,
"wires": [
[
"520557f93aeb084c"
],
[]
]
},
{
"id": "65bda55ae3be526a",
"type": "server response",
"z": "17b017b2265d4eef",
"name": "CP response",
"x": 990,
"y": 100,
"wires": []
},
{
"id": "54ddaee06b0f6efb",
"type": "debug",
"z": "17b017b2265d4eef",
"name": "incommimg",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 750,
"y": 320,
"wires": []
},
{
"id": "8c192aa61e841a7f",
"type": "comment",
"z": "17b017b2265d4eef",
"name": "In-Out for EVSE requests",
"info": "",
"x": 150,
"y": 280,
"wires": []
},
{
"id": "f116c88dcc1f08fa",
"type": "CS request JSON",
"z": "17b017b2265d4eef",
"name": "request EVSE",
"remotecb": "2b6ab4fbb3f5ac80",
"command": "",
"cmddata": "",
"log": true,
"pathlog": "",
"x": 180,
"y": 320,
"wires": [
[
"aba7ba9e6ee29983"
]
]
},
{
"id": "a9cbb64e364ff830",
"type": "link in",
"z": "17b017b2265d4eef",
"name": "request EVSE in",
"links": [
"aff46675fec074f0"
],
"x": 55,
"y": 320,
"wires": [
[
"f116c88dcc1f08fa"
]
]
},
{
"id": "e19d2a2910aeba60",
"type": "link in",
"z": "17b017b2265d4eef",
"name": "Backend in",
"links": [
"f77e3549f2df1b32"
],
"x": 55,
"y": 200,
"wires": [
[
"a42b1bdbb37a9685"
]
]
},
{
"id": "f77e3549f2df1b32",
"type": "link out",
"z": "17b017b2265d4eef",
"name": "Backend out",
"mode": "link",
"links": [
"e19d2a2910aeba60"
],
"x": 925,
"y": 180,
"wires": []
},
{
"id": "96b24119440bc0c5",
"type": "debug",
"z": "17b017b2265d4eef",
"name": "EVSE",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1070,
"y": 140,
"wires": []
},
{
"id": "885699d55bd9c62d",
"type": "debug",
"z": "17b017b2265d4eef",
"name": "Backend",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1080,
"y": 180,
"wires": []
},
{
"id": "aff46675fec074f0",
"type": "link out",
"z": "17b017b2265d4eef",
"name": "request EVSE out",
"mode": "link",
"links": [
"a9cbb64e364ff830",
"a80a4115ba81f248"
],
"x": 925,
"y": 220,
"wires": []
},
{
"id": "97e14c469f86df22",
"type": "comment",
"z": "17b017b2265d4eef",
"name": "Catches EVSE Massages",
"info": "",
"x": 150,
"y": 40,
"wires": []
},
{
"id": "b6e5d3102f24c1c5",
"type": "comment",
"z": "17b017b2265d4eef",
"name": "In-Out for Backend requests",
"info": "",
"x": 160,
"y": 160,
"wires": []
},
{
"id": "b734d6abbc29f736",
"type": "debug",
"z": "17b017b2265d4eef",
"name": "responce to CSMS",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"targetType": "full",
"statusVal": "",
"statusType": "auto",
"x": 1110,
"y": 260,
"wires": []
},
{
"id": "21eb298303e5d3dc",
"type": "function",
"z": "17b017b2265d4eef",
"name": "massage routing",
"func": "// Source - https://stackoverflow.com/a/30031152\n// Posted by user2314737\n// Retrieved 2026-06-17, License - CC BY-SA 3.0\n//fruits.filter(function(x){return x !== 'undefined'}).length\n\nif (msg.ocpp?.websocket != undefined && msg.ocpp?.command === undefined){\n // msg.payload = msg.ocpp;\n //delete(msg.ocpp);\n return [null, null, null, msg]};\nif (msg.ocpp?.msgType == undefined || msg.ocpp?.command == undefined){node.warn('Inpropper OCPP-Massage!'); return null;}\n\n\n// msg.payload = { ...msg?.ocpp , ... msg.payload};\n//delete(msg.ocpp);\n\nif (msg.ocpp?.msgType == 2) {\n if(msg.msgTag?.origin === undefined){\n node.warn('No MassageTag is set! Define a Massage Tag like: msg.msgTag = {\"origin\":\"source\",\"uTimestamp\":Date.now(),\"MessageId\":\"ocpp_ID\",\"msgId\":\"msgID\"}');\n } else {\n let msgTag = [];\n msgTag = flow.get(\"msgTag\");\n//add Tag element to storage\n msgTag.push(msg.msgTag);\n//remove obsolete elements >min\n while (msgTag[0].uTimestamp <= (Date.now() - (2*60*1000)) ){ \n msgTag.splice(0,1); \n }\n for (const item of msgTag){\n//find matching source\n if (item.MessageId == (msg.ocpp?.MessageId)){ \n \n\n flow.set(\"msgTag\",msgTag);\n // node.warn(flow.get(\"msgTag\"));\n msg.payload.MessageId = msg.ocpp.MessageId;\n msg.payload.msgType = msg.ocpp.msgType ;\n msg.payload.command = msg.ocpp.command;\n\n switch (item.origin) {\n case \"EVSE\":\n return [null, msg, null, null];\n case \"Backend\":\n if (msg.ocpp.msgId){msg.payload.msgId = msg.ocpp.msgId;}\n if (msg.ocpp.chargeBoxIdentity){msg.payload.cbId = msg.ocpp.chargeBoxIdentity;}\n return [null, null, msg, null];\n case \"reqEVSE\":\n return [null, msg, null, null];\n case \"CSMS\":\n if (msg.ocpp.msgId){msg.payload.msgId = msg.ocpp.msgId;}\n if (msg.ocpp.chargeBoxIdentity){msg.payload.cbId = msg.ocpp.chargeBoxIdentity;}\n return [null, null, msg, null];\n default:\n return [null, null, null, msg];\n \n }\n }\n }\n }\n\n} else if(msg.ocpp?.msgType == 3) {\n // msg.payload = msg.payload.data;\n let msgTag = flow.get(\"msgTag\");\n \n for (let item = msgTag.length -1; item >=0; item-- ){\n//find matching source\n if (msgTag[item].MessageId == (msg.ocpp?.MessageId)){ \n msg.msgId = msgTag[item].msgId;\n const origin = msgTag[item].origin;\n msgTag.splice(item,1);\n flow.set(\"msgTag\",msgTag);\n // node.warn(msgTag.length);\n msg.payload.MessageId = msg.ocpp.MessageId;\n msg.payload.msgType = msg.ocpp.msgType ;\n msg.payload.command = msg.ocpp.command;\n \n switch (origin) {\n case \"EVSE\":\n msg.payload = msg.payload.data;\n return [msg, null, null, null];\n case \"Backend\":\n return [null, msg, null, null];\n case \"reqEVSE\":\n if (msg.ocpp.msgId){msg.payload.msgId = msg.ocpp.msgId;}\n if (msg.ocpp.chargeBoxIdentity){msg.payload.cbId = msg.ocpp.chargeBoxIdentity;}\n return [null, null, msg, null];\n default:\n return [null, null, null, msg];\n }\n }\n }\n}\n\nreturn [null, null, null, msg];\n\n",
"outputs": 4,
"timeout": "",
"noerr": 0,
"initialize": "// Der Code hier wird ausgeführt,\n// wenn der Node gestartet wird\n\n//initiallize msgMarker\nlet newArray = [];\nflow.set(\"msgTag\",newArray);",
"finalize": "",
"libs": [],
"x": 740,
"y": 200,
"wires": [
[
"65bda55ae3be526a",
"96b24119440bc0c5"
],
[
"885699d55bd9c62d",
"f77e3549f2df1b32"
],
[
"5f62be1caad50bf3",
"aff46675fec074f0"
],
[
"b734d6abbc29f736",
"537fd9734c5e4e03"
]
]
},
{
"id": "520557f93aeb084c",
"type": "function",
"z": "17b017b2265d4eef",
"name": "Tag EVSE",
"func": "if(msg.ocpp?.msgType == 2 &&\n msg.ocpp?.command != undefined ) {\n msg.msgTag = {\"origin\" : \"EVSE\"};\n msg.msgTag.msgId = msg.msgId || msg.ocpp.MessageId;\n msg.msgTag.MessageId = msg.ocpp.MessageId;\n msg.msgTag.uTimestamp = Date.now();\n }\nreturn msg;\n\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 370,
"y": 80,
"wires": [
[
"21eb298303e5d3dc",
"54ddaee06b0f6efb"
]
]
},
{
"id": "f03815ae9c3523ba",
"type": "function",
"z": "17b017b2265d4eef",
"name": "Tag Backend",
"func": "if(msg.ocpp?.msgType == 2 &&\n msg.ocpp?.command != undefined ) {\n msg.msgTag = {\"origin\" : \"Backend\"};\n msg.msgTag.msgId = msg.msgId || msg.ocpp.MessageId;\n msg.msgTag.MessageId = msg.ocpp.MessageId;\n msg.msgTag.uTimestamp = Date.now();\n }\nreturn msg;\n\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 370,
"y": 200,
"wires": [
[
"21eb298303e5d3dc",
"54ddaee06b0f6efb"
]
]
},
{
"id": "aba7ba9e6ee29983",
"type": "function",
"z": "17b017b2265d4eef",
"name": "Tag reqEVSE",
"func": "if(msg.ocpp?.msgType == 2 &&\n msg.ocpp?.command != undefined ) {\n msg.msgTag = {\"origin\" : \"reqEVSE\"};\n msg.msgTag.msgId = msg.msgId || msg.ocpp.MessageId;\n msg.msgTag.MessageId = msg.ocpp.MessageId;\n msg.msgTag.uTimestamp = Date.now();\n \n }\nreturn msg;\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 320,
"wires": [
[
"21eb298303e5d3dc",
"54ddaee06b0f6efb"
]
]
},
{
"id": "cde258b40613cc08",
"type": "function",
"z": "17b017b2265d4eef",
"name": "Tag CSMS",
"func": "\nif (msg?.ocpp == undefined){msg.ocpp ={};}\nmsg.ocpp.msgType = msg.ocpp.msgType || msg.payload.msgType;\nmsg.ocpp.command = msg.ocpp.command || msg.payload.command;\n\nmsg.ocpp.MessageId = msg.ocpp.MessageId ||msg.payload?.MessageId|| crypto.randomUUID();\n\nif(msg.payload?.msgType == 2 || msg.ocpp?.msgType == 2) {\n msg.msgTag = msg.msgTag || {\"origin\" : \"CSMS\"};\n msg.msgTag.msgId = msg.msgId || msg.payload.MessageId;\n msg.msgTag.MessageId = msg.payload.MessageId;\n msg.msgTag.uTimestamp = Date.now();\n }\nreturn msg;\n\n",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [
{
"var": "crypto",
"module": "crypto"
}
],
"x": 370,
"y": 440,
"wires": [
[
"21eb298303e5d3dc",
"54ddaee06b0f6efb"
]
]
},
{
"id": "1657738134829b0a",
"type": "comment",
"z": "17b017b2265d4eef",
"name": "Input CSMS interface ",
"info": "",
"x": 240,
"y": 400,
"wires": []
},
{
"id": "7522209452c9493c",
"type": "comment",
"z": "17b017b2265d4eef",
"name": "Output sortet by Device",
"info": "",
"x": 1020,
"y": 40,
"wires": []
},
{
"id": "6b6e272bc4b18cbe",
"type": "comment",
"z": "17b017b2265d4eef",
"name": "some example Massages",
"info": "",
"x": 150,
"y": 500,
"wires": []
},
{
"id": "236903c37579d28b",
"type": "inject",
"z": "17b017b2265d4eef",
"d": true,
"name": "GetCompositeSchedule",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"ocpp\":{\"ocppVersion\":\"1.6j\",\"MessageId\":\"417b0428-d8a3-46cb-809d-831075c100aa\",\"msgType\":2,\"command\":\"GetCompositeSchedule\"},\"payload\":{\"command\":\"GetCompositeSchedule\",\"data\":{\"connectorId\":1,\"duration\":15,\"chargingRateUnit\":\"W\"},\"MessageId\":\"417b0428-d8a3-46cb-809d-831075c100aa\",\"msgType\":2},\"msgId\":\"5e4b3036-6086-4450-ace0-0431e60a460d\",\"_msgid\":\"6b965bb876743508\"}",
"payloadType": "json",
"x": 480,
"y": 600,
"wires": [
[]
]
},
{
"id": "c1db1eb9d8259bde",
"type": "inject",
"z": "17b017b2265d4eef",
"d": true,
"name": "responce GetCompositeSchedule",
"props": [
{
"p": "payload"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "{\"ocpp\":{\"ocppVersion\":\"1.6j\",\"MessageId\":\"417b0428-d8a3-46cb-809d-831075c100aa\",\"msgType\":2,\"command\":\"GetCompositeSchedule\"},\"payload\":{\"command\":\"GetCompositeSchedule\",\"data\":{\"connectorId\":1,\"duration\":15,\"chargingRateUnit\":\"W\"},\"MessageId\":\"417b0428-d8a3-46cb-809d-831075c100aa\",\"msgType\":2},\"msgId\":\"5e4b3036-6086-4450-ace0-0431e60a460d\",\"_msgid\":\"6b965bb876743508\"}",
"payloadType": "json",
"x": 510,
"y": 640,
"wires": [
[]
]
},
{
"id": "92124697.6658f",
"type": "ocpp-remote-cs",
"name": "bill.bo",
"url": "wss://CP_Identifier:Backend_PW@ocpp.chargeiq.de"
},
{
"id": "2b6ab4fbb3f5ac80",
"type": "ocpp-remotej-cp",
"name": "",
"cbId": "CP_Identifier",
"ocppver": "1.6j"
},
{
"id": "4612095b16107d53",
"type": "global-config",
"env": [],
"modules": {
"node-red-contrib-ocpp": "1.3.10"
}
}
]
With this Thread I just whant to share my work and open a platform to discous thoughts, solutions and other related stuff.