[ { "id": "a28b6b5a3ca6e46a", "type": "tab", "label": "Sommer Modus", "disabled": false, "info": "", "env": [] }, { "id": "cfgfn", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Parameter", "func": "// ===== Benutzerparameter für 18s LFP =====\n\n// 0 = Auto\n// 1 = Immer Sommer\n// 2 = Immer Vollladung\nconst MODE_AUTO = 0;\nconst MODE_SUMMER = 1;\nconst MODE_FULL = 2;\n\n// Spannungen\nconst SUMMER_VOLTAGE = 60.0; // 3,33V pro Zelle\nconst FULL_VOLTAGE = 62.1; // 3,45V pro Zelle\n\n// Ströme \nconst SUMMER_CURRENT = 25; // Ladestrom im Sommer\nconst FULL_CURRENT = 70; // Ladestrom im Winter und an Balancing Tagen\n\n// Sommermonate\nconst SUMMER_START = 4; // April\nconst SUMMER_END = 9; // September\n\n// automatische Vollladung\nconst FULL_DAYS = [1,16];\n\n// min. Zellenspannung, bei der Balancing fertig ist\nconst FULL_CELL_VOLTAGE = 3.43;\n\n\n\n// ===== in den Flow schreiben =====\nif (flow.get(\"SUMMER_VOLTAGE\") === undefined)\n flow.set(\"SUMMER_VOLTAGE\", SUMMER_VOLTAGE);\n \nflow.set(\"FULL_VOLTAGE\",FULL_VOLTAGE);\n\nif (flow.get(\"SUMMER_CURRENT\") === undefined)\n flow.set(\"SUMMER_CURRENT\", SUMMER_CURRENT);\n \nif (flow.get(\"FULL_CURRENT\") === undefined)\n flow.set(\"FULL_CURRENT\", FULL_CURRENT);\n\nflow.set(\"SUMMER_START\",SUMMER_START);\n\nflow.set(\"SUMMER_END\",SUMMER_END);\n\nflow.set(\"FULL_DAYS\",FULL_DAYS);\n\nif (flow.get(\"ForceFullCharge\") === undefined)\n flow.set(\"ForceFullCharge\", false);\n\nif (flow.get(\"FullChargeReached\") === undefined)\n flow.set(\"FullChargeReached\", false);\n\nif (flow.get(\"FULL_CELL_VOLTAGE\") === undefined)\n flow.set(\"FULL_CELL_VOLTAGE\", FULL_CELL_VOLTAGE);\n \nreturn msg;", "outputs": 0, "timeout": "", "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 290, "y": 60, "wires": [] }, { "id": "b6230b7a9ed5226e", "type": "victron-virtual-switch", "z": "a28b6b5a3ca6e46a", "name": "Sommer-Zielspannung", "outputs": 2, "switch_1_type": 7, "switch_1_min": "59.4", "switch_1_max": "61.2", "switch_1_initial": 0, "switch_1_label": "", "switch_1_unit": "V", "switch_1_step": 0.1, "switch_1_customname": "Sommer-Zielspannung", "switch_1_group": "Sommer/Winter", "switch_1_include_measurement": false, "switch_1_rgb_color_wheel": false, "switch_1_cct_wheel": false, "switch_1_rgb_white_dimmer": false, "x": 160, "y": 480, "wires": [ [], [ "5c267e0186becd44" ] ] }, { "id": "ce7dbe7ba81011a4", "type": "inject", "z": "a28b6b5a3ca6e46a", "name": "10 Sekunden Timer", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "10", "crontab": "", "once": true, "onceDelay": "2", "topic": "", "payload": "", "payloadType": "date", "x": 160, "y": 120, "wires": [ [ "011550e02ac2070a" ] ] }, { "id": "011550e02ac2070a", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Sommer-/Wintermodus", "func": "// ----------------------------\n// Victron Sommer-/Wintermodus\n// ----------------------------\n\n// Einstellungen aus dem Flow\nconst SUMMER_VOLTAGE = flow.get(\"SUMMER_VOLTAGE\") || 60.0;\nconst FULL_VOLTAGE = flow.get(\"FULL_VOLTAGE\") || 62.1;\n\nconst SUMMER_CURRENT = flow.get(\"SUMMER_CURRENT\") || 25;\nconst FULL_CURRENT = flow.get(\"FULL_CURRENT\") || 70;\n\nconst SUMMER_START = flow.get(\"SUMMER_START\") || 4;\nconst SUMMER_END = flow.get(\"SUMMER_END\") || 9;\n\nconst FULL_DAYS = flow.get(\"FULL_DAYS\") || [1,15];\n\n// Datum bestimmen\nconst now = new Date();\n\nconst month = now.getMonth() + 1;\nconst day = now.getDate();\n\nconst isBalanceDay = FULL_DAYS.includes(day);\n\n// Betriebsmodus\n// 0 = Auto\n// 1 = Sommer\n// 2 = Vollladung\nlet mode = flow.get(\"ChargeMode\");\n\nif (mode === undefined)\n mode = 0;\n\n// ForceFullCharge lesen\nlet forceFullCharge = flow.get(\"ForceFullCharge\");\n\nif (forceFullCharge === undefined)\n forceFullCharge = false;\n\nlet targetVoltage;\nlet targetCurrent;\nlet status;\n\n\n// ------------------------\n// Manuelle Modi\n// ------------------------\n\nif (mode == 1)\n{\n targetVoltage = SUMMER_VOLTAGE;\n targetCurrent = SUMMER_CURRENT;\n status = \"Sommer\";\n}\nelse if (mode == 2)\n{\n targetVoltage = FULL_VOLTAGE;\n targetCurrent = FULL_CURRENT;\n status = \"Vollladung\";\n}\nelse\n{\n\n //----------------------\n // Automatik\n //----------------------\n\n const summer =\n month >= SUMMER_START &&\n month <= SUMMER_END;\n \n \n // Nur einmal am Balancingtag eine Vollladung anfordern\n const today = `${now.getFullYear()}-${month}-${day}`;\n let lastRequest = flow.get(\"LastFullChargeRequest\");\n\n if (FULL_DAYS.includes(day) && lastRequest !== today)\n {\n flow.set(\"ForceFullCharge\", true);\n flow.set(\"FullChargeReached\", false);\n flow.set(\"LastFullChargeRequest\", today);\n }\n\n if (!summer)\n {\n targetVoltage = FULL_VOLTAGE;\n targetCurrent = FULL_CURRENT;\n status = \"Winter\";\n }\n else\n {\n if (isBalanceDay || forceFullCharge)\n {\n targetVoltage = FULL_VOLTAGE;\n targetCurrent = FULL_CURRENT;\n status = \"Auto - Balancing\";\n }\n else\n {\n targetVoltage = SUMMER_VOLTAGE;\n targetCurrent = SUMMER_CURRENT;\n status = \"Auto - Sommer\";\n }\n }\n}\n\n\n// Ausgabe\nmsg.voltage = targetVoltage;\nmsg.current = targetCurrent;\nmsg.status = status;\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 410, "y": 120, "wires": [ [ "3454dc56e2bb08c5", "0fc4fd3640456de4", "5a6a936c0240b8d8" ] ] }, { "id": "8117c6d27122cb67", "type": "rbe", "z": "a28b6b5a3ca6e46a", "name": "Block if value unchanged", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 890, "y": 120, "wires": [ [ "852c57cc4365eead" ] ] }, { "id": "852c57cc4365eead", "type": "victron-output-ess", "z": "a28b6b5a3ca6e46a", "service": "com.victronenergy.settings", "path": "/Settings/SystemSetup/MaxChargeVoltage", "serviceObj": { "service": "com.victronenergy.settings", "name": "Venus settings", "communityTag": "ess" }, "pathObj": { "path": "/Settings/SystemSetup/MaxChargeVoltage", "type": "float", "name": "DVCC Maximum charge voltage (V)", "mode": "both" }, "name": "", "onlyChanges": false, "roundValues": "no", "rateLimit": 0, "outputs": 0, "conditionalMode": false, "condition1Operator": ">", "condition2Enabled": false, "condition2Service": "", "condition2Path": "", "condition2Operator": ">", "logicOperator": "AND", "outputTrue": "true", "outputFalse": "false", "outputOnChange": false, "debounce": 2000, "x": 1240, "y": 120, "wires": [] }, { "id": "2f349c0505428e02", "type": "victron-virtual-switch", "z": "a28b6b5a3ca6e46a", "name": "Betriebsmodus Schalter", "outputs": 2, "switch_1_type": 6, "switch_1_initial": 0, "switch_1_label": "[\"Automatik\",\"Sommer\",\"Winter\"]", "switch_1_customname": "Betriebsmodus", "switch_1_group": "Sommer/Winter", "switch_1_include_measurement": false, "switch_1_rgb_color_wheel": false, "switch_1_cct_wheel": false, "switch_1_rgb_white_dimmer": false, "x": 170, "y": 420, "wires": [ [], [ "5a223496addd09af" ] ] }, { "id": "cfg", "type": "inject", "z": "a28b6b5a3ca6e46a", "name": "Start", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": "1", "topic": "", "payload": "", "payloadType": "str", "x": 110, "y": 60, "wires": [ [ "cfgfn" ] ] }, { "id": "5a223496addd09af", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "ChargeMode umschalten", "func": "flow.set(\"ChargeMode\", Number(msg.payload));\nreturn null;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 450, "y": 420, "wires": [ [] ] }, { "id": "58c486d0b6834da0", "type": "rbe", "z": "a28b6b5a3ca6e46a", "name": "Block if value unchanged", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 890, "y": 240, "wires": [ [ "2a9582b8380371aa" ] ] }, { "id": "5c267e0186becd44", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Sommer-Zielspannung schreiben", "func": "flow.set(\"SUMMER_VOLTAGE\", Number(msg.payload));\nreturn null;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 480, "y": 480, "wires": [ [] ] }, { "id": "3903c631f4d26685", "type": "victron-input-ess", "z": "a28b6b5a3ca6e46a", "service": "com.victronenergy.battery/99", "path": "/System/MinCellVoltage", "serviceObj": { "service": "com.victronenergy.battery/99", "name": "AggregateBatteries", "communityTag": "ess" }, "pathObj": { "path": "/System/MinCellVoltage", "type": "integer", "name": "Minimum battery cell voltage" }, "name": "", "onlyChanges": false, "roundValues": "no", "rateLimit": 0, "outputs": 1, "conditionalMode": false, "outputTrue": "true", "outputFalse": "false", "debounce": "2000", "x": 240, "y": 300, "wires": [ [ "0a1d2cac6a353818" ] ] }, { "id": "0a1d2cac6a353818", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Prüfen ob Balancing fertig", "func": "const LIMIT = Number(flow.get(\"FULL_CELL_VOLTAGE\")) || 3.43;\n\nif (msg.payload >= LIMIT)\n{\n flow.set(\"FullChargeReached\", true);\n}\n\nreturn null;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 570, "y": 300, "wires": [ [] ] }, { "id": "2a9582b8380371aa", "type": "victron-inject", "z": "a28b6b5a3ca6e46a", "name": "Status", "notificationType": 2, "notificationTitle": "Status", "x": 1090, "y": 240, "wires": [ [] ] }, { "id": "1ff2c19e609884ef", "type": "inject", "z": "a28b6b5a3ca6e46a", "name": "Täglich um 23:55", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "55 23 * * *", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 150, "y": 360, "wires": [ [ "c497c49d76207f71" ] ] }, { "id": "c497c49d76207f71", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Prüfe ob heute Balancing abgeschlossen wurde", "func": "let force = flow.get(\"ForceFullCharge\") || false;\nlet reached = flow.get(\"FullChargeReached\") || false;\n\nif (force)\n{\n if (reached)\n {\n flow.set(\"ForceFullCharge\", false);\n node.warn(\"Balancing erfolgreich abgeschlossen.\");\n }\n else\n {\n node.warn(\"Balancing noch nicht erreicht. Morgen erneut Vollladung.\");\n }\n}\n\nflow.set(\"FullChargeReached\", false);\n\nreturn null;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 480, "y": 360, "wires": [ [] ] }, { "id": "9a801830c8fe0a16", "type": "victron-virtual-switch", "z": "a28b6b5a3ca6e46a", "name": "Ladestrom Sommer", "outputs": 2, "switch_1_type": 7, "switch_1_min": "20", "switch_1_max": "70", "switch_1_initial": 0, "switch_1_label": "", "switch_1_unit": "A", "switch_1_step": 1, "switch_1_customname": "Ladestrom Sommer", "switch_1_group": "Sommer/Winter", "switch_1_include_measurement": false, "switch_1_rgb_color_wheel": false, "switch_1_cct_wheel": false, "switch_1_rgb_white_dimmer": false, "x": 150, "y": 540, "wires": [ [], [ "bfb7f6e5c1fe764c" ] ] }, { "id": "bfb7f6e5c1fe764c", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Sommer-Strom schreiben", "func": "flow.set(\"SUMMER_CURRENT\", Number(msg.payload));\nreturn null;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 450, "y": 540, "wires": [ [] ] }, { "id": "cd2f1c9477e09007", "type": "victron-virtual-switch", "z": "a28b6b5a3ca6e46a", "name": "Ladestrom Vollladung", "outputs": 2, "switch_1_type": 7, "switch_1_min": "20", "switch_1_max": "70", "switch_1_initial": 0, "switch_1_label": "", "switch_1_unit": "A", "switch_1_step": 1, "switch_1_customname": "Ladestrom Vollladung", "switch_1_group": "Sommer/Winter", "switch_1_include_measurement": false, "switch_1_rgb_color_wheel": false, "switch_1_cct_wheel": false, "switch_1_rgb_white_dimmer": false, "x": 160, "y": 600, "wires": [ [], [ "51ebda61698c4beb" ] ] }, { "id": "51ebda61698c4beb", "type": "function", "z": "a28b6b5a3ca6e46a", "name": "Volllade-Strom schreiben", "func": "flow.set(\"WINTER_CURRENT\", Number(msg.payload));\nreturn null;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 450, "y": 600, "wires": [ [] ] }, { "id": "180c1941b45d56e8", "type": "victron-output-ess", "z": "a28b6b5a3ca6e46a", "service": "com.victronenergy.settings", "path": "/Settings/SystemSetup/MaxChargeCurrent", "serviceObj": { "service": "com.victronenergy.settings", "name": "Venus settings", "communityTag": "ess" }, "pathObj": { "path": "/Settings/SystemSetup/MaxChargeCurrent", "type": "float", "name": "DVCC Charge current limit (A)", "mode": "both" }, "name": "", "onlyChanges": false, "roundValues": "no", "rateLimit": 0, "outputs": 0, "conditionalMode": false, "condition1Operator": ">", "condition2Enabled": false, "condition2Service": "", "condition2Path": "", "condition2Operator": ">", "logicOperator": "AND", "outputTrue": "true", "outputFalse": "false", "outputOnChange": false, "debounce": 2000, "x": 1220, "y": 180, "wires": [] }, { "id": "0fc4fd3640456de4", "type": "change", "z": "a28b6b5a3ca6e46a", "name": "Spannung filtern", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "voltage", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 660, "y": 120, "wires": [ [ "8117c6d27122cb67" ] ] }, { "id": "3454dc56e2bb08c5", "type": "change", "z": "a28b6b5a3ca6e46a", "name": "Strom filtern", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "current", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 670, "y": 180, "wires": [ [ "ae1ff26fa47097d9" ] ] }, { "id": "ae1ff26fa47097d9", "type": "rbe", "z": "a28b6b5a3ca6e46a", "name": "Block if value unchanged", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 890, "y": 180, "wires": [ [ "180c1941b45d56e8" ] ] }, { "id": "5a6a936c0240b8d8", "type": "change", "z": "a28b6b5a3ca6e46a", "name": "Status filtern", "rules": [ { "t": "set", "p": "payload", "pt": "msg", "to": "status", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 670, "y": 240, "wires": [ [ "58c486d0b6834da0" ] ] }, { "id": "63ad667ebaba7b80", "type": "global-config", "env": [], "modules": { "@victronenergy/node-red-contrib-victron": "1.6.64" } } ]