[
    {
        "id": "884ef8e9c6881551",
        "type": "tab",
        "label": "Wallbox",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "4dd3e89719ad7eab",
        "type": "mqtt in",
        "z": "884ef8e9c6881551",
        "name": "",
        "topic": "openWB/internal_chargepoint/0/get/charge_state",
        "qos": "2",
        "datatype": "auto",
        "broker": "48b173a9bfae974b",
        "nl": false,
        "rap": true,
        "rh": "2",
        "inputs": 0,
        "x": 220,
        "y": 420,
        "wires": [
            [
                "dafeef32c88a3556"
            ]
        ]
    },
    {
        "id": "4d24eee4bbca6c9c",
        "type": "mqtt in",
        "z": "884ef8e9c6881551",
        "name": "",
        "topic": "openWB/internal_chargepoint/0/get/plug_state",
        "qos": "2",
        "datatype": "auto",
        "broker": "48b173a9bfae974b",
        "nl": false,
        "rap": true,
        "rh": "2",
        "inputs": 0,
        "x": 210,
        "y": 470,
        "wires": [
            [
                "ccfcd642c059f538"
            ]
        ]
    },
    {
        "id": "44313f9ccc3abc7e",
        "type": "mqtt in",
        "z": "884ef8e9c6881551",
        "name": "",
        "topic": "openWB/vehicle/5/get/soc",
        "qos": "2",
        "datatype": "auto",
        "broker": "48b173a9bfae974b",
        "nl": false,
        "rap": true,
        "rh": "2",
        "inputs": 0,
        "x": 150,
        "y": 520,
        "wires": [
            [
                "269ddc80c4c84034"
            ]
        ]
    },
    {
        "id": "a8e0e980211f1905",
        "type": "change",
        "z": "884ef8e9c6881551",
        "name": "global.openWB_SOC",
        "rules": [
            {
                "t": "set",
                "p": "openWB_SOC",
                "pt": "global",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 750,
        "y": 520,
        "wires": [
            []
        ]
    },
    {
        "id": "269ddc80c4c84034",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "Change format",
        "func": "msg.payload = msg.payload * 1;\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 540,
        "y": 520,
        "wires": [
            [
                "a8e0e980211f1905"
            ]
        ]
    },
    {
        "id": "c062e2695d0673fb",
        "type": "inject",
        "z": "884ef8e9c6881551",
        "name": "Init boolean",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.25",
        "topic": "",
        "payload": "false",
        "payloadType": "bool",
        "x": 110,
        "y": 40,
        "wires": [
            [
                "6a6f3566c8722f60",
                "508f2e5fcd454e9f",
                "dafeef32c88a3556",
                "ccfcd642c059f538",
                "25a9179ddf554ee8"
            ]
        ]
    },
    {
        "id": "ec53783aef1f384e",
        "type": "inject",
        "z": "884ef8e9c6881551",
        "name": "Init SOC",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": "0.25",
        "topic": "",
        "payload": "-1",
        "payloadType": "num",
        "x": 100,
        "y": 80,
        "wires": [
            [
                "a8e0e980211f1905"
            ]
        ]
    },
    {
        "id": "6b67641734352826",
        "type": "mqtt in",
        "z": "884ef8e9c6881551",
        "name": "",
        "topic": "openWB/chargepoint/4/get/connected_vehicle/config",
        "qos": "2",
        "datatype": "auto",
        "broker": "48b173a9bfae974b",
        "nl": false,
        "rap": true,
        "rh": "2",
        "inputs": 0,
        "x": 230,
        "y": 570,
        "wires": [
            [
                "29cc7f11025c30c9"
            ]
        ]
    },
    {
        "id": "29cc7f11025c30c9",
        "type": "json",
        "z": "884ef8e9c6881551",
        "name": "",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 510,
        "y": 570,
        "wires": [
            [
                "f9e7b7ee7a5eb842"
            ]
        ]
    },
    {
        "id": "3a7ee4722d8100d8",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "60e107699f7d15de",
        "order": 6,
        "width": 3,
        "height": 1,
        "name": "Label Ladung",
        "label": "<font size =4><b>Ladung</b></font>",
        "format": "",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 1490,
        "y": 420,
        "wires": []
    },
    {
        "id": "b682d53a0410dacb",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "60e107699f7d15de",
        "order": 4,
        "width": 3,
        "height": 1,
        "name": "Label Ladekabel",
        "label": "<font size =4><b>Ladekabel</b></font>",
        "format": "",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 1490,
        "y": 470,
        "wires": []
    },
    {
        "id": "d041beefae98c1f1",
        "type": "ui_slider",
        "z": "884ef8e9c6881551",
        "name": "Limit Std",
        "label": "",
        "tooltip": "",
        "group": "a6eae8b0cd7f551b",
        "order": 6,
        "width": 5,
        "height": 1,
        "passthru": true,
        "outs": "end",
        "topic": "topic",
        "topicType": "msg",
        "min": "1000",
        "max": "13600",
        "step": "100",
        "className": "Thomas_Slider",
        "x": 1010,
        "y": 190,
        "wires": [
            [
                "fca64bf864d28d0c"
            ]
        ]
    },
    {
        "id": "a0db04f9321d55ab",
        "type": "ui_slider",
        "z": "884ef8e9c6881551",
        "name": "Limit Wallbox",
        "label": "",
        "tooltip": "",
        "group": "a6eae8b0cd7f551b",
        "order": 8,
        "width": 5,
        "height": 1,
        "passthru": true,
        "outs": "end",
        "topic": "topic",
        "topicType": "msg",
        "min": "500",
        "max": "1500",
        "step": "50",
        "className": "Thomas_Slider",
        "x": 1020,
        "y": 240,
        "wires": [
            [
                "98c2b281016f9a0f"
            ]
        ]
    },
    {
        "id": "ace0968ee5ae8c6c",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "60e107699f7d15de",
        "order": 1,
        "width": 3,
        "height": 1,
        "name": "Label Lademodus",
        "label": "<font size =4><b>Lademodus</b></font>",
        "format": "",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 1500,
        "y": 560,
        "wires": []
    },
    {
        "id": "fca64bf864d28d0c",
        "type": "change",
        "z": "884ef8e9c6881551",
        "name": "flow.Set_Limit_Std",
        "rules": [
            {
                "t": "set",
                "p": "#:(storeInFile)::Set_Limit_Std",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1220,
        "y": 190,
        "wires": [
            [
                "21f8214d28361636"
            ]
        ]
    },
    {
        "id": "98c2b281016f9a0f",
        "type": "change",
        "z": "884ef8e9c6881551",
        "name": "flow.Set_Limit_Wallbox",
        "rules": [
            {
                "t": "set",
                "p": "#:(storeInFile)::Set_Limit_Wallbox",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1230,
        "y": 240,
        "wires": [
            [
                "21f8214d28361636"
            ]
        ]
    },
    {
        "id": "6a6f3566c8722f60",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "Init Set_Limit_Std",
        "func": "// External Storage Init\nif (flow.get(\"Set_Limit_Std\", \"storeInFile\") === undefined) {\n    flow.set(\"Set_Limit_Std\", 13600, \"storeInFile\");\n}\n\nmsg.payload = flow.get(\"Set_Limit_Std\", \"storeInFile\");\nreturn msg",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 190,
        "wires": [
            [
                "d041beefae98c1f1"
            ]
        ]
    },
    {
        "id": "508f2e5fcd454e9f",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "Init Set_Limit_Wallbox",
        "func": "// External Storage Init\nif (flow.get(\"Set_Limit_Wallbox\", \"storeInFile\") === undefined) {\n    flow.set(\"Set_Limit_Wallbox\", 1000, \"storeInFile\");\n}\n\nmsg.payload = flow.get(\"Set_Limit_Wallbox\", \"storeInFile\");\nreturn msg",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 240,
        "wires": [
            [
                "a0db04f9321d55ab"
            ]
        ]
    },
    {
        "id": "8e509f0995a4fd05",
        "type": "comment",
        "z": "884ef8e9c6881551",
        "name": "Inverter Limit Definition",
        "info": "",
        "x": 110,
        "y": 150,
        "wires": []
    },
    {
        "id": "210c859d8e84b7ed",
        "type": "comment",
        "z": "884ef8e9c6881551",
        "name": "Wallbox Stati via MQTT",
        "info": "",
        "x": 110,
        "y": 370,
        "wires": []
    },
    {
        "id": "3a1e30bf96bdc605",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "a6eae8b0cd7f551b",
        "order": 2,
        "width": 3,
        "height": 1,
        "name": "Limit Active",
        "label": "<font size =4><b>Limit aktiv</b></font>",
        "format": "",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 1480,
        "y": 290,
        "wires": []
    },
    {
        "id": "031f77942e52ae8a",
        "type": "ui_switch",
        "z": "884ef8e9c6881551",
        "name": "Inverter_limit",
        "label": "",
        "tooltip": "",
        "group": "a6eae8b0cd7f551b",
        "order": 4,
        "width": 2,
        "height": 1,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "className": "",
        "x": 1020,
        "y": 290,
        "wires": [
            [
                "d66eae33c6858279"
            ]
        ]
    },
    {
        "id": "d66eae33c6858279",
        "type": "change",
        "z": "884ef8e9c6881551",
        "name": "flow.Adapt_Inverter_limit",
        "rules": [
            {
                "t": "set",
                "p": "#:(storeInFile)::Adapt_Inverter_limit",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1240,
        "y": 290,
        "wires": [
            [
                "6489de8c677f8c22"
            ]
        ]
    },
    {
        "id": "2da7652385d0a9a0",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "Initialize Adapt_Inverter_limit",
        "func": "// External Storage Init\nif (flow.get(\"Adapt_Inverter_limit\", \"storeInFile\") === undefined) {\n    flow.set(\"Adapt_Inverter_limit\", false, \"storeInFile\");\n}\n\nmsg.payload = flow.get(\"Adapt_Inverter_limit\", \"storeInFile\");\n\n// Previous setting\nflow.set(\"Adapt_Inverter_limit_previous\", flow.get(\"Adapt_Inverter_limit\", \"storeInFile\"));\n\nreturn msg",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 580,
        "y": 290,
        "wires": [
            [
                "031f77942e52ae8a"
            ]
        ]
    },
    {
        "id": "d0c3c9ce79a0cc7a",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "a6eae8b0cd7f551b",
        "order": 7,
        "width": 3,
        "height": 1,
        "name": "Limit_Grid Charging",
        "label": "Netzladen (W)",
        "format": "",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 1510,
        "y": 240,
        "wires": []
    },
    {
        "id": "1dce87302ab648ba",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "a6eae8b0cd7f551b",
        "order": 5,
        "width": 3,
        "height": 1,
        "name": "Limit_Std",
        "label": "Std. Limit (W)",
        "format": "",
        "layout": "row-spread",
        "className": "",
        "style": false,
        "font": "",
        "fontSize": "",
        "color": "#000000",
        "x": 1470,
        "y": 190,
        "wires": []
    },
    {
        "id": "e09826c8593b4d74",
        "type": "victron-output-ess",
        "z": "884ef8e9c6881551",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/MaxDischargePower",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/MaxDischargePower",
            "type": "integer",
            "name": "Max inverter power (W)",
            "writable": true
        },
        "name": "Venus settings / Max inverter power (W)",
        "onlyChanges": false,
        "x": 1100,
        "y": 760,
        "wires": []
    },
    {
        "id": "6489de8c677f8c22",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "Set Inverter Limit",
        "func": "// Adaptive Limit in activated mode\nif (flow.get(\"Adapt_Inverter_limit\", \"storeInFile\") == true) {\n    // If Wallbox in charging mode\n    if (((global.get(\"openWB_ChargeMode\") == \"Sofort\") || (global.get(\"openWB_ChargeMode\") == \"Zielladen\")) && (global.get(\"openWB_Charge\") == true)) {\n        msg.payload = Math.max( flow.get(\"Set_Limit_Wallbox\", \"storeInFile\"), flow.get(\"MPPT_current_power\") );\n    }\n    else {\n        msg.payload = flow.get(\"Set_Limit_Std\", \"storeInFile\");\n    }\n    \n    flow.set(\"Adapt_Inverter_limit_previous\", true);\n    if (flow.get(\"Previous_limit\") != msg.payload ) {\n//        flow.set(\"Previous_limit\", msg.payload);\n        return msg;\n    }\n}\nelse {\n    if ((flow.get(\"Adapt_Inverter_limit_previous\") == true) && (flow.get(\"Adapt_Inverter_limit\", \"storeInFile\") == false)) {\n        flow.set(\"Adapt_Inverter_limit_previous\", false);\n        msg.payload = -1;\n//        flow.set(\"Previous_limit\", msg.payload);\n        return msg;\n    }\n}",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 760,
        "wires": [
            [
                "e09826c8593b4d74"
            ]
        ]
    },
    {
        "id": "21f8214d28361636",
        "type": "delay",
        "z": "884ef8e9c6881551",
        "name": "delay 500ms",
        "pauseType": "delay",
        "timeout": "500",
        "timeoutUnits": "milliseconds",
        "rate": "1",
        "nbRateUnits": "1",
        "rateUnits": "second",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 1480,
        "y": 60,
        "wires": [
            [
                "2da7652385d0a9a0"
            ]
        ]
    },
    {
        "id": "c4e3b05abcc396d2",
        "type": "victron-input-ess",
        "z": "884ef8e9c6881551",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/MaxDischargePower",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/MaxDischargePower",
            "type": "integer",
            "name": "Max inverter power (W)"
        },
        "name": "Venus settings / Max inverter power (W)",
        "onlyChanges": false,
        "x": 190,
        "y": 930,
        "wires": [
            [
                "9237b641cb88c806"
            ]
        ]
    },
    {
        "id": "4c7a910b37f8ba1e",
        "type": "comment",
        "z": "884ef8e9c6881551",
        "name": "Define Limit",
        "info": "",
        "x": 80,
        "y": 710,
        "wires": []
    },
    {
        "id": "b4aad926085d83ab",
        "type": "comment",
        "z": "884ef8e9c6881551",
        "name": "Current Limit",
        "info": "",
        "x": 80,
        "y": 880,
        "wires": []
    },
    {
        "id": "f9232ff4fd62df32",
        "type": "ui_text",
        "z": "884ef8e9c6881551",
        "group": "a6eae8b0cd7f551b",
        "order": 1,
        "width": 8,
        "height": 1,
        "name": "Current Limit",
        "label": "<font size =4><b>Limit aktuell</b></font>",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "className": "Thomas_label",
        "style": false,
        "font": "",
        "fontSize": 16,
        "color": "#000000",
        "x": 1010,
        "y": 930,
        "wires": []
    },
    {
        "id": "8e08d290307494ad",
        "type": "inject",
        "z": "884ef8e9c6881551",
        "name": "timer 2s",
        "props": [
            {
                "p": "payload"
            }
        ],
        "repeat": "2",
        "crontab": "",
        "once": true,
        "onceDelay": "2",
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 100,
        "y": 760,
        "wires": [
            [
                "6489de8c677f8c22"
            ]
        ]
    },
    {
        "id": "9237b641cb88c806",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "Current Limit Eval",
        "func": "var temp_payload = msg.payload * 1;\n\nflow.set(\"Previous_limit\", msg.payload);\n\nif (msg.payload == -1) {\n    msg.payload = \"aus\";\n}\nelse {\n    msg.payload = temp_payload.toLocaleString(\"de-DE\") + \" W\";\n}\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 930,
        "wires": [
            [
                "f9232ff4fd62df32"
            ]
        ]
    },
    {
        "id": "0f62354cb5dbe5af",
        "type": "ui_multistate_switch",
        "z": "884ef8e9c6881551",
        "name": "Ladekabel",
        "group": "60e107699f7d15de",
        "order": 5,
        "width": 5,
        "height": 1,
        "label": "",
        "stateField": "payload",
        "enableField": "enable",
        "passthroughField": "passthrough",
        "inputMsgField": "inputmsg",
        "rounded": false,
        "useThemeColors": false,
        "hideSelectedLabel": false,
        "multilineLabel": false,
        "passThrough": "never",
        "inputMsg": "all",
        "userInput": "disabled",
        "options": [
            {
                "label": "abgesteckt",
                "value": "false",
                "valueType": "bool",
                "color": "#999999"
            },
            {
                "label": "eingesteckt",
                "value": "true",
                "valueType": "bool",
                "color": "#009933"
            }
        ],
        "topic": "",
        "x": 1020,
        "y": 470,
        "wires": [
            []
        ]
    },
    {
        "id": "fc0acec6dcaf56d3",
        "type": "ui_multistate_switch",
        "z": "884ef8e9c6881551",
        "name": "Ladung",
        "group": "60e107699f7d15de",
        "order": 7,
        "width": 5,
        "height": 1,
        "label": "",
        "stateField": "payload",
        "enableField": "enable",
        "passthroughField": "passthrough",
        "inputMsgField": "inputmsg",
        "rounded": false,
        "useThemeColors": false,
        "hideSelectedLabel": false,
        "multilineLabel": false,
        "passThrough": "never",
        "inputMsg": "all",
        "userInput": "disabled",
        "options": [
            {
                "label": "inaktiv",
                "value": "false",
                "valueType": "bool",
                "color": "#999999"
            },
            {
                "label": "aktiv",
                "value": "true",
                "valueType": "bool",
                "color": "#009933"
            }
        ],
        "topic": "",
        "x": 1010,
        "y": 420,
        "wires": [
            []
        ]
    },
    {
        "id": "dafeef32c88a3556",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "check openWB_Charge",
        "func": "if (msg.payload == \"true\") {\n    msg.payload = true;\n}\nelse {\n    msg.payload = false;\n}\n\nglobal.set(\"openWB_Charge\", msg.payload);\n\n// config status UI\nmsg.enable =\"enabled_not_show\";\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 570,
        "y": 420,
        "wires": [
            [
                "fc0acec6dcaf56d3"
            ]
        ]
    },
    {
        "id": "ccfcd642c059f538",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "check openWB_Plug",
        "func": "if (msg.payload == \"true\") {\n    msg.payload = true;\n}\nelse {\n    msg.payload = false;\n}\n\nglobal.set(\"openWB_Plug\", msg.payload);\n\n// config status UI\nmsg.enable =\"enabled_not_show\";\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 470,
        "wires": [
            [
                "0f62354cb5dbe5af"
            ]
        ]
    },
    {
        "id": "f1bd494a2d7ff673",
        "type": "ui_multistate_switch",
        "z": "884ef8e9c6881551",
        "name": "Lademodus",
        "group": "60e107699f7d15de",
        "order": 3,
        "width": 8,
        "height": 1,
        "label": "",
        "stateField": "payload.chargemode",
        "enableField": "enable",
        "passthroughField": "passthrough",
        "inputMsgField": "inputmsg",
        "rounded": false,
        "useThemeColors": false,
        "hideSelectedLabel": false,
        "multilineLabel": false,
        "passThrough": "never",
        "inputMsg": "all",
        "userInput": "disabled",
        "options": [
            {
                "label": "Stop",
                "value": "STOP",
                "valueType": "str",
                "color": "#999999"
            },
            {
                "label": "PV",
                "value": "PV",
                "valueType": "str",
                "color": "#009933"
            },
            {
                "label": "Sofort",
                "value": "Sofort",
                "valueType": "str",
                "color": "#ffa2a2"
            },
            {
                "label": "Ziel",
                "value": "Zielladen",
                "valueType": "str",
                "color": "#ffa2a2"
            },
            {
                "label": "Standby",
                "value": "Standby",
                "valueType": "str",
                "color": "#999999"
            }
        ],
        "topic": "",
        "x": 1020,
        "y": 570,
        "wires": [
            []
        ]
    },
    {
        "id": "f9e7b7ee7a5eb842",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "check msg.payload.chargemode",
        "func": "if (msg.payload.chargemode == \"stop\") {\n    msg.payload.chargemode = \"STOP\";\n}\nelse if (msg.payload.chargemode == \"pv_charging\") {\n    msg.payload.chargemode = \"PV\";\n}\nelse if (msg.payload.chargemode == \"instant_charging\") {\n    msg.payload.chargemode = \"Sofort\";\n}\nelse if (msg.payload.chargemode == \"scheduled_charging\") {\n    msg.payload.chargemode = \"Zielladen\";\n}\nelse if (msg.payload.chargemode == \"standby\") {\n    msg.payload.chargemode = \"Standby\";\n}\n\nglobal.set(\"openWB_ChargeMode\", msg.payload.chargemode);\n\n// config status UI\nmsg.enable =\"enabled_not_show\";\n\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 740,
        "y": 570,
        "wires": [
            [
                "f1bd494a2d7ff673"
            ]
        ]
    },
    {
        "id": "e7babeb3f6de407f",
        "type": "function",
        "z": "884ef8e9c6881551",
        "name": "MPPT_current_power",
        "func": "var my_MPPT_current_power = msg.payload;\n\nflow.set(\"MPPT_current_power\", Math.max(0, (Math.floor((my_MPPT_current_power - 140) / 100 ) * 100) ) );",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 560,
        "y": 990,
        "wires": [
            []
        ]
    },
    {
        "id": "fd91dd4c32b7118d",
        "type": "victron-input-system",
        "z": "884ef8e9c6881551",
        "service": "com.victronenergy.system/0",
        "path": "/Dc/Pv/Power",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Dc/Pv/Power",
            "type": "float",
            "name": "MPPTs - power (W)"
        },
        "name": "Venus system / MPPTs - power (W)",
        "onlyChanges": false,
        "x": 180,
        "y": 990,
        "wires": [
            [
                "e7babeb3f6de407f"
            ]
        ]
    },
    {
        "id": "25a9179ddf554ee8",
        "type": "change",
        "z": "884ef8e9c6881551",
        "name": "Initialize flow.MPPT_current_power",
        "rules": [
            {
                "t": "set",
                "p": "MPPT_current_power",
                "pt": "flow",
                "to": "0",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 600,
        "y": 140,
        "wires": [
            []
        ]
    },
    {
        "id": "b6ff4adb37d66744",
        "type": "ui_template",
        "z": "884ef8e9c6881551",
        "group": "8b6e543de507b09d",
        "name": "Own CSS definitions",
        "order": 14,
        "width": 0,
        "height": 0,
        "format": "<style>\n    /* All group elements */\n    ui-card-panel {\n        border-radius: 6px;\n        box-shadow: rgba(0,0,0,0.35) 0px 5px 15px;\n    }\n    \n    /* All elements inside the groups*/\n    ui-card-panel * {\n        border-radius: 3px;\n    }\n    \n    /* --------------------------------------------------------------------- */\n    /* Group definitions */\n        #PV_BatteryLifeAI_BatteryLife_Status_cards {\n            background-color: #ccdbdb;\n        }\n        .Thomas_background {\n            background-color: #ccdbdb !important;\n        }\n\n        .Thomas_Label_Text {\n            background-color: #ccdbdb !important;\n            color: #579d9d  !important;\n        }        \n        /* Group title */\n        .nr-dashboard-cardtitle {\n            max-height: 52px !important;\n            font-size: 22px !important;\n            font-weight: bold !important;\n        }\n    /* Group definitions */\n    /* --------------------------------------------------------------------- */\n    \n    /* --------------------------------------------------------------------- */\n    /* Gauge configuration */\n        /* Value */\n        .nr-dashboard-gauge > svg > text:nth-child(6) {\n            font-size: 18px !important;\n        }\n        .Thomas_roundGauge > .nr-dashboard-gauge > svg > text:nth-child(6) {\n            font-size: 14px !important;\n        }\n        /* Unit */\n        .nr-dashboard-gauge > svg > text:nth-child(7) {\n            font-weight: normal !important;\n        }\n        /* lower threshold */\n        .nr-dashboard-gauge > svg > text:nth-child(8) {\n            font-size: 9px !important;\n        }\n        /* upper threshold */\n        .nr-dashboard-gauge > svg > text:nth-child(9) {\n            font-size: 9px !important;\n        }\n        \n        .Thomas_Gauge_Scale > .nr-dashboard-gauge {\n            scale: 88%;\n        }\n    /* Gauge configuration */\n    /* --------------------------------------------------------------------- */\n    \n    /* --------------------------------------------------------------------- */\n    /* Value configuration */\n        /* Value font size */\n        .nr-dashboard-text {\n            padding: 0 2px 0 8px !important;\n        }\n        \n        .nr-dashboard-text > .value {\n            font-size: 16px;\n            margin-right: 0.5em !important;\n        }\n        \n        .Thomas_extSlider > .value {\n            font-size: 15px !important;\n        }\n        .Thomas_extLabel {\n            width: 120px !important;\n        }\n    /* Value configuration */\n    /* --------------------------------------------------------------------- */\n\n    /* --------------------------------------------------------------------- */\n    /* Mult-Slider configuration */\n        /* Padding */\n        .multistate-slider-wrapper {\n            padding-top: 0.05em !important;\n            padding-bottom: 0.05em !important;\n        }\n        \n        /* Height */\n        .multistate-switch-slider {\n            height: 1.45em !important;\n        }\n    /* Mult-Slider configuration */\n    /* --------------------------------------------------------------------- */\n\n\n    /* --------------------------------------------------------------------- */\n    /* Slider configuration */\n    /* Slider right padding */\n    .Thomas_SliderPosition {\n        left: 110px !important;\n        width: 150px !important;\n    }\n    .Thomas_Slider > md-slider .md-slider-wrapper  {\n        width: 95% !important;\n    }\n    .nr-dashboard-slider {\n        padding: 0 0px 0 1px !important;\n    }\n    /* Current value */\n    .nr-dashboard-theme .nr-dashboard-slider .md-sign::after {\n        border-top-color: #6eb6b6 !important;\n    }\n    .nr-dashboard-theme .nr-dashboard-slider .md-sign {\n        background-color: #6eb6b6 !important;\n    }\n    \n    .nr-dashboard-theme .nr-dashboard-slider .md-thumb-text {\n        color: #676767;\n    }\n    /* Slider configuration */\n    /* --------------------------------------------------------------------- */\n\n    /* Switch right padding */\n    .nr-dashboard-switch md-switch {\n        padding: 0 0px 0 38px !important;\n    }\n    \n    .Thomas_label {\n        color: rgb(128, 128, 128) !important;\n        font-size: 26px !important;\n    }\n\n    .Thomas_label > .value {\n        font-size: 26px !important;\n        margin-right: 0.2em !important;\n    }\n\n</style>",
        "storeOutMessages": true,
        "fwdInMessages": true,
        "resendOnRefresh": true,
        "templateScope": "global",
        "className": "",
        "x": 560,
        "y": 40,
        "wires": [
            []
        ]
    },
    {
        "id": "bbeee46e44f7cff0",
        "type": "comment",
        "z": "884ef8e9c6881551",
        "name": "!! Adapt or delete this node !!",
        "info": "",
        "x": 800,
        "y": 40,
        "wires": [],
        "icon": "node-red-contrib-modbus/modbus.png"
    },
    {
        "id": "8976a8fb70b2a7e5",
        "type": "ui_spacer",
        "z": "884ef8e9c6881551",
        "name": "spacer",
        "group": "60e107699f7d15de",
        "order": 2,
        "width": 5,
        "height": 1
    },
    {
        "id": "55c6d50ad298d42c",
        "type": "ui_spacer",
        "z": "884ef8e9c6881551",
        "name": "spacer",
        "group": "a6eae8b0cd7f551b",
        "order": 3,
        "width": 3,
        "height": 1
    },
    {
        "id": "48b173a9bfae974b",
        "type": "mqtt-broker",
        "name": "OpenWB",
        "broker": "172.27.27.230",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "45",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "2",
        "birthRetain": "true",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "2",
        "closeRetain": "true",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "2",
        "willRetain": "true",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    },
    {
        "id": "60e107699f7d15de",
        "type": "ui_group",
        "name": "Wallbox-Status",
        "tab": "6090ba447def0853",
        "order": 1,
        "disp": true,
        "width": "8",
        "collapse": false,
        "className": ""
    },
    {
        "id": "a6eae8b0cd7f551b",
        "type": "ui_group",
        "name": "Inverter-Limit",
        "tab": "6090ba447def0853",
        "order": 2,
        "disp": true,
        "width": "8",
        "collapse": false,
        "className": ""
    },
    {
        "id": "8b6e543de507b09d",
        "type": "ui_group",
        "name": "BatteryLife Status",
        "tab": "b7bddb42df0326b4",
        "order": 1,
        "disp": true,
        "width": "8",
        "collapse": false,
        "className": ""
    },
    {
        "id": "6090ba447def0853",
        "type": "ui_tab",
        "name": "Wallbox",
        "icon": "ev_station",
        "order": 4,
        "disabled": false,
        "hidden": false
    },
    {
        "id": "b7bddb42df0326b4",
        "type": "ui_tab",
        "name": "PV BatteryLifeAI",
        "icon": "fa-battery-half",
        "order": 2,
        "disabled": false,
        "hidden": false
    }
]