[
    {
        "id": "b2d125deefb5deab",
        "type": "tab",
        "label": "openWB Steuerung",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "ee321202105e9cb7",
        "type": "victron-input-battery",
        "z": "b2d125deefb5deab",
        "service": "com.victronenergy.battery.socketcan_can0",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery.socketcan_can0",
            "name": "Pylontech battery",
            "paths": [
                {
                    "path": "/Alarms/CellImbalance",
                    "type": "enum",
                    "name": "Cell Imbalance alarm",
                    "enum": {
                        "0": "No alarm",
                        "1": "Warning",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/HighChargeCurrent",
                    "type": "enum",
                    "name": "High charge current alarm",
                    "enum": {
                        "0": "No alarm",
                        "1": "Warning",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/HighChargeTemperature",
                    "type": "enum",
                    "name": "High charge temperature alarm",
                    "enum": {
                        "0": "No alarm",
                        "1": "Warning",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/HighDischargeCurrent",
                    "type": "enum",
                    "name": "High discharge current alarm",
                    "enum": {
                        "0": "No alarm",
                        "1": "Warning",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/HighTemperature",
                    "type": "enum",
                    "name": "High battery temperature alarm",
                    "enum": {
                        "0": "No alarm",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/HighVoltage",
                    "type": "enum",
                    "name": "High voltage alarm",
                    "enum": {
                        "0": "No alarm",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/InternalFailure",
                    "type": "enum",
                    "name": "Internal error alarm",
                    "enum": {
                        "0": "No alarm",
                        "1": "Warning",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/LowChargeTemperature",
                    "type": "enum",
                    "name": "Low charge temperature alarm",
                    "enum": {
                        "0": "No alarm",
                        "1": "Warning",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/LowTemperature",
                    "type": "enum",
                    "name": "Low battery temperature alarm",
                    "enum": {
                        "0": "No alarm",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Alarms/LowVoltage",
                    "type": "enum",
                    "name": "Low voltage alarm",
                    "enum": {
                        "0": "No alarm",
                        "2": "Alarm"
                    }
                },
                {
                    "path": "/Capacity",
                    "type": "float",
                    "name": "Capacity (Ah)"
                },
                {
                    "path": "/Dc/0/Current",
                    "type": "float",
                    "name": "Current (A)"
                },
                {
                    "path": "/Dc/0/Temperature",
                    "type": "float",
                    "name": "Battery temperature (C)"
                },
                {
                    "path": "/Dc/0/Voltage",
                    "type": "float",
                    "name": "Voltage (V)"
                },
                {
                    "path": "/History/ChargedEnergy",
                    "type": "float",
                    "name": "Charged Energy (kWh)"
                },
                {
                    "path": "/History/DischargedEnergy",
                    "type": "float",
                    "name": "Discharged Energy (kWh)"
                },
                {
                    "path": "/Info/BatteryLowVoltage",
                    "type": "float",
                    "name": "Min discharge voltage (V DC)"
                },
                {
                    "path": "/Info/MaxChargeCurrent",
                    "type": "float",
                    "name": "CCL - Charge Current Limit (A)"
                },
                {
                    "path": "/Info/MaxChargeVoltage",
                    "type": "float",
                    "name": "CVL - Charge Voltage Limit (V)"
                },
                {
                    "path": "/Info/MaxDischargeCurrent",
                    "type": "float",
                    "name": "DCL - Discharge Current Limit (A)"
                },
                {
                    "path": "/Soc",
                    "type": "float",
                    "name": "State of charge (%)"
                },
                {
                    "path": "/Soh",
                    "type": "float",
                    "name": "State of health (%)"
                },
                {
                    "path": "/System/MaxVoltageCellId",
                    "type": "string",
                    "name": "System; ID of module with highest cell voltage"
                },
                {
                    "path": "/System/MaxCellTemperature",
                    "type": "float",
                    "name": "Maximum cell temperature (Degrees celsius)"
                },
                {
                    "path": "/System/MaxCellVoltage",
                    "type": "float",
                    "name": "System; maximum cell voltage (V DC)"
                },
                {
                    "path": "/System/MaxTemperatureCellId",
                    "type": "string",
                    "name": "System; ID of module with highest cell temperature"
                },
                {
                    "path": "/System/MinVoltageCellId",
                    "type": "string",
                    "name": "System; ID of module with lowest cell voltage"
                },
                {
                    "path": "/System/MinCellTemperature",
                    "type": "float",
                    "name": "Minimum cell temperature (Degrees celsius)"
                },
                {
                    "path": "/System/MinCellVoltage",
                    "type": "float",
                    "name": "System; minimum cell voltage (V DC)"
                },
                {
                    "path": "/System/MinTemperatureCellId",
                    "type": "string",
                    "name": "System; ID of module with lowest cell temperature"
                },
                {
                    "path": "/System/NrOfModulesBlockingCharge",
                    "type": "integer",
                    "name": "Number of modules blocking charge"
                },
                {
                    "path": "/System/NrOfModulesBlockingDischarge",
                    "type": "integer",
                    "name": "Number of modules blocking discharge"
                },
                {
                    "path": "/System/NrOfModulesOffline",
                    "type": "integer",
                    "name": "Number of offline modules"
                },
                {
                    "path": "/System/NrOfModulesOnline",
                    "type": "integer",
                    "name": "Number of online modules"
                }
            ]
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "initial": "",
        "name": "SOC",
        "x": 70,
        "y": 40,
        "wires": [
            [
                "561911caf2627d6e"
            ]
        ]
    },
    {
        "id": "561911caf2627d6e",
        "type": "function",
        "z": "b2d125deefb5deab",
        "name": "Store \"SOC\"",
        "func": "flow.set('SOC',msg.payload);",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 250,
        "y": 40,
        "wires": [
            []
        ]
    },
    {
        "id": "5c5f12a0607f1882",
        "type": "mqtt out",
        "z": "b2d125deefb5deab",
        "name": "",
        "topic": "",
        "qos": "",
        "retain": "",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "fa433d8bfe29a6f1",
        "x": 470,
        "y": 100,
        "wires": []
    },
    {
        "id": "bac4d4a7c1013f29",
        "type": "inject",
        "z": "b2d125deefb5deab",
        "name": "1min",
        "props": [],
        "repeat": "60",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "x": 90,
        "y": 100,
        "wires": [
            [
                "a0fb16b21cb1858b"
            ]
        ]
    },
    {
        "id": "a0fb16b21cb1858b",
        "type": "function",
        "z": "b2d125deefb5deab",
        "name": "Ladeleistungsreserve",
        "func": "var tmp_SOC = flow.get(\"SOC\");\nmsg={};\n\nif (tmp_SOC <= 60) {\n  msg.payload = \"5000\";\n}\nif (tmp_SOC > 60 && tmp_SOC <= 80) {\n  msg.payload = \"2500\";\n}\nif (tmp_SOC > 80  && tmp_SOC <= 90) {\n  msg.payload = \"1500\";\n}\nif (tmp_SOC > 90  && tmp_SOC <= 95) {\n  msg.payload = \"1000\";\n}\nif (tmp_SOC > 95) {\n  msg.payload = \"100\";\n}\n\nmsg.topic = \"openWB/config/set/pv/minBatteryChargePowerAtEvPriority\";\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 280,
        "y": 100,
        "wires": [
            [
                "5c5f12a0607f1882"
            ]
        ]
    },
    {
        "id": "fa433d8bfe29a6f1",
        "type": "mqtt-broker",
        "name": "openWB",
        "broker": "192.168.1.91",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]