Use Venus OS Node Red to run the battery grid friendly

I have a Multi plus 3000 a small 2kWp DC coupled and a large 12 kWp PVsystem with a 9.6 kW pylon tech battery 48V. I live in Germany and have an electricity contract with a fixed price per kWh, so an ESS system does not make to much sense. With growing renewable energy we face the problem of higher grid load, but the battery of privat PV system are not used grid firiendly. The charge excess already in the morning, when everybody needs power to make coffee or whatever. The battery is charged already at noon, when the excess PV power in summer is overloading the grid.
My constrains were:

  • load as late as possible in the morning
  • make sure the battery is charged in the evening, even when it gets cloudy/raining in the afternoon
  • avoid feeding DC excess into the grid

Watt do the Nodes do:

They ask for the SOC of the battery
They ask once for the daily PV yield forecast (2 options Victron forecast or solforcast)
They ask for the current PV yield of the DC system

from 6:00-9:30 h it is asked, if the SOC is above 25%, so there is some residual load, if the PV yield is not high enough to run my coffee maker. If SOC above 25% it asks, if PV yield forecast is above 22 kWh (10 kWh for the battery and 12 kWh for the typical house use in my case, to be adopted). If both is OK, the charge power is limited to the DC load and AC excess is charged into the grid.
at 9:30 h the charging power to the battery is limited depending on the SOC of the battery. I calculated, that the charging time from every 10% step takes approximately 5 h to charge, so the battery is charged at 14:30 h latest.
at 13:30 h the program ends and the maximum capability of the multi II is used to charge the battery.

I run that during the summer and had all days with not sufficient PV yield covered.

I put the code in here, but as I am not an IT expert, I can not run a GitHub page and can only give limited support.

what you need to change is the “site ID” in the solar forecast node you find it, when you open your VRM Portal and click on the https address in your brother: You see something like VRM Portal - Victron Energy the number you find in your installation instead of the 1xyz45 is your site ID. The rest should work.

There is an alternative forecast, which I used up to know, which is still included in the node. I owe some thank you, for the one, who wrote it, but I do not know, where I got it from. it gives still a forecast, but in this Node you have to insert your location (I changed it to Kassel Germany with a 25° south PV of 10 kWp)

[
    {
        "id": "93f485839dfa27a8",
        "type": "subflow",
        "name": "Solar forecast",
        "info": "This subflow uses the http request node to fetch solar forecasts for geographical positions, using the API from https://forecast.solar/. Please check their website and consider getting a paid account.\n\nDo note that, on a free account, you are limited in the number of requests to do. Also note that the data only gets updated once every 15 minutes, so there is no reason to query more often. There is rate limiting built in the subflow not to perform requests more than once every 15 minutes.\n\n# Configuration\n\nIt uses the parameters as described on: http://doc.forecast.solar/doku.php\n\n - `:apikey` - personal API key for registered users\n - `:lat` - latitude of location, -90 (south) … 90 (north); Internal precission is 0.0001 or abt. 10 m\n - `:lon` - longitude of location, -180 (west) … 180 (east); Internal precission is 0.0001 or abt. 10 m\n - `:dec` - plane declination, 0 (horizontal) … 90 (vertical); Internal precission is integer\n - `:az` - plane azimuth, -180 … 180 (-180 = north, -90 = east, 0 = south, 90 = west, 180 = north); Internal precission is integer\n - `:kwp` - installed modules power in kilo watt peak (kWp)\n\nYou can choose between 3 different type of requests. Note that only `estimate` is available on the free plan.\n\n- `estimate` - this is the forecasted estimate that your panels should produce (given the right parameter settings)\n- `history` - historycal data\n- `clear sky` - estimate given if there would be a clear sky tomorrow\n\nIn case of estimates, one of the following options can be selected:\n- `watts` - Watts (power) average for the period\n- `watthours/period` - Watt hours (energy) for the period\n- `watthours` - Watt hours (energy) summarized over the day\n- `watthours/day` - Watt hours (energy) summarized for each day\n\nFor the graph output there are some extra settings available:\n\n- _Output in kWh_ - when checked output can be set to kWh instead of Wh\n- _Show todays forecast_ - whether or not to include todays forecast\n- _Days to forecast_ - the number of days to forecast (excluding today). Note that you can not get more days forecasted than your API key allows.\n- _Widen graph_ - widen the graph to only show non-zero values\n- _Show day instead of date_ - Show the day instead of the date in the series and labels\n\nThe optional _horizon_ field can be filled out in case an object blocks\nyour solar panels from the sun. See the description [here](https://doc.forecast.solar/horizon)\non what numbers to fill out.\nLeave it empty if you have no objects blocking your panels.\n\n# Input \n\nThe input is for triggering the solar forecast request. \nIt triggers when injecting a message into the node.\n\n# Output\n\nThere are two outputs. The first output is an object with the result and a status message stored into the `msg.payload`.\n\nMost important is the `msg.payload.result`, which contains the estimated production of the panels. E.g.:\n\n```\npayload: object\n  result: object\n    2022-11-28: 23\n    2022-11-29: 35\n```\n\nThe `msg.payload.message` gives information on how successful the query was, the exitcode of the query and the status of the rate limit (how many queries you have left).\n\nThe **second** output can be directly linked to a line or a bar chart, quickly giving a once-glance overview for the predicted forecast.\n\n# Status\n\nInitially the status of the note will be a blue dot, showing \"_Unknown limit_\", as it is unaware of the set ratelmits. After the first request, the returned ratelimit will be put in the text in the form of `remaining/limit`. If more than half the limit is remaining, the dot will be green. If less then half the limit is remaining, the dot will be yellow. If no limit is left, the dot will turn red.\nPlease keep in mind that the ratelimit will be reset after one hour, so you can send a new request after that hour.\n\nIf something is wrong in the API request, the dot will turn red\nand the message will contain the msg.payload with the error. This\nhappens typically when the API is temporally down for maintenance.",
        "category": "",
        "in": [
            {
                "x": 240,
                "y": 100,
                "wires": [
                    {
                        "id": "c8dc6aa14b9f3e92"
                    }
                ]
            }
        ],
        "out": [
            {
                "x": 760,
                "y": 260,
                "wires": [
                    {
                        "id": "2f42837904c91d73",
                        "port": 0
                    },
                    {
                        "id": "fcc8d69a3ab88e6d",
                        "port": 0
                    }
                ]
            },
            {
                "x": 770,
                "y": 340,
                "wires": [
                    {
                        "id": "5b0a430fb61e70e7",
                        "port": 0
                    }
                ]
            }
        ],
        "env": [
            {
                "name": "latitude",
                "type": "num",
                "value": "51.3",
                "ui": {
                    "icon": "font-awesome/fa-location-arrow",
                    "label": {
                        "en-US": "Latitude"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "num"
                        ]
                    }
                }
            },
            {
                "name": "longitude",
                "type": "num",
                "value": "5.6",
                "ui": {
                    "icon": "font-awesome/fa-location-arrow",
                    "label": {
                        "en-US": "Longitude"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "num"
                        ]
                    }
                }
            },
            {
                "name": "declination",
                "type": "num",
                "value": "37",
                "ui": {
                    "icon": "font-awesome/fa-chevron-up",
                    "label": {
                        "en-US": "Declination"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "num"
                        ]
                    }
                }
            },
            {
                "name": "azimuth",
                "type": "num",
                "value": "0",
                "ui": {
                    "icon": "font-awesome/fa-compass",
                    "label": {
                        "en-US": "Azimuth"
                    },
                    "type": "spinner",
                    "opts": {
                        "min": -180,
                        "max": 180
                    }
                }
            },
            {
                "name": "modules power",
                "type": "num",
                "value": "1",
                "ui": {
                    "icon": "font-awesome/fa-power-off",
                    "label": {
                        "en-US": "Modules power (kWp)"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "num"
                        ]
                    }
                }
            },
            {
                "name": "apikey",
                "type": "cred",
                "ui": {
                    "icon": "font-awesome/fa-key",
                    "label": {
                        "en-US": "API key"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "cred"
                        ]
                    }
                }
            },
            {
                "name": "type",
                "type": "str",
                "value": "estimate",
                "ui": {
                    "label": {
                        "en-US": "Type"
                    },
                    "type": "select",
                    "opts": {
                        "opts": [
                            {
                                "l": {
                                    "en-US": "Estimate"
                                },
                                "v": "estimate"
                            },
                            {
                                "l": {
                                    "en-US": "History"
                                },
                                "v": "history"
                            },
                            {
                                "l": {
                                    "en-US": "Clear sky"
                                },
                                "v": "clearsky"
                            }
                        ]
                    }
                }
            },
            {
                "name": "watt",
                "type": "str",
                "value": "watts",
                "ui": {
                    "icon": "font-awesome/fa-question-circle-o",
                    "label": {
                        "en-US": "Watt"
                    },
                    "type": "select",
                    "opts": {
                        "opts": [
                            {
                                "l": {
                                    "en-US": "Watts (power) average for the period"
                                },
                                "v": "watts"
                            },
                            {
                                "l": {
                                    "en-US": "Watt hours (energy) for the period"
                                },
                                "v": "watthours/period"
                            },
                            {
                                "l": {
                                    "en-US": "Watt hours (energy) summarized over the day"
                                },
                                "v": "watthours"
                            },
                            {
                                "l": {
                                    "en-US": "Watt hours (energy) summarized for each day"
                                },
                                "v": "watthours/day"
                            }
                        ]
                    }
                }
            },
            {
                "name": "kwhoutput",
                "type": "bool",
                "value": "false",
                "ui": {
                    "label": {
                        "en-US": "Output in kWh (in the graph)"
                    },
                    "type": "checkbox"
                }
            },
            {
                "name": "showtoday",
                "type": "bool",
                "value": "true",
                "ui": {
                    "label": {
                        "en-US": "Show todays forecast"
                    },
                    "type": "checkbox"
                }
            },
            {
                "name": "daystoforecast",
                "type": "str",
                "value": "-1",
                "ui": {
                    "label": {
                        "en-US": "Days to forecast"
                    },
                    "type": "select",
                    "opts": {
                        "opts": [
                            {
                                "l": {
                                    "en-US": "Max"
                                },
                                "v": "-1"
                            },
                            {
                                "l": {
                                    "en-US": "0"
                                },
                                "v": "0"
                            },
                            {
                                "l": {
                                    "en-US": "1"
                                },
                                "v": "1"
                            },
                            {
                                "l": {
                                    "en-US": "2"
                                },
                                "v": "2"
                            },
                            {
                                "l": {
                                    "en-US": "3"
                                },
                                "v": "3"
                            },
                            {
                                "l": {
                                    "en-US": "4"
                                },
                                "v": "4"
                            },
                            {
                                "l": {
                                    "en-US": "5"
                                },
                                "v": "5"
                            },
                            {
                                "l": {
                                    "en-US": "6"
                                },
                                "v": "6"
                            }
                        ]
                    }
                }
            },
            {
                "name": "widengraph",
                "type": "bool",
                "value": "true",
                "ui": {
                    "label": {
                        "en-US": "Widen graph"
                    },
                    "type": "checkbox"
                }
            },
            {
                "name": "showday",
                "type": "bool",
                "value": "false",
                "ui": {
                    "label": {
                        "en-US": "Show day instead of date"
                    },
                    "type": "checkbox"
                }
            },
            {
                "name": "horizon",
                "type": "str",
                "value": "",
                "ui": {
                    "icon": "font-awesome/fa-tree",
                    "label": {
                        "en-US": "(optional) horizon"
                    },
                    "type": "input",
                    "opts": {
                        "types": [
                            "str"
                        ]
                    }
                }
            }
        ],
        "meta": {
            "module": "Solar Forecast",
            "version": "0.0.14",
            "author": "dfaber@victronenergy.com",
            "desc": "Get solar forecasting per location",
            "keywords": "solar,forecast,api",
            "license": "GPL-3.0"
        },
        "color": "#FFCC66",
        "inputLabels": [
            "trigger"
        ],
        "outputLabels": [
            "output",
            "graph",
            ""
        ],
        "icon": "font-awesome/fa-sun-o",
        "status": {
            "x": 680,
            "y": 560,
            "wires": [
                {
                    "id": "1bfc1cde3ee94e4b",
                    "port": 0
                },
                {
                    "id": "a798fbe66cf133d5",
                    "port": 0
                }
            ]
        }
    },
    {
        "id": "c706820c0d61f023",
        "type": "http request",
        "z": "93f485839dfa27a8",
        "name": "",
        "method": "GET",
        "ret": "txt",
        "paytoqs": "ignore",
        "url": "",
        "tls": "",
        "persist": false,
        "proxy": "",
        "insecureHTTPParser": false,
        "authType": "",
        "senderr": false,
        "headers": [],
        "x": 390,
        "y": 180,
        "wires": [
            [
                "1b5ccaa05d54f7c3"
            ]
        ]
    },
    {
        "id": "b9488734852cd0ca",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "create forecast.solar url",
        "func": "msg.url = 'https://api.forecast.solar/';\n\n//if (env.get('apikey')) {\n//    msg.url += env.get('apikey') + '/';\n //   }\n\nmsg.url += env.get('type') + '/';\n\nmsg.url += env.get('watt') + '/';\n\nmsg.url += env.get('latitude') + '/' +\n           env.get('longitude') + '/' +\n           env.get('declination') + '/' +\n           env.get('azimuth') + '/' +\n           env.get('modules power');\n\nif (env.get('horizon')) {\n    msg.url += '?horizon=' + env.get('horizon')\n}\nmsg.topic = 'solar forecast: '+(env.get('type') || '');\nmsg.topic += (' '+env.get('watt') || '');\nif (env.get('kwhoutput')) {\n    msg.topic += ' (kWh)';\n}\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 630,
        "y": 100,
        "wires": [
            [
                "975daf96f15cfb61"
            ]
        ]
    },
    {
        "id": "1b5ccaa05d54f7c3",
        "type": "json",
        "z": "93f485839dfa27a8",
        "name": "Convert to json",
        "property": "payload",
        "action": "",
        "pretty": false,
        "x": 680,
        "y": 180,
        "wires": [
            [
                "e718a22973cc2864"
            ]
        ]
    },
    {
        "id": "559391d1288f762a",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "update ratelimit",
        "func": "var remaining = msg.payload.message.ratelimit.remaining || 0;\nvar limit = msg.payload.message.ratelimit.limit;\n\nflow.set('forecast.solar.ratelimit.remaining', remaining)\nflow.set('forecast.solar.ratelimit.limit', limit)\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 480,
        "wires": [
            [
                "e56826252134b93a"
            ]
        ]
    },
    {
        "id": "e718a22973cc2864",
        "type": "link out",
        "z": "93f485839dfa27a8",
        "name": "link out 1",
        "mode": "link",
        "links": [
            "3fa24f2d08195961",
            "0a20e852662c8cec"
        ],
        "x": 815,
        "y": 180,
        "wires": []
    },
    {
        "id": "3fa24f2d08195961",
        "type": "link in",
        "z": "93f485839dfa27a8",
        "name": "link in 1",
        "links": [
            "e718a22973cc2864"
        ],
        "x": 385,
        "y": 480,
        "wires": [
            [
                "559391d1288f762a"
            ]
        ]
    },
    {
        "id": "0a20e852662c8cec",
        "type": "link in",
        "z": "93f485839dfa27a8",
        "name": "link in 2",
        "links": [
            "e718a22973cc2864"
        ],
        "x": 225,
        "y": 260,
        "wires": [
            [
                "fcc8d69a3ab88e6d"
            ]
        ]
    },
    {
        "id": "4734b6f403e1f03e",
        "type": "inject",
        "z": "93f485839dfa27a8",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 530,
        "y": 440,
        "wires": [
            [
                "e56826252134b93a"
            ]
        ]
    },
    {
        "id": "1bfc1cde3ee94e4b",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "update status",
        "func": "var remaining = flow.get('forecast.solar.ratelimit.remaining') || -1;\nvar limit = flow.get('forecast.solar.ratelimit.limit') || -1\n\nvar text = remaining.toString() + '/' + limit.toString();\nvar fill = \"green\";\n\nif (remaining == 0) {\n    fill = \"red\";\n    text = \"Limit used\";\n}\n\nif (remaining > 0 && remaining < limit / 2) {\n    fill = \"yellow\"\n}\n\nif (remaining == -1 ) {\n    fill = \"blue\"\n    text = \"Limits unknown\"\n}\n\nmsg.payload = ({ fill: fill, text: text });\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 580,
        "wires": [
            []
        ]
    },
    {
        "id": "a18e96179ec2d987",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "Create graph output",
        "func": "var m = {};\nm.labels = [];\nm.data = [];\nm.series = [];\n\nfor (let j = 0; j <= msg.days; j++) {\n    m.data[j] = [];\n}\n\nif (msg.watt === 'watt_hours_day' || msg.watt === 'watthours/day') {\n    var i = 0;\n    if (msg.kwhoutput) {\n        m.series.push(\"kWh per day\");\n    } else {\n        m.series.push(\"Watt hours per day\");\n    }\n    for (const key in msg.payload.result) {\n        m.labels.push(key);\n        if (msg.kwhoutput) {\n            m.data[i] = +(Math.round(msg.payload.result[key]/100)*.1).toFixed(1);\n        } else {\n            m.data[i] = msg.payload.result[key];\n        }\n        i++;\n    }\n    m.data = [m.data];\n    return { payload: [m] };\n}\n\nfor (let i = 0; i <= 23; i++) {\n\n    m.labels.push(i.toString()+':00');\n    if (msg.resolution === 4) {\n       m.labels.push(i.toString()+':15');\n    }\n    if (msg.resolution === 2 || msg.resolution == 4) {\n       m.labels.push(i.toString()+':30');\n    }\n    if (msg.resolution === 4) {\n       m.labels.push(i.toString()+':45');\n    }\n\n    for (let j = 0; j <= msg.days; j++) {\n        m.data[j].push(0);\n        if (msg.resolution === 4) {\n           m.data[j].push(0)\n        }\n        if (msg.resolution === 2 || msg.resolution == 4) {\n           m.data[j].push(0)\n        }\n        if (msg.resolution === 4) {\n           m.data[j].push(0)\n        }\n\n    }\n}\n\nvar offset = 0;\nfor (const key in msg.payload.result) {\n    var d = new Date(key)\n    if (m.series.indexOf(d.toISOString().split('T')[0]) === -1) {\n        m.series.push(d.toISOString().split('T')[0])\n    }\n\n    var h = d.getHours();\n    var minutes = d.getMinutes();\n\n    if (minutes === 0 ) {\n        offset = 0;\n    } else {\n        offset++;\n    }\n\n    if (msg.kwhoutput) {\n        m.data[m.series.length - 1][h*msg.resolution+offset] = +(Math.round(msg.payload.result[key]/100)*.1).toFixed(1);\n    } else {\n        m.data[m.series.length - 1][h*msg.resolution+offset] = msg.payload.result[key];\n    }\n}\n\nif (msg.watt === 'watt_hours') {\n    for (const i in m.data) {\n        let x = m.data[i][0]\n        for (const d in m.data[i]) {\n            if ( x > m.data[i][d]) {\n                m.data[i][d] = x \n            }\n            x = m.data[i][d]\n        }\n    }\n}\n\nreturn { payload: [m] };\n",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 340,
        "wires": [
            [
                "5b0a430fb61e70e7"
            ]
        ]
    },
    {
        "id": "975daf96f15cfb61",
        "type": "link out",
        "z": "93f485839dfa27a8",
        "name": "link out 7",
        "mode": "link",
        "links": [
            "14f2e68e572f4ef8"
        ],
        "x": 805,
        "y": 100,
        "wires": []
    },
    {
        "id": "14f2e68e572f4ef8",
        "type": "link in",
        "z": "93f485839dfa27a8",
        "name": "link in 18",
        "links": [
            "975daf96f15cfb61"
        ],
        "x": 245,
        "y": 180,
        "wires": [
            [
                "c706820c0d61f023"
            ]
        ]
    },
    {
        "id": "c4307905e114824f",
        "type": "catch",
        "z": "93f485839dfa27a8",
        "name": "",
        "scope": null,
        "uncaught": false,
        "x": 260,
        "y": 440,
        "wires": [
            [
                "f427f19392c399ce"
            ]
        ]
    },
    {
        "id": "e56826252134b93a",
        "type": "link out",
        "z": "93f485839dfa27a8",
        "name": "link out 8",
        "mode": "link",
        "links": [
            "dbaf8f5f5a920686"
        ],
        "x": 685,
        "y": 480,
        "wires": []
    },
    {
        "id": "dbaf8f5f5a920686",
        "type": "link in",
        "z": "93f485839dfa27a8",
        "name": "link in 19",
        "links": [
            "e56826252134b93a"
        ],
        "x": 385,
        "y": 580,
        "wires": [
            [
                "1bfc1cde3ee94e4b"
            ]
        ]
    },
    {
        "id": "f427f19392c399ce",
        "type": "link out",
        "z": "93f485839dfa27a8",
        "name": "link out 9",
        "mode": "link",
        "links": [
            "2ded0c14a222b4d9",
            "2f42837904c91d73"
        ],
        "x": 375,
        "y": 440,
        "wires": []
    },
    {
        "id": "2ded0c14a222b4d9",
        "type": "link in",
        "z": "93f485839dfa27a8",
        "name": "link in 20",
        "links": [
            "f427f19392c399ce"
        ],
        "x": 385,
        "y": 540,
        "wires": [
            [
                "a798fbe66cf133d5"
            ]
        ]
    },
    {
        "id": "a798fbe66cf133d5",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "Set error status",
        "func": "node.warn(msg.payload)\nmsg.payload = ({ fill: \"red\", text: msg.payload });\n\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 520,
        "y": 540,
        "wires": [
            []
        ]
    },
    {
        "id": "2f42837904c91d73",
        "type": "link in",
        "z": "93f485839dfa27a8",
        "name": "link in 21",
        "links": [
            "f427f19392c399ce"
        ],
        "x": 665,
        "y": 280,
        "wires": [
            []
        ]
    },
    {
        "id": "fcc8d69a3ab88e6d",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "Processed info",
        "func": "msg.resolution = 60;\nmsg.days = 1;\nmsg.type = env.get('type');\nmsg.watt = env.get('watt');\nmsg.kwhoutput = env.get('kwhoutput');\n\nvar key1 = Object.keys(msg.payload.result)[1];\nvar key2 = Object.keys(msg.payload.result)[2];\nvar key3 = Object.keys(msg.payload.result)[Object.keys(msg.payload.result).length-1];\n\nvar d1 = new Date(key1);\nvar d2 = new Date(key2); \nvar d3 = new Date(key3);\nmsg.resolution = 3600000 / (d2.getTime() - d1.getTime());\n\nmsg.days = Math.floor((d3.getTime() - d1.getTime()) / (1000 * 3600 * 24));\n\nif (msg.watt === 'watt_hours_day' || msg.watt === 'watthours/day') {\n    msg.resolution = null;\n}\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 360,
        "y": 260,
        "wires": [
            [
                "a18e96179ec2d987"
            ]
        ],
        "info": "Function to process the result from forecast.solar to add\nextra information, which is handy for either graphing or\nto store in a database.\n\n\nThe extra values added:\n- `msg.resolution` - The number of measurements per hour. If\nno API key is used, this will be 1. Other values may be 2 or 4.\n- `msg.days` - The number of days in the forcast. If no API\n- key is used this will be 1. Other values may be 3 or 6."
    },
    {
        "id": "5b0a430fb61e70e7",
        "type": "function",
        "z": "93f485839dfa27a8",
        "name": "Filter graph",
        "func": "\nif (env.get('showday')) {\n    const weekday = [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"];\n    msg.payload[0].labels.forEach(function (/** @type {string | number | Date} */ date, /** @type {string | number} */ index, /** @type {{ [x: string]: string; }} */ array) {\n        const d = new Date(date)\n        if (!isNaN(d)) {\n            array[index] = weekday[d.getDay()]\n        }\n    })\n    msg.payload[0].series.forEach(function (/** @type {string | number | Date} */ date, /** @type {string | number} */ index, /** @type {{ [x: string]: string; }} */ array) {\n        const d = new Date(date)\n        if (!isNaN(d)) {\n            array[index] = weekday[d.getDay()]\n        }\n    })\n}\n\nif (env.get('watt') === 'watt_hours_day' || env.get('watt') === 'watthours/day') {\n    if (!env.get('showtoday')) {\n        msg.payload[0].data[0].shift();\n        msg.payload[0].labels.shift();\n    }\n    return msg;\n}\n\nif (!env.get('showtoday')) {\n    msg.payload[0].data.shift();\n    msg.payload[0].series.shift();\n}\n\nvar forecasted = msg.payload[0].series.length;\n\nif ((Number(env.get('daystoforecast')) > -1) && (Number(env.get('daystoforecast')) < forecasted)) {\n    for (let i = 1; i <= (forecasted - Number(env.get('daystoforecast'))); i++ ) {\n        msg.payload[0].data.pop();\n        msg.payload[0].series.pop();\n    }\n}\n\nif (env.get('widengraph')) {\n    var c = msg.payload[0].labels.length;\n    var x = 0;\n    for (let i = 0; i < c; i++) {\n        var remove = true;\n        for (let d = 0; d < msg.payload[0].data.length; d++) {\n            if (msg.payload[0].data[d][x] > 0) {\n                remove = false;\n            }\n        }\n        if (remove) {\n            msg.payload[0].labels.splice(x, 1);\n            for (let d = 0; d < msg.payload[0].data.length; d++) {\n                 msg.payload[0].data[d].splice(x, 1);\n            }\n            x--;\n        }\n        x++;\n    }\n    // Still the first and last datapoints should be zero, so\n    // add those again\n    msg.payload[0].labels.unshift('');\n    msg.payload[0].labels.push('');\n    for (let d = 0; d < msg.payload[0].data.length; d++) {\n         msg.payload[0].data[d].unshift(0);\n         msg.payload[0].data[d].push(0);\n    }   \n}\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 590,
        "y": 340,
        "wires": [
            []
        ]
    },
    {
        "id": "c8dc6aa14b9f3e92",
        "type": "delay",
        "z": "93f485839dfa27a8",
        "name": "1 msg/15 minutes",
        "pauseType": "rate",
        "timeout": "5",
        "timeoutUnits": "seconds",
        "rate": "1",
        "nbRateUnits": "15",
        "rateUnits": "minute",
        "randomFirst": "1",
        "randomLast": "5",
        "randomUnits": "seconds",
        "drop": false,
        "allowrate": false,
        "outputs": 1,
        "x": 390,
        "y": 100,
        "wires": [
            [
                "b9488734852cd0ca"
            ]
        ]
    },
    {
        "id": "4f3f584b76922fbd",
        "type": "inject",
        "z": "4facfd665af09b5c",
        "name": "6 bis 10 Uhr",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "*/1 6-8 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 250,
        "y": 220,
        "wires": [
            [
                "6a2fed301b2596c0"
            ]
        ]
    },
    {
        "id": "1fa7197d2e9f35b9",
        "type": "inject",
        "z": "4facfd665af09b5c",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "30 13 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "50",
        "payloadType": "num",
        "x": 230,
        "y": 380,
        "wires": [
            [
                "7175dcf7eb049e02",
                "73b4c25080650ffa"
            ]
        ]
    },
    {
        "id": "5587286aa4f55e27",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "Forecast +time stamp",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 900,
        "y": 500,
        "wires": []
    },
    {
        "id": "9b274fd00ce86099",
        "type": "inject",
        "z": "4facfd665af09b5c",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 17 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 250,
        "y": 520,
        "wires": [
            [
                "ab55402b3761d00b"
            ]
        ]
    },
    {
        "id": "296012c7a497194f",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Store forecast",
        "rules": [
            {
                "t": "set",
                "p": "forecast",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 720,
        "y": 580,
        "wires": [
            [
                "f67e2ea5cf93b877"
            ]
        ]
    },
    {
        "id": "f67e2ea5cf93b877",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "forecast storde",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 920,
        "y": 580,
        "wires": []
    },
    {
        "id": "b66066e0d1a4f825",
        "type": "victron-input-battery",
        "z": "4facfd665af09b5c",
        "service": "com.victronenergy.battery/512",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/512",
            "name": "Pylontech battery"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "name": "",
        "onlyChanges": false,
        "roundValues": "1",
        "x": 310,
        "y": 100,
        "wires": [
            [
                "a5f281eeacc305cd"
            ]
        ]
    },
    {
        "id": "528307f576da9fb4",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie ĂĽber 25%? ",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "gt",
                "v": "25",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 670,
        "y": 220,
        "wires": [
            [
                "f68fde5ba7de8563"
            ],
            [
                "11b587b897f75e8e"
            ]
        ]
    },
    {
        "id": "6ea5113acf386767",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "SOC",
        "active": false,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 910,
        "y": 100,
        "wires": []
    },
    {
        "id": "a5f281eeacc305cd",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Store SOC",
        "rules": [
            {
                "t": "set",
                "p": "SOC",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 570,
        "y": 100,
        "wires": [
            [
                "6ea5113acf386767"
            ]
        ]
    },
    {
        "id": "c7023aa0c5da170c",
        "type": "function",
        "z": "4facfd665af09b5c",
        "name": "Extract  Forecast",
        "func": "var key1 = Object.keys(msg.payload.result)[1];\n\n\n\nvar outputValue = -99;\n\n outputValue = msg.payload.result[key1];\n\nmsg.payload = outputValue;\n\nreturn msg;",
        "outputs": 1,
        "timeout": "",
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 500,
        "y": 640,
        "wires": [
            [
                "227921d53d22acaa"
            ]
        ]
    },
    {
        "id": "227921d53d22acaa",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "forecast direct",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 920,
        "y": 640,
        "wires": []
    },
    {
        "id": "f68fde5ba7de8563",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "genug PV?",
        "property": "forecast",
        "propertyType": "flow",
        "rules": [
            {
                "t": "gt",
                "v": "21000",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 890,
        "y": 220,
        "wires": [
            [
                "94425ca6cc01d6a3",
                "f87ff9d6ba4663b9"
            ],
            []
        ]
    },
    {
        "id": "94425ca6cc01d6a3",
        "type": "victron-output-ess",
        "z": "4facfd665af09b5c",
        "service": "com.victronenergy.settings",
        "path": "/Settings/SystemSetup/MaxChargeCurrent",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/SystemSetup/MaxChargeCurrent",
            "type": "float",
            "name": "Charge current limit (A)",
            "writable": true
        },
        "initial": "",
        "name": "",
        "onlyChanges": false,
        "x": 1240,
        "y": 220,
        "wires": []
    },
    {
        "id": "7175dcf7eb049e02",
        "type": "victron-output-ess",
        "z": "4facfd665af09b5c",
        "service": "com.victronenergy.settings",
        "path": "/Settings/SystemSetup/MaxChargeCurrent",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/SystemSetup/MaxChargeCurrent",
            "type": "float",
            "name": "Charge current limit (A)",
            "writable": true
        },
        "initial": "",
        "name": "",
        "onlyChanges": false,
        "x": 700,
        "y": 380,
        "wires": []
    },
    {
        "id": "f87ff9d6ba4663b9",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 56",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1140,
        "y": 160,
        "wires": []
    },
    {
        "id": "73b4c25080650ffa",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 57",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 700,
        "y": 460,
        "wires": []
    },
    {
        "id": "5a2cda4de03ba0a4",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung DC Ladung",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 0.5",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 680,
        "y": 900,
        "wires": [
            [
                "013d28f303ca30d3"
            ]
        ]
    },
    {
        "id": "1ef8fee117f1522f",
        "type": "victron-input-solarcharger",
        "z": "4facfd665af09b5c",
        "service": "com.victronenergy.solarcharger/288",
        "path": "/Yield/Power",
        "serviceObj": {
            "service": "com.victronenergy.solarcharger/288",
            "name": "SmartSolar Charger MPPT 150/45 rev3"
        },
        "pathObj": {
            "path": "/Yield/Power",
            "type": "float",
            "name": "PV Power (W)"
        },
        "name": "Victron PV Leistung",
        "onlyChanges": true,
        "x": 250,
        "y": 900,
        "wires": [
            [
                "5a2cda4de03ba0a4",
                "a85b31a1fbcfd214",
                "166aaa7952b940f8"
            ]
        ]
    },
    {
        "id": "013d28f303ca30d3",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "pvLeistungVictron",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 940,
        "y": 900,
        "wires": [
            [
                "fbf85e188bd4e300"
            ]
        ]
    },
    {
        "id": "fbf85e188bd4e300",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 58",
        "active": false,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1200,
        "y": 900,
        "wires": []
    },
    {
        "id": "6a2fed301b2596c0",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "pvLeistungVictron",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 450,
        "y": 220,
        "wires": [
            [
                "528307f576da9fb4"
            ]
        ]
    },
    {
        "id": "ab55402b3761d00b",
        "type": "subflow:93f485839dfa27a8",
        "z": "4facfd665af09b5c",
        "name": "",
        "env": [
            {
                "name": "latitude",
                "value": "51.1873",
                "type": "num"
            },
            {
                "name": "longitude",
                "value": "9.2954",
                "type": "num"
            },
            {
                "name": "declination",
                "value": "25",
                "type": "num"
            },
            {
                "name": "azimuth",
                "value": "0",
                "type": "num"
            },
            {
                "name": "modules power",
                "value": "10",
                "type": "num"
            },
            {
                "name": "apikey",
                "type": "cred"
            },
            {
                "name": "watt",
                "value": "watthours/day",
                "type": "str"
            },
            {
                "name": "kwhoutput",
                "type": "bool",
                "value": "true"
            },
            {
                "name": "showtoday",
                "type": "bool",
                "value": "false"
            },
            {
                "name": "daystoforecast",
                "value": "1",
                "type": "str"
            }
        ],
        "x": 440,
        "y": 520,
        "wires": [
            [
                "c7023aa0c5da170c",
                "5587286aa4f55e27"
            ],
            []
        ]
    },
    {
        "id": "a85b31a1fbcfd214",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie unter 20%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "20",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 470,
        "y": 960,
        "wires": [
            [
                "640bad93103f0ad6"
            ],
            [
                "508b4e4b5af791d7"
            ]
        ]
    },
    {
        "id": "640bad93103f0ad6",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung max",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 50",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 840,
        "y": 960,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "508b4e4b5af791d7",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie zwischen 20 und 30%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "30",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 510,
        "y": 1020,
        "wires": [
            [
                "72574e23a6d45498"
            ],
            [
                "d1735a0904551708"
            ]
        ]
    },
    {
        "id": "72574e23a6d45498",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung 1.4 kW",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 28",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 1020,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "d1735a0904551708",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie zwischen 30 und 40%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "40",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 510,
        "y": 1080,
        "wires": [
            [
                "bc4a0d4c4b630d27"
            ],
            [
                "b0bb5f342793b1cf"
            ]
        ]
    },
    {
        "id": "bc4a0d4c4b630d27",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung 1.2 kW",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 24",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 1080,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "b0bb5f342793b1cf",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie zwischen 40 und 50%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "50",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 510,
        "y": 1140,
        "wires": [
            [
                "240354b586f5db6e"
            ],
            [
                "aacf4c4d9b340ddf"
            ]
        ]
    },
    {
        "id": "240354b586f5db6e",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung 1.0 kW",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 20",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 1140,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "aacf4c4d9b340ddf",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie zwischen 50 und 60%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "60",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 510,
        "y": 1200,
        "wires": [
            [
                "6f7317ca4876ad73"
            ],
            [
                "cf7760bca9b5f034"
            ]
        ]
    },
    {
        "id": "6f7317ca4876ad73",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung 0.8 kW",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 16",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 1200,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "cf7760bca9b5f034",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie zwischen 60 und 70%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "70",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 530,
        "y": 1260,
        "wires": [
            [
                "4d8b6d4a3d207fe7"
            ],
            [
                "cbfc8d98df2cb155"
            ]
        ]
    },
    {
        "id": "4d8b6d4a3d207fe7",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung 0.6 kW",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 12",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 1260,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "cbfc8d98df2cb155",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie zwischen 70 und 80%",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lte",
                "v": "80",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 530,
        "y": 1320,
        "wires": [
            [
                "7e67bf365aee928c"
            ],
            [
                "f6da5c99e347f928"
            ]
        ]
    },
    {
        "id": "7e67bf365aee928c",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung 0.4 kW",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 8",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 850,
        "y": 1320,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "f6da5c99e347f928",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung nur DC Ladung",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50 + 0.5",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 830,
        "y": 1380,
        "wires": [
            [
                "e389df69d34a81a2"
            ]
        ]
    },
    {
        "id": "f87bd121820c43d8",
        "type": "inject",
        "z": "4facfd665af09b5c",
        "name": "10 bis 13:00",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "*/1 10-12 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 250,
        "y": 320,
        "wires": [
            [
                "4d1199e0b9397afd"
            ]
        ]
    },
    {
        "id": "74333025fcc4d811",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "Batterie ĂĽber 25%? ",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "gt",
                "v": "25",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 670,
        "y": 300,
        "wires": [
            [
                "9172615c9a708c0b"
            ],
            []
        ]
    },
    {
        "id": "9172615c9a708c0b",
        "type": "switch",
        "z": "4facfd665af09b5c",
        "name": "genug PV?",
        "property": "forecast",
        "propertyType": "flow",
        "rules": [
            {
                "t": "gt",
                "v": "21000",
                "vt": "num"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 890,
        "y": 300,
        "wires": [
            [
                "a4996ca1d4354765",
                "f26385454ea50069"
            ],
            []
        ]
    },
    {
        "id": "a4996ca1d4354765",
        "type": "victron-output-ess",
        "z": "4facfd665af09b5c",
        "service": "com.victronenergy.settings",
        "path": "/Settings/SystemSetup/MaxChargeCurrent",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/SystemSetup/MaxChargeCurrent",
            "type": "float",
            "name": "Charge current limit (A)",
            "writable": true
        },
        "initial": "",
        "name": "",
        "onlyChanges": false,
        "x": 1240,
        "y": 320,
        "wires": []
    },
    {
        "id": "f26385454ea50069",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 59",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1140,
        "y": 280,
        "wires": []
    },
    {
        "id": "4d1199e0b9397afd",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "pvLeistungVictron10",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 430,
        "y": 300,
        "wires": [
            [
                "74333025fcc4d811"
            ]
        ]
    },
    {
        "id": "e389df69d34a81a2",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "pvLeistungVictron10",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1190,
        "y": 1020,
        "wires": [
            [
                "32fd511b97a315c9"
            ]
        ]
    },
    {
        "id": "32fd511b97a315c9",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 60",
        "active": false,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1420,
        "y": 1020,
        "wires": []
    },
    {
        "id": "e875ecd41745c2eb",
        "type": "inject",
        "z": "4facfd665af09b5c",
        "name": "9:30",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "30 09 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 230,
        "y": 280,
        "wires": [
            [
                "4d1199e0b9397afd"
            ]
        ]
    },
    {
        "id": "166aaa7952b940f8",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "Rechnung Multi Ladung max",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "msg.payload / 50",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 460,
        "y": 800,
        "wires": [
            [
                "c6a1962fc4d0b059"
            ]
        ]
    },
    {
        "id": "c6a1962fc4d0b059",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 61",
        "active": false,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 720,
        "y": 800,
        "wires": []
    },
    {
        "id": "11b587b897f75e8e",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "50",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 910,
        "y": 260,
        "wires": [
            [
                "94425ca6cc01d6a3"
            ]
        ]
    },
    {
        "id": "185d0e21b19eaab3",
        "type": "vrm-api",
        "z": "4facfd665af09b5c",
        "vrm": "808cbad6ef13f058",
        "name": "Solar forecast",
        "api_type": "installations",
        "idUser": "",
        "users": "installations",
        "idSite": "",
        "installations": "stats",
        "attribute": "solar_yield_forecast",
        "stats_interval": "days",
        "show_instance": false,
        "stats_start": "bod",
        "stats_end": "eod",
        "use_utc": false,
        "gps_start": "",
        "gps_end": "",
        "widgets": "SolarChargerSummary",
        "instance": "",
        "vrm_id": "",
        "country": "de",
        "b_max": "",
        "tb_max": "",
        "fb_max": "",
        "tg_max": "",
        "fg_max": "",
        "b_cycle_cost": "",
        "buy_price_formula": "",
        "sell_price_formula": "",
        "green_mode_on": "",
        "feed_in_possible": "",
        "feed_in_control_on": "",
        "b_goal_hour": "",
        "b_goal_SOC": "",
        "store_in_global_context": false,
        "verbose": false,
        "x": 540,
        "y": 740,
        "wires": [
            [
                "1787ef5c80e4db3f",
                "343cae6b723c8bd6"
            ]
        ]
    },
    {
        "id": "1787ef5c80e4db3f",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 62",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 940,
        "y": 800,
        "wires": []
    },
    {
        "id": "67522e0f9db0053d",
        "type": "inject",
        "z": "4facfd665af09b5c",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 04 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 250,
        "y": 740,
        "wires": [
            [
                "185d0e21b19eaab3"
            ]
        ]
    },
    {
        "id": "43f3934be93e341e",
        "type": "debug",
        "z": "4facfd665af09b5c",
        "name": "debug 63",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1020,
        "y": 740,
        "wires": []
    },
    {
        "id": "343cae6b723c8bd6",
        "type": "change",
        "z": "4facfd665af09b5c",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.totals.solar_yield_forecast",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 790,
        "y": 740,
        "wires": [
            [
                "43f3934be93e341e",
                "296012c7a497194f"
            ]
        ]
    },
    {
        "id": "808cbad6ef13f058",
        "type": "config-vrm-api",
        "name": ""
    }
]

Moin @Ruediger
wenn Du möchtest, dann würde ich Dir mit Github helfen. Da PM nicht geht, gerne per Mail an (redacted)

VG
Björn

Hallo Björn,
vielen Dank für die schnelle Antwort. Du kannst das script gerne nehmen und damit machen was du möchtest. Ich verstehe in den GitHubs relativ wenig. Ich wollte die Idee für die Regelung teilen, weil ich zum Teil die Skripte aus den GitHubs nicht mal geladen bekomme uns etwas in der Art eh nicht gefunden habe.

Zeit für echten Support hätte ich auch bei Kompetenz nicht.

viele GrĂĽsse

RĂĽdiger

I forgot something to add:

to get the VRM forecast you need a token, which you generate with this link:

https://vrm.victronenergy.com/access-tokens

you need to give a name for the token and get a long number only available once.

The name and the number are entered into the VRM node
sorry pictures are in German, but should not be so difficult.

image

image

and maybe a picture of all flows:

best regards

Ruediger

PN scheint bei mir nicht zu gehen als Neuling.

@Ruediger
Ich versuche mich auch an einer etwas netzdienlicheren Ladung meines Akkus mit einem Victron System. Rudimentär klappt das auch schon.
Mein Problem ist, dass ich von node red und Programmieren wenig bis keine Ahnung habe. Daher fehlt mir teilweise die Kenntnis über Zusammenhänge.

Aktuell scheitere ich an einer sinnvollen Ausgabe des Solar forcast dessen Einrichtung Du beschreibst. Ich habe das wie auf dem Screenshot zu sehen angelegt und auch den Token generiert und eingetragen. Aber was muss ich im Feld “Installation” eingeben, damit die Solar forcast Daten ausgegeben werden?

Hallo Frank,

Hier der Screen Shot, da hatte ich gehofft, dass das mit kopiert wird. Ich bin leider nicht viel besser als du mit NodeRed. Aber wenn ich es hinbekomme…
Funktioniert eigentlich der API link im Beitrag vor deinem?

Viele GrĂĽĂźe
RĂĽdiger

1 Like

:sweat_smile: Zwei Blinde suchen das Korn.

Also ich habe das nach Deiner Beschreibung und dem Link soweit zurecht gebastelt und es scheint zu funktionieren.

Ich hätte allerdings damit gerechnet, dass die Ausgabe im debug node der Zahl des mittleren nodes entspricht.

Vielleicht kann ein Wissender mir die nötige Änderung nennen, die dafür durchgeführt werden muss.

Forcast Flow

Lass dir die gesamte Ausgabe des Debug-Nodes mal im Debug-Fenster ausgeben, dann wirst du sehen, dass der VRM-API Node nicht nur eine Zahl, sondern ein ganzes Objekt liefert mit einem Array fĂĽr die Solar-Prognose jeder einzelnen Stunde als auch dem unter dem VRM-API Node angezeigten Total-Tagesertrag.

Du kannst dann beispielsweise mit einem Function-Node und javascript die einzelnen Teile rausholen, die du benötigst (Stundenwerte, Tagessumme, …).

1 Like

Dieser Function-Node liefert beispielsweise ein Array mit jeweils 90% der stĂĽndlich prognostizierten Werte:

image

Gibt sicher auch Wege ohne javascript, da ich aber aus der Hochsprachen-Programmierwelt komme, ist mir JS sympathischer als Verkettung unzähliger Nodes…

2 Likes

Und dieser Change-Node “Total” liefert dir die Gesamt-Tagessumme als Zahl:

2 Likes

Vielen Dank für die Erklärung und die Lösung. Das habe selbst ich verstanden (nicht die Java-Programmierung).

Ich habe noch einen function node danach eingefügt und schon habe ich den Tagesertrag ohne Nachkommastellen. Mein Akku ist groß genug (hoffe ich), um nicht mit stündlichen Erträgen rechnen zu müssen.
Der Plan ist ganz grob zwischen “PV-Ertrag reicht für einen Tag” und “PV-Ertrag reicht nicht für einen Tag” unterscheiden zu können. Da kommt es auf ein paar kWh mehr oder weniger nicht an.

1 Like

Hallo „grua“,

Was für uns „blinde“ immer das Problem mit den ausgeschriebenen Programmen ist, das man kaum etwas ändern kann, weil man nicht versteht, was mit den Zeilen gemeint ist.
Deswegen hab ich mein gebastel hier gepostet, nicht weil ich es für so genial halte, sondern weil ich selber immer nach solchen Ansätzen gesucht habe.
Danke auch für die verständliche Erklärung!

GruĂź
RĂĽdiger

1 Like

Update:

FĂĽr alle die es interessiert, hier ein kleines Update dessen, was ich inzwischen gemacht habe.

Anmerkung:
AkkuV: Maximale Akkuspannung
MaxA: Maximaler Akku Ladestrom

Erläuterung der Idee:

Dem Pareto-Prinzip folgend möchte ich mit überschaubarem Aufwand eine 80% Lösung schaffen.

Dieses Konzept ist auf meine Victron Anlage ausgelegt die nicht der Mehrheit der verbauten Anlagen entspricht. Ich habe Module in alle Himmelsrichtungen mit diversen Neigungswinkeln installiert. Kaum ein Modul ist ganztägig unverschattet, weshalb ich überwiegend mit Modulwechselrichtern und wenigen MPPT arbeite. Die gesamte Anlage hat aktuell rund 15kWp, soll aber noch um rund 5kWp in Südausrichtung erweitert werden. Daher sammle ich schon jetzt Daten um die 60% Regelung erfüllen zu können. Einen Mittagspeak wie bei klassischen Südanlagen gibt es aktuell nicht.

Grundsätzlich: Akkuschonung vor Netzschonung
Auf Grund finanzieller Nachteile (Wandlungsverluste) soll der Akku nicht in das Netz einspeisen.
Die Änderungen der Einstellungen erfolgen nicht genau zu den Stundenwechseln sondern zu “krummen” Uhrzeiten wodurch das Netz weniger belastet werden soll.
Die größten netzweiten Unterschiede zwischen Produktion und Bedarf gibt es Sonntags (und zum Teil an Feiertagen). Daher erfolgt eine komplette Vollladung des Akkus incl. Balancing am Sonntag. Zur Wochenmitte wird die maximale Akkuspannung von Tag zu Tag abgesenkt um den Akku nicht lange Zeiten voll geladen herumstehen zu lassen. Zum Wochenende wird sie täglich wieder angehoben. Je nach Jahreszeit und Wetter erreiche ich damit mindestens 1x pro Monat ein Balancing.

Im Normalfall werden nicht mehr als 6-10 kWh pro Tag in den Akku geladen.
Um den Mittagspeak zu reduzieren bleibt also nicht viel Kapazität. Diese wird zeitlich verteilt.

Für weitere Optimierungen im Laufe der Zeit wird schon jetzt der erwartete Tagesertrag in eine Variable (Solar forecast) geschrieben. Statistisch ist es so, dass der größte Teil des erwarteten Ertrages in den Mittagsstunden produziert wird, daher ist für mich eine stundenbasierte Prognose vorerst nicht das Ziel. Die Akkugröße puffert Ungenauigkeiten.

Erklärung des Flows:

Ganztägig wird die aktuelle Akkuspannung +0,15 in eine Variable geschrieben.
Der SOC wird ganztägig ausgelesen. Daraus wird der Ladestrom berechnet. Je niedriger der SOC ist, desto höher ist der Ladestrom. Dieser Wert wird in eine Variable (MaxA) geschrieben. Die Formel “output = 200 - (input * 1.9)” geht von einem maximalen Ladestrom von 200A (leicht mehr als die Anlage maximal leisten kan) bei 0% SOC so wie 10A bei 100% SOC aus.
Vor jeder Veränderung von MaxA oder AkkuV wird geprüft, ob Solar_forecast >= 18 kWh sein wird. Nur dann werden Änderungen vorgenommen.

Sonnenaufgang: Die Variable AkkuV wird ausgelesen (Spannung +0,15 bei Sonnenaufgang) und die maximale Ladespannung wird auf diesen Wert gesetzt damit der Akku nicht geladen wird.

07:00 PrĂĽfung ob Solar_forecast < 18 kWh ist. Falls ja wird AkkuV auf 52.0 und MaxA auf 100 gesetzt, damit alle solaren ĂśberschĂĽsse in den Akku flieĂźen. Denn oftmals ist es so, dass das Wetter nicht nur an einem Tag schlecht ist, sondern mehrere Tage. Daher muss der Akku ausreichend gefĂĽllt sein.

9:54 Die maximale Ladespannung wird auf 50V gesetzt wodurch der Akku mit DC-Ertrag bis 50V geladen wird.

10:49 Der Ladestrom wird von 0A auf 20A gesetzt, damit der Akku nun moderat auch mit AC-Ertrag geladen wird.

10:50 Akku Max. Ladespannung wird auf den Wert des Wochentages gesetzt

11:53 Max. Ladestrom wird auf den aktuellen errechneten Wert gesetzt

14:37 Max. Ladestrom wird auf 0A gesetzt, wodurch nur noch ĂĽber DC weiter geladen wird.

Unabhängig von der ganzen Regelung wird natürlich versucht die größeren Verbraucher (Waschmaschine, Wäschetrockner, Spülmaschine, E-Auto, etc.) möglichst zu Zeiten zu nutzen zu denen ausreichende Erträge vorhanden sind.

Im Großen und Ganzen funktioniert diese relativ simple Regelung sehr gut. Im Winterhalbjahr werde ich sie weiter optimieren und ergänzen. Aber die letzten Monate sehen im Grund genau so aus, wie ich mir das vorgestellt habe.

Danke noch mal an alle, die meine “dummen” Fragen beantwortet haben.

Die Grafiken zeigen den Akku SOC Verlauf der letzten 30 Tage so wie die Verteilung des solaren Ertrages an zwei beispielhaften (sonnigen) Tagen so wie im Detail am 30.06. incl. Uhrzeiten. Gut zu erkennen ist, dass der Akku ĂĽberwiegend in der Mittagszeit den solaren Ăśberschuss aufnimmt.

1 Like

Es gibt natürlich viele EEG Einspeiser welche genau umgekehrte Anforderungen haben. Die Anlage ist größer als der Netzanschluss erlaubt und man muß Energie ins Netz loskriegen damit sie nicht verlorengeht. Schliesslich kriegt man die ja auch vergütet.

Sowas wird also immer nur sehr individuell auf die Anlage zugeschnitten funktionieren. Das resultiert ja auch in den heftigen Diskussionen daß DESS “nichts taugt” oder immer was anderes macht als der Betreiber erwartet.

Trotzdem würde ich mir deinen Flow gerne näher anschauen und vielleicht sogar anpassen ausprobieren. Hast du den irgendwo gepostet? ->Export->JSON->compact->CopyToClipboard und dann hier im Forum in den spitzen Klammern über die Zwischenablage einfügen. Man sieht dann nur eine Zeile welche man umgekehrt wieder über die Zwischenablage in NodeRed laden kann. Etwa so:

[{"id":"a9b943e599c9cad0","type":"tab","label":"ESS Regler","disabled":false,"info":"","env":[]},{"id":"d70c6ae8f8689aed","type":"junction","z":"a9b943e599c9cad0","x":880,"y":1120,"wires":[["ef450c388bb4df0b"]]},{"id":"ef450c388bb4df0b","type":"victron-output-ess","z":"a9b943e599c9cad0","service":"com.victronenergy.settings","path":"/Settings/CGwacs/AcPowerSetPoint","serviceObj":{"service":"com.victronenergy.settings","name":"Venus settings"},"pathObj":{"path":"/Settings/CGwacs/AcPowerSetPoint","type":"integer","name":"Grid set-point (W)","writable":true},"name":"Grid Setpoint","onlyChanges":false,"x":1070,"y":40,"wires":[]},{"id":"d5a49e6bde3cc6bf","type":"ui_dropdown","z":"a9b943e599c9cad0","name":"","label":"DC Soll:","tooltip":"Batterieleistung","place":"Select option","group":"0dc5dc9a99723562","order":2,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"0 W","value":0,"type":"num"},{"label":"-300 W Entladen","value":-300,"type":"num"},{"label":"-1000 W Entladen","value":-1000,"type":"num"},{"label":"-3000 W Entladen","value":"-3000","type":"str"},{"label":"-5000 W Entladen","value":-5000,"type":"num"},{"label":"-10000 W Entladen","value":-10000,"type":"num"},{"label":"- 20000 W Entladen","value":-20000,"type":"num"},{"label":"1000 W Laden","value":1000,"type":"num"},{"label":"20000 W Laden","value":20000,"type":"num"},{"label":"30000 W Laden","value":30000,"type":"num"},{"label":"<- SOC Regler","value":"SOC","type":"str"},{"label":"AUS","value":"AUS","type":"str"}],"payload":"","topic":"payload","topicType":"msg","className":"","x":280,"y":120,"wires":[["b2860790cda5d80a"]]},{"id":"1697e791301d1907","type":"ui_gauge","z":"a9b943e599c9cad0","name":"Einspeiseleistung","group":"5d6aa5fa2cd38a95","order":1,"width":6,"height":4,"gtype":"gage","title":"AC Verbundnetz","label":"","format":"{{value/1000|number:2}} kW","min":"-40000","max":"40000","colors":["#00b500","#00b500","#ff0000"],"seg1":"0","seg2":"0","diff":true,"className":"","x":990,"y":1400,"wires":[]},{"id":"1ded428f283d8cf4","type":"function","z":"a9b943e599c9cad0","name":"Saldierer","func":"msg = {\"payload\"    : msg.payload[\"ACOut1\"]\n                    + msg.payload[\"ACOut2\"]\n                    + msg.payload[\"ACOut3\"]};\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":2020,"wires":[["b81f95b46078056f"]]},{"id":"f84c3c501c70cb93","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":290,"y":2020,"wires":[["1ded428f283d8cf4"]]},{"id":"afde26adeb41d4da","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/Soc","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/Soc","type":"float","name":"State of charge (%)"},"name":"SOC","onlyChanges":false,"x":270,"y":2320,"wires":[["e2451ebe927f8079","0ea82d1f0cbb4fc3"]]},{"id":"e8568a68c8024574","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/Power","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/Power","type":"float","name":"Power (W)"},"name":"ABB","onlyChanges":false,"roundValues":"0","x":670,"y":1380,"wires":[["1697e791301d1907","8dfb40f2e1497cf1"]]},{"id":"a6dc29149ed13004","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/4","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/4","name":"MPPT 450/200 HQ2323K64WU"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"WU","onlyChanges":false,"roundValues":"0","x":130,"y":680,"wires":[["e350e637feb7ac70"]]},{"id":"57012a8195d11374","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/7","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/7","name":"MPPT 450/200 HQ2449TERWT"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"WT","onlyChanges":false,"roundValues":"0","x":130,"y":740,"wires":[["e350e637feb7ac70"]]},{"id":"0253727604a432b4","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/0","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/0","name":"MPPT 450/200 HQ2222E9KGD"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"GD","onlyChanges":false,"roundValues":"0","x":130,"y":800,"wires":[["e350e637feb7ac70"]]},{"id":"79e39c0013e32222","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/2","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/2","name":"MPPT 450/200 HQ2225VM6MV"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"MV","onlyChanges":false,"roundValues":"0","x":130,"y":860,"wires":[["e350e637feb7ac70"]]},{"id":"2d7fc840a18b54d6","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/5","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/5","name":"MPPT 450/200 HQ2323DEAC3"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"C3","onlyChanges":false,"roundValues":"0","x":130,"y":920,"wires":[["e350e637feb7ac70"]]},{"id":"5896e14cfab92c16","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/1","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/1","name":"MPPT 450/200 HQ2222DADYE"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"YE","onlyChanges":false,"roundValues":"0","x":130,"y":980,"wires":[["e350e637feb7ac70"]]},{"id":"aed47f87528482e0","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/6","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/6","name":"MPPT 450/200 HQ2323J4WAY"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"AY","onlyChanges":false,"roundValues":"0","x":130,"y":1040,"wires":[["e350e637feb7ac70"]]},{"id":"417b3e861c74dcb4","type":"victron-input-solarcharger","z":"a9b943e599c9cad0","service":"com.victronenergy.solarcharger/3","path":"/Yield/Power","serviceObj":{"service":"com.victronenergy.solarcharger/3","name":"MPPT 450/200 HQ2225EUXVJ"},"pathObj":{"path":"/Yield/Power","type":"float","name":"PV Power (W)"},"name":"VJ","onlyChanges":false,"roundValues":"0","x":130,"y":1100,"wires":[["e350e637feb7ac70"]]},{"id":"e350e637feb7ac70","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"8","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":350,"y":880,"wires":[["65482bfabd800173"]]},{"id":"65482bfabd800173","type":"function","z":"a9b943e599c9cad0","name":"Summe","func":"msg.payload = (msg.payload[0] +msg.payload[1] +msg.payload[2] +msg.payload[3] +msg.payload[4] +msg.payload[5] +msg.payload[6] + msg.payload[7]);\nmsg.topic = \"PV\"\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":520,"y":880,"wires":[["364b69ac1a06fc63"]]},{"id":"364b69ac1a06fc63","type":"ui_gauge","z":"a9b943e599c9cad0","name":"Produktion","group":"c4b14b3c0e4dc051","order":1,"width":0,"height":0,"gtype":"gage","title":"PV Produktion","label":"","format":"{{value/1000|number:2}} kW","min":0,"max":"100000","colors":["#f9f06b","#f9f06b","#f9f06b"],"seg1":"","seg2":"","diff":false,"className":"","x":730,"y":880,"wires":[]},{"id":"7b8785b6933115dd","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/System/MinCellTemperature","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/System/MinCellTemperature","type":"float","name":"Minimum cell temperature (°C)"},"name":"TempMin","onlyChanges":false,"x":100,"y":2140,"wires":[["cbde0a8acb8836fc"]]},{"id":"44873050e3e48f38","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/System/MaxCellTemperature","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/System/MaxCellTemperature","type":"float","name":"Maximum cell temperature (°C)"},"name":"TempMax","onlyChanges":false,"x":100,"y":2200,"wires":[["cbde0a8acb8836fc"]]},{"id":"e585688fc8680981","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/Dc/0/Voltage","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/Dc/0/Voltage","type":"float","name":"Battery voltage (V)"},"name":"BatU","onlyChanges":false,"roundValues":"2","x":130,"y":560,"wires":[["8bddb05bdea488bf"]]},{"id":"9f31a3f044129593","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/System/MinCellVoltage","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/System/MinCellVoltage","type":"float","name":"System; minimum cell voltage (V DC)"},"name":"Umin","onlyChanges":false,"roundValues":"3","x":90,"y":2260,"wires":[["daa9e2aee5d7b866"]]},{"id":"02996a16fd3457ac","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/System/MaxCellVoltage","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/System/MaxCellVoltage","type":"float","name":"System; maximum cell voltage (V DC)"},"name":"Umax","onlyChanges":false,"roundValues":"3","x":90,"y":2320,"wires":[["daa9e2aee5d7b866"]]},{"id":"481ab12ccb8d1c05","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/Dc/0/Current","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/Dc/0/Current","type":"float","name":"Battery current (A)"},"name":"BatI","onlyChanges":false,"roundValues":"0","x":130,"y":500,"wires":[["8bddb05bdea488bf"]]},{"id":"38255e51e30ed44a","type":"victron-input-vebus","z":"a9b943e599c9cad0","service":"com.victronenergy.vebus/276","path":"/Ac/Out/L1/P","serviceObj":{"service":"com.victronenergy.vebus/276","name":"MultiPlus-II 48/5000/70-50"},"pathObj":{"path":"/Ac/Out/L1/P","type":"float","name":"Output power phase 1 (W)"},"initial":"","name":"ACOut1","onlyChanges":false,"roundValues":"no","x":90,"y":1960,"wires":[["f84c3c501c70cb93","c9bfc45c7ec8a396"]]},{"id":"258c339843935b2a","type":"victron-input-vebus","z":"a9b943e599c9cad0","service":"com.victronenergy.vebus/276","path":"/Ac/Out/L2/P","serviceObj":{"service":"com.victronenergy.vebus/276","name":"MultiPlus-II 48/5000/70-50"},"pathObj":{"path":"/Ac/Out/L2/P","type":"float","name":"Output power phase 2 (W)"},"initial":"","name":"ACOut2","onlyChanges":false,"roundValues":"no","x":90,"y":2020,"wires":[["f84c3c501c70cb93","ea026ffe533ac85c"]]},{"id":"4a5e87ac6f71b490","type":"victron-input-vebus","z":"a9b943e599c9cad0","service":"com.victronenergy.vebus/276","path":"/Ac/Out/L3/P","serviceObj":{"service":"com.victronenergy.vebus/276","name":"MultiPlus-II 48/5000/70-50"},"pathObj":{"path":"/Ac/Out/L3/P","type":"float","name":"Output power phase 3 (W)"},"initial":"","name":"ACOut3","onlyChanges":false,"roundValues":"no","x":90,"y":2080,"wires":[["f84c3c501c70cb93","dfeb5503f247a2e7"]]},{"id":"08dadb77cdc2e2cf","type":"victron-input-system","z":"a9b943e599c9cad0","service":"com.victronenergy.system/0","path":"/Dc/System/Power","serviceObj":{"service":"com.victronenergy.system/0","name":"Venus system"},"pathObj":{"path":"/Dc/System/Power","type":"float","name":"DC System (W)"},"name":"DC Last","onlyChanges":false,"roundValues":"0","x":400,"y":1960,"wires":[["8ca1d9d20f1dd6f6"]]},{"id":"7604d1f73b8af871","type":"victron-input-digitalinput","z":"a9b943e599c9cad0","service":"com.victronenergy.digitalinput/4","path":"/State","serviceObj":{"service":"com.victronenergy.digitalinput/4","name":"RSE100%"},"pathObj":{"path":"/State","type":"enum","name":"Digital input state","enum":{"0":"low","1":"high","2":"off","3":"on","4":"no","5":"yes","6":"open","7":"closed","8":"ok","9":"alarm","10":"running","11":"stopped"}},"initial":"","name":"RSE100","onlyChanges":false,"x":100,"y":1660,"wires":[["af8add4a6fa313e8"]]},{"id":"cab1c2e999165952","type":"victron-input-digitalinput","z":"a9b943e599c9cad0","service":"com.victronenergy.digitalinput/3","path":"/State","serviceObj":{"service":"com.victronenergy.digitalinput/3","name":"RSE60%"},"pathObj":{"path":"/State","type":"enum","name":"Digital input state","enum":{"0":"low","1":"high","2":"off","3":"on","4":"no","5":"yes","6":"open","7":"closed","8":"ok","9":"alarm","10":"running","11":"stopped"}},"initial":"","name":"RSE60","onlyChanges":false,"x":90,"y":1720,"wires":[["af8add4a6fa313e8"]]},{"id":"7c37412b8b4e3e36","type":"victron-input-digitalinput","z":"a9b943e599c9cad0","service":"com.victronenergy.digitalinput/2","path":"/State","serviceObj":{"service":"com.victronenergy.digitalinput/2","name":"RSE30%"},"pathObj":{"path":"/State","type":"enum","name":"Digital input state","enum":{"0":"low","1":"high","2":"off","3":"on","4":"no","5":"yes","6":"open","7":"closed","8":"ok","9":"alarm","10":"running","11":"stopped"}},"initial":"","name":"RSE30","onlyChanges":false,"x":90,"y":1780,"wires":[["af8add4a6fa313e8"]]},{"id":"d1130c95dbc5935f","type":"victron-input-digitalinput","z":"a9b943e599c9cad0","service":"com.victronenergy.digitalinput/1","path":"/State","serviceObj":{"service":"com.victronenergy.digitalinput/1","name":"RSE0%"},"pathObj":{"path":"/State","type":"enum","name":"Digital input state","enum":{"0":"low","1":"high","2":"off","3":"on","4":"no","5":"yes","6":"open","7":"closed","8":"ok","9":"alarm","10":"running","11":"stopped"}},"initial":"","name":"RSE0","onlyChanges":false,"x":90,"y":1840,"wires":[["af8add4a6fa313e8"]]},{"id":"a3d90b49894e3281","type":"function","z":"a9b943e599c9cad0","name":"MaxFeedIn","func":"const PVMAX = 35000\n\nif (msg.payload [\"RSE60\"  ]  == 3 )  msg = {\"payload\" : Math.round (PVMAX * 0.6) };\nif (msg.payload [\"RSE30\"  ]  == 3 )  msg = {\"payload\" : Math.round (PVMAX * 0.3) };\nif (msg.payload [\"RSE0\"   ]  == 3 )  msg = {\"payload\" : 0};\nif (msg.payload [\"RSE100\" ]  == 3 )  msg = {\"payload\" : PVMAX};\n\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":1760,"wires":[[]]},{"id":"bb61718a38a11e63","type":"victron-output-ess","z":"a9b943e599c9cad0","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},"initial":"","name":"","onlyChanges":true,"x":1060,"y":1260,"wires":[]},{"id":"b2275b1a7f6afb48","type":"function","z":"a9b943e599c9cad0","name":"RSE_Texte","func":"const PVMAX = 35000\n\nif (msg.payload [\"RSE60\"  ]  == 3 )  msg = {\"payload\" : \"60%\" };\nif (msg.payload [\"RSE30\"  ]  == 3 )  msg = {\"payload\" : \"30%\" };\nif (msg.payload [\"RSE0\"   ]  == 3 )  msg = {\"payload\" : \"0%\"  };\n\n//if (msg.payload [\"RSE100\" ]  == 3 )  msg = {\"payload\" : \"100%\"};\nelse  msg = {\"payload\" : \"100%\"};\n\nreturn msg;","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":1720,"wires":[["b0334b8d44bd0aff"]]},{"id":"eb2930e347521e17","type":"function","z":"a9b943e599c9cad0","name":"DC Regler","func":"//msg.out = Manipulated Value is grid setpoint, Stellgroesse ist Grid Setpoint\n//flow.sv = Setpoint Value, Sollwert ist gewuenschte Batterie Entladeleistung\n//flow.pv = Process Value, Ist wert ist der aktuelle Batterie Entladeleistung\n\nconst Kp = 0.25;                                     // proportional parameter\nconst Ki = 0.28;                                    // integraion parameter\nconst Kd = 0;                                       // differential parameter\n\nlet error = (flow.get(\"pv2\") - flow.get(\"sv2\"));    // difference between setpoint value and process value\nmsg.errsum += error;                                // integral difference\n\nif (msg.errsum > 120000) msg.errsum =  120000;       // Integral Lock\nif (msg.errsum < -120000) msg.errsum = -120000;       // Integral Lock\n\nmsg.out =   (Kp * error)+ (Ki * msg.errsum);\n\n// + Kd * (error - msg.errold); // PID Regulator\n\nmsg.errold = error;                             // save Error for next cycle\nmsg.out = Math.round(msg.out)*-1 ;              // negative Einspeisung, positive Akkulast\n\nif (msg.out < -33000) msg.out = -33000;         // Stellwert obere Saettigung\nif (msg.out >   -333) msg.out =   -333;         // Stellwert untere Saettigung\n\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":1120,"wires":[["a7527499cb68a56e","6f84b4d6b5677b71","dfb574989bace016","ded6dad1df0a2670","34aba8523787aeed"]]},{"id":"a7527499cb68a56e","type":"delay","z":"a9b943e599c9cad0","name":"PT1","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":370,"y":1120,"wires":[["eb2930e347521e17"]]},{"id":"b298fdb9d94a8061","type":"inject","z":"a9b943e599c9cad0","name":"Reset","props":[{"p":"out","v":"3","vt":"num"},{"p":"errsum","v":"4","vt":"num"},{"p":"errold","v":"5","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","x":130,"y":280,"wires":[["0e364c3663ca9f0c"]]},{"id":"3e5846ff4ccb84b3","type":"inject","z":"a9b943e599c9cad0","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"-1000","payloadType":"num","x":110,"y":120,"wires":[["d5a49e6bde3cc6bf"]]},{"id":"af8add4a6fa313e8","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"8","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":290,"y":1740,"wires":[["a3d90b49894e3281","b2275b1a7f6afb48"]]},{"id":"31ea6f41d036355a","type":"ui_text","z":"a9b943e599c9cad0","group":"8dcf268406fa2d26","order":3,"width":0,"height":0,"name":"","label":"Balance:  ","format":"{{msg.payload.Umax + \" V - \" + msg.payload.Umin + \" V = \" + msg.payload.Udif + \" mV\"}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":540,"y":2260,"wires":[]},{"id":"daa9e2aee5d7b866","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":270,"y":2260,"wires":[["f3e1067e671b35ae"]]},{"id":"f3e1067e671b35ae","type":"function","z":"a9b943e599c9cad0","name":"CellDiff","func":"msg.payload.Udif = Math.round((msg.payload.Umax - msg.payload.Umin) * 1000);\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":2260,"wires":[["31ea6f41d036355a"]]},{"id":"cbde0a8acb8836fc","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":270,"y":2200,"wires":[["3b4344088be24336"]]},{"id":"3b4344088be24336","type":"ui_text","z":"a9b943e599c9cad0","group":"8dcf268406fa2d26","order":2,"width":0,"height":0,"name":"","label":"Temperaturen:","format":"{{msg.payload.TempMin + \" °C min, \" +msg.payload.TempMax +\" °C max\"}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":520,"y":2200,"wires":[]},{"id":"3ddfe2a8fb963944","type":"victron-input-battery","z":"a9b943e599c9cad0","service":"com.victronenergy.battery/512","path":"/Dc/0/Power","serviceObj":{"service":"com.victronenergy.battery/512","name":"Pylontech battery"},"pathObj":{"path":"/Dc/0/Power","type":"float","name":"Battery power (W)"},"name":"BatP","onlyChanges":false,"roundValues":"0","x":130,"y":620,"wires":[["8bddb05bdea488bf","4460263c695bd3ad","2a46186237dc1a13","fd9542f19250de83"]]},{"id":"8bddb05bdea488bf","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":330,"y":560,"wires":[["aeb69dab9276833a"]]},{"id":"aeb69dab9276833a","type":"ui_text","z":"a9b943e599c9cad0","group":"c4b14b3c0e4dc051","order":2,"width":0,"height":0,"name":"","label":"DC Ist:  ","format":"{{msg.payload.BatU + \" V * \" + msg.payload.BatI + \" A = \" + msg.payload.BatP + \" W\"}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":530,"y":520,"wires":[]},{"id":"b81f95b46078056f","type":"ui_gauge","z":"a9b943e599c9cad0","name":"AC Last","group":"b7a9ced364d46a19","order":1,"width":0,"height":0,"gtype":"gage","title":"Verbrauch","label":"","format":"{{value/1000|number:2}} kW","min":0,"max":"5000","colors":["#ca3838","#ca3838","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":580,"y":2020,"wires":[]},{"id":"8ca1d9d20f1dd6f6","type":"ui_text","z":"a9b943e599c9cad0","group":"b7a9ced364d46a19","order":3,"width":0,"height":0,"name":"","label":"DC Last:  ","format":"{{msg.payload + \" W \"}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":580,"y":1960,"wires":[]},{"id":"897296d5712f02df","type":"ui_text","z":"a9b943e599c9cad0","group":"5d6aa5fa2cd38a95","order":2,"width":0,"height":0,"name":"Uhr","label":"","format":"{{msg.payload}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":510,"y":1280,"wires":[]},{"id":"1b2c257e019bf28d","type":"function","z":"a9b943e599c9cad0","name":"Zeitformat","func":"var d = new Date();\nvar dow = [\"Sonntag\",\"Montag\",\"Dienstag\",\"Mittwoch\",\"Donnerstag\",\"Freitag\",\"Samstag\"][d.getDay()];\nvar mon = [\"Januar\",\"Februar\",\"März\",\"April\",\"Mai\",\"Juni\",\"Juli\",\"Aug\",\"Sept\",\"Okt\",\"Nov\",\"Dez\"][d.getMonth()];\n\nvar y = d.getFullYear();\nvar t = d.getDate();\nvar h = d.getHours()   < 10 ? \"0\"+d.getHours()   : d.getHours();\nvar m = d.getMinutes() < 10 ? \"0\"+d.getMinutes() : d.getMinutes();\nvar ss= d.getSeconds() < 10 ? \"0\"+d.getSeconds() : d.getSeconds();\n\nmsg = {payload: dow+\", den \"+t+\". \"+mon+\" \"+y+\" , \"+h+\":\"+m+\":\"+ss};\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":1280,"wires":[["897296d5712f02df"]]},{"id":"07d951702a3cc0a1","type":"inject","z":"a9b943e599c9cad0","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":170,"y":1280,"wires":[["1b2c257e019bf28d"]]},{"id":"b1b08923f3fe0190","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"4","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"num","reduceFixup":"","x":290,"y":2520,"wires":[["86b93defa3e2a077"]]},{"id":"f60edbfe6c569662","type":"victron-input-vebus","z":"a9b943e599c9cad0","service":"com.victronenergy.vebus/276","path":"/Ac/ActiveIn/L1/V","serviceObj":{"service":"com.victronenergy.vebus/276","name":"MultiPlus-II 48/5000/70-50"},"pathObj":{"path":"/Ac/ActiveIn/L1/V","type":"float","name":"Input voltage phase 1 (VAC)"},"initial":"","name":"ACIn1","onlyChanges":false,"roundValues":"0","x":90,"y":2460,"wires":[["b1b08923f3fe0190"]]},{"id":"b8d73e25d0d2f0f0","type":"victron-input-vebus","z":"a9b943e599c9cad0","service":"com.victronenergy.vebus/276","path":"/Ac/ActiveIn/L2/V","serviceObj":{"service":"com.victronenergy.vebus/276","name":"MultiPlus-II 48/5000/70-50"},"pathObj":{"path":"/Ac/ActiveIn/L2/V","type":"float","name":"Input voltage phase 2 (VAC)"},"initial":"","name":"ACIn2","onlyChanges":false,"roundValues":"0","x":90,"y":2520,"wires":[["b1b08923f3fe0190"]]},{"id":"2c9449d035a599ab","type":"victron-input-vebus","z":"a9b943e599c9cad0","service":"com.victronenergy.vebus/276","path":"/Ac/ActiveIn/L3/V","serviceObj":{"service":"com.victronenergy.vebus/276","name":"MultiPlus-II 48/5000/70-50"},"pathObj":{"path":"/Ac/ActiveIn/L3/V","type":"float","name":"Input voltage phase 3 (VAC)"},"initial":"","name":"ACIn3","onlyChanges":false,"roundValues":"0","x":90,"y":2580,"wires":[["b1b08923f3fe0190"]]},{"id":"86b93defa3e2a077","type":"ui_text","z":"a9b943e599c9cad0","group":"5d6aa5fa2cd38a95","order":4,"width":0,"height":0,"name":"","label":"U1,2,3","format":"{{msg.payload.ACIn1 + \" V, \" + msg.payload.ACIn2 + \" V, \" + msg.payload.ACIn3 + \" V, \" + msg.payload.Freq + \" Hz\"}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":530,"y":2520,"wires":[]},{"id":"142df31f555ea19f","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/Frequency","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/Frequency","type":"float","name":"Frequency (Hz)"},"name":"Freq","onlyChanges":false,"roundValues":"no","x":90,"y":2400,"wires":[["b1b08923f3fe0190"]]},{"id":"b2860790cda5d80a","type":"function","z":"a9b943e599c9cad0","name":"Manuell DC","func":"if (msg.payload == \"AUS\")               // DC Vorgabe ist AUS \n    {\n        return [null, null,null];       // dann nichts machen\n    }\n\nelse\n    {\n        if (msg.payload ==\"SOC\")           // DC Vorgabe kommt von SOC Regler\n        {\n            flow.set (\"SOC_Enable\",\"SOC\");              // SOC Regler einschalten\n            flow.set (\"DC_Enable\",\"PID\");               // DC Regler einschalten\n            return [{\"payload\" : \"PID\"},null,null];     \n        }\n    \n        else                                        // es wurde ein DC Wert ausgewaehlt\n        {\n            flow.set (\"sv2\", msg.payload);          // DC Sollwert fuer Regler global propagieren\n            flow.set (\"SOC_Enable\",\"AUS\");          // SOC Regler ausschalten\n            flow.set (\"DC_Enable\",\"PID\");           // Regler einschalten, AC=PID, SOC=AUS\n            return [{\"payload\" : \"PID\"},msg,{\"payload\" : \"AUS\"}];       \n        }\n    }\n","outputs":3,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":120,"wires":[["6d648dea716d6e13"],["0e1db94d77a56d59","a0dde08e60145d4e"],["9ac15c9b80d835b3"]]},{"id":"6c9f70ec752d977e","type":"ui_text","z":"a9b943e599c9cad0","group":"5d6aa5fa2cd38a95","order":3,"width":0,"height":0,"name":"","label":"AC Soll","format":"{{msg.payload /1000 | number:2}} kW","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":520,"y":2580,"wires":[]},{"id":"6f84b4d6b5677b71","type":"ui_text","z":"a9b943e599c9cad0","group":"c4b14b3c0e4dc051","order":4,"width":0,"height":0,"name":"","label":"Fehler","format":"{{msg.errold}} W","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":730,"y":1200,"wires":[]},{"id":"4460263c695bd3ad","type":"function","z":"a9b943e599c9cad0","name":"IstWert pv2","func":"flow.set(\"pv2\", msg.payload);       // Istwert an DC Regler weitergeben\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":680,"wires":[[]]},{"id":"dfb574989bace016","type":"ui_text","z":"a9b943e599c9cad0","group":"c4b14b3c0e4dc051","order":5,"width":0,"height":0,"name":"","label":"Integral","format":"{{msg.errsum}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":740,"y":1240,"wires":[]},{"id":"e2451ebe927f8079","type":"ui_gauge","z":"a9b943e599c9cad0","name":"Batterie","group":"8dcf268406fa2d26","order":1,"width":0,"height":0,"gtype":"donut","title":"DC Batterie","label":"","format":"{{value |number:1}} %","min":0,"max":"100","colors":["#ff7800","#3584e4","#f9f06b"],"seg1":"10","seg2":"90","diff":false,"className":"","x":540,"y":2320,"wires":[]},{"id":"b0334b8d44bd0aff","type":"ui_text","z":"a9b943e599c9cad0","group":"5d6aa5fa2cd38a95","order":5,"width":0,"height":0,"name":"RSE Anzeige","label":"RSE","format":"{{msg.payload}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":630,"y":1720,"wires":[]},{"id":"0e1db94d77a56d59","type":"ui_text","z":"a9b943e599c9cad0","group":"c4b14b3c0e4dc051","order":3,"width":0,"height":0,"name":"","label":"DC Soll","format":"{{msg.payload}} W","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":880,"y":120,"wires":[]},{"id":"6d648dea716d6e13","type":"ui_dropdown","z":"a9b943e599c9cad0","name":"","label":"AC Soll:","tooltip":"Netzeinspeisung","place":"Select option","group":"0dc5dc9a99723562","order":1,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"-321 W","value":-321,"type":"num"},{"label":"-1000 W","value":-1000,"type":"num"},{"label":"-3000 W","value":-3000,"type":"num"},{"label":"-5000 W","value":-5000,"type":"num"},{"label":"-10000 W","value":-10000,"type":"num"},{"label":"-20000 W","value":-20000,"type":"num"},{"label":"-30000 W","value":-30000,"type":"num"},{"label":"<- DC Regler","value":"PID","type":"str"},{"label":"FSM Festwert","value":"FSM","type":"str"}],"payload":"","topic":"payload","topicType":"msg","className":"","x":280,"y":40,"wires":[["225f69de1b754d41"]]},{"id":"ba20f137a45ceb48","type":"inject","z":"a9b943e599c9cad0","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","payload":"PID","payloadType":"str","x":110,"y":40,"wires":[["6d648dea716d6e13"]]},{"id":"9ac15c9b80d835b3","type":"ui_dropdown","z":"a9b943e599c9cad0","name":"","label":"SOC Soll:","tooltip":"Netzeinspeisung","place":"Select option","group":"0dc5dc9a99723562","order":3,"width":0,"height":0,"passthru":true,"multiple":false,"options":[{"label":"6%","value":6,"type":"num"},{"label":"12%","value":12,"type":"num"},{"label":"55%","value":55,"type":"num"},{"label":"88%","value":88,"type":"num"},{"label":"100%","value":100,"type":"num"},{"label":"FSM","value":"FSM","type":"str"},{"label":"AUS","value":"AUS","type":"str"}],"payload":"","topic":"payload","topicType":"msg","className":"","x":280,"y":200,"wires":[["67abfbd3d0b9c3ba"]]},{"id":"225f69de1b754d41","type":"function","z":"a9b943e599c9cad0","name":"Manuell AC","func":"flow.set (\"DC_Enable\",msg.payload);    // Schalterstellung an DC Regler melden\n\nif (msg.payload == \"PID\")         // PID oder FSM ist PID geregelter DC Betrieb\n   {                            \n    return [null, null];             // dazu sonst nichts verstellen\n   }\nelse                                    // sonst manuellen Einstellwert als Grid Setpoint\n    {\n    return [msg,{\"payload\" : \"AUS\"}];   // dabei DC Schalter auf AUS setzen\n    }\n","outputs":2,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":40,"wires":[["ef450c388bb4df0b"],["d5a49e6bde3cc6bf","9ac15c9b80d835b3"]]},{"id":"34aba8523787aeed","type":"function","z":"a9b943e599c9cad0","name":"PID Enable","func":"if (flow.get (\"DC_Enable\") == \"PID\")\n{\n    node.status({text:\"PID Enable\"});\n    msg.payload = msg.out;              // Regler Ausgang als Grid Setpoint\n    return msg;                         // zurueckgeben\n}\nelse\n{\n node.status({text:\"PID Disable\"});   \n return (null);                         // sonst kein Grid Setpoint retour                         \n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":1120,"wires":[["3209d24fc858bae5","d70c6ae8f8689aed"]]},{"id":"634f1240427c49a3","type":"victron-input-ess","z":"a9b943e599c9cad0","service":"com.victronenergy.settings","path":"/Settings/CGwacs/AcPowerSetPoint","serviceObj":{"service":"com.victronenergy.settings","name":"Venus settings"},"pathObj":{"path":"/Settings/CGwacs/AcPowerSetPoint","type":"integer","name":"Grid set-point (W)"},"name":"GridSetpoint","onlyChanges":false,"x":310,"y":2580,"wires":[["6c9f70ec752d977e"]]},{"id":"ded6dad1df0a2670","type":"ui_text","z":"a9b943e599c9cad0","group":"c4b14b3c0e4dc051","order":5,"width":0,"height":0,"name":"","label":"Y","format":"{{msg.out}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":730,"y":1280,"wires":[]},{"id":"7e74a581b429a099","type":"comment","z":"a9b943e599c9cad0","name":"Messwerte Verbundnetz","info":"","x":340,"y":2460,"wires":[]},{"id":"909288de3d58b416","type":"comment","z":"a9b943e599c9cad0","name":"Messwerte Batterie","info":"","x":350,"y":500,"wires":[]},{"id":"bb5713a307de7f27","type":"comment","z":"a9b943e599c9cad0","name":"Messwerte Eigenverbrauch","info":"","x":270,"y":1900,"wires":[]},{"id":"c2366c73a48e200f","type":"comment","z":"a9b943e599c9cad0","name":"VNB Leistungsbegrenzung","info":"","x":370,"y":1660,"wires":[]},{"id":"c311a7d115ab47e2","type":"comment","z":"a9b943e599c9cad0","name":"Messwerte PV Produktion","info":"","x":430,"y":780,"wires":[]},{"id":"156f70d110b88300","type":"comment","z":"a9b943e599c9cad0","name":"DC Leistungsregler","info":"","x":630,"y":1020,"wires":[]},{"id":"72cfcf9c97f04c79","type":"comment","z":"a9b943e599c9cad0","name":"Eingabewerte","info":"","x":90,"y":180,"wires":[]},{"id":"bb01e60598a1c2f0","type":"ui_text","z":"a9b943e599c9cad0","group":"8dcf268406fa2d26","order":3,"width":0,"height":0,"name":"","label":"SOC Soll","format":"{{msg.payload}} %","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":700,"y":200,"wires":[]},{"id":"67abfbd3d0b9c3ba","type":"function","z":"a9b943e599c9cad0","name":"Manuell SOC","func":"if (msg.payload == \"FSM\" || msg.payload == \"AUS\")   // Bei SOC Vorgabe von FSM oder \n   {                                                // SOC Vorgabe AUS\n    return [null, null];                    // wird hier nichts verstellt\n   }\nelse                                // es wurde ein SOC Wert manuell ausgewaehlt\n    {   \n        flow.set (\"sv1\", msg.payload);      // DC Sollwert fuer Regler global propagieren                               \n        flow.set (\"DC_Enable\",\"PID\");       // DC Regler einschalten, DC Soll kommt von SOC\n        flow.set (\"SOC_Enable\",\"SOC\");      // SOC Regler einschalten, Ausgang auf DC Regler\n        return [{\"payload\" : \"SOC\"},msg];\n    }\n\n","outputs":2,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":200,"wires":[["d5a49e6bde3cc6bf"],["bb01e60598a1c2f0"]]},{"id":"0e364c3663ca9f0c","type":"function","z":"a9b943e599c9cad0","name":"SOC Regler","func":"//msg.out = Manipulated Value is grid setpoint, Stellgroesse ist Grid Setpoint\n//flow.sv = Setpoint Value, Sollwert ist gewuenschte Batterie Entladeleistung\n//flow.pv = Process Value, Ist wert ist der aktuelle Batterie Entladeleistung\n\nconst Kp = 5000;                                    // proportional parameter\nconst Ki = 0;                                       // integraion parameter\nconst Kd = 0;                                       // differential parameter\n\nlet error = (flow.get(\"pv1\") - flow.get(\"sv1\"));    // difference between setpoint value and process value\nmsg.errsum += error;                                // integral difference\n\nmsg.out =   (Kp * error)+ (Ki * msg.errsum);        // Ausgangswert ist Batterie SOC\n\n// + Kd * (error - msg.errold); // PID Regulator\n\nmsg.errold = error;                             // save Error for next cycle\nmsg.out = Math.round(msg.out)*-1 ;\n\nif (msg.out < -20000) msg.out = -20000;        // Stellwert bottom saturation\nif (msg.out >  20000) msg.out =  20000;        // top saturation\n\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":320,"wires":[["a0dde08e60145d4e","7cf45a4e83241d4c","28a5fc2dc6998911"]]},{"id":"7cf45a4e83241d4c","type":"delay","z":"a9b943e599c9cad0","name":"PT1","pauseType":"delay","timeout":"10","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":130,"y":320,"wires":[["0e364c3663ca9f0c"]]},{"id":"a0dde08e60145d4e","type":"function","z":"a9b943e599c9cad0","name":"SOC Enable","func":"if (flow.get (\"SOC_Enable\") == \"SOC\")\n{\n    node.status({text:\"SOC Enable\"});\n    flow.set (\"sv2\" , msg.out);         // SOC Regler Ausgang an DC Regler Soll weitergeben\n    msg.payload = msg.out;              // Stellwert zur Anzeige weitergeben\n    return msg;\n}\nelse\n{\n node.status({text:\"SOC Disable\"});   \n return null;                         \n}\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":690,"y":240,"wires":[["0e1db94d77a56d59"]]},{"id":"4612b3f27829b0b8","type":"comment","z":"a9b943e599c9cad0","name":"Batterie SOC Regelung","info":"","x":320,"y":260,"wires":[]},{"id":"67417c1343c39888","type":"function","z":"a9b943e599c9cad0","name":"FSM","func":"// FSM implemented by switch / case using UTC system time for timers\n\n//let systic = Date.now();                // UTC in milliseconds for system clock\nvar d = new Date();                     // Datumsobjekt erstellen\n\nswitch (msg.state)\n{\n\n//**********************************************************************************\n//**\n//** Z0: Nachteinspeisung mit konstanter Leistung. Der Morgen beginnt nicht mit dem \n//** Sonnenaufgang, sondern mit dem typische erhöhten Strombedarf ab 5 Uhr\n\n  case 0:                               // Nachteinspeisung mit konstanter Leistung\n   if (d.getHours() >=5)                // warte bis zum Morgen 5:00 Uhr\n      {\n                                        // Einspeisung auf minimalen SOC umschalten \n        msg.state = 1;                  // Folgezustand Entladen am Morgen \n      }\n    break;\n\n//**********************************************************************************\n//**\n//** Z1: Entladen am Morgen. Die Batterie wird ueber den SOC Regler auf minimalen \n//** Ladezustand heruntergefahren. Nur so kann eine maximale Menge am anstehenden \n//** Produktionstag gespeichert werden. Bei erreichen des minimalen SOC, geht die \n//** Batterie auf Null Leistung. Dies dauert an, bis die Produktion die maximale\n//** Netzeinspeisung ueberschreitet. Der DC Regler geht in die Saettigung und es\n//** wird zwangsweise in die Batterie geladen. Erst um 14 Uhr wird geprueft, ob \n//** mit dem bisherigen Wetter ein Ladezustand von mindestens 50% erreicht wurde. \n//** Falls nicht, wird auf Ladebetrieb umgeschaltet. \n\n  case 1:                               // Zustand Entladen am Morgen\n    if (d.getHours() >= 14)             // ab 14 Uhr Ladebetrieb pruefen\n        {   \n            msg.state = 2;              // Folgezustand Laden tagsueber\n        }\n    break;\n\n//**********************************************************************************\n//**\n//** Z2: Laden am Nachmittag. Der Akku wird mit einer festen Leistung geladen.\n//** Der DC Regler zieht diese Leistung von der aktuellen Einspeiseleistung ab\n//** Der Abend beginnt mit erhoehtem Strombedarf ab 18 Uhr. Der aktuelle SOC wird \n//** dabei in 6 Stunden bis 0 Uhr auf 40% entladen \n \n  case 2:                               // Zustand Laden am Nachmittag\n  if (d.getHours() >= 18)               // Wenn PV Leistung zu klein wird\n        {\n            msg.state = 3;              // Folgezustand Teilentladen abends\n        }\n    break;\n\n//**********************************************************************************\n//**\n//** Z3: Teilentladen am Abend. Der aktuelle SOC wird dabei in 6 Stunden \n//** bis 0 Uhr auf 40% entladen. Danach beginnt die Nachtentladung mit 4 Stunden\n\n  case 3:                               // Zustand Teilentladen am Abend\n   if (d.getHours() == 0)               // Nachteinspeisung ab Datumsgrenze\n        {   \n            msg.state = 0;              // Folgezustand Nacht\n        }\n    break; \n}           \n\n// finally always display the most important FSM resources  state + time\n\nnode.status({text:\"State = \" + msg.state + \",\\\nh= \" + d.getHours() });               \n\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":1520,"wires":[["2cd496633dbac0ad","ef37107f8a62ff9d"]]},{"id":"122114297a8a195c","type":"inject","z":"a9b943e599c9cad0","name":"Startup","props":[{"p":"state","v":"0","vt":"num"},{"p":"timer","v":"0","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","x":160,"y":1480,"wires":[["67417c1343c39888"]]},{"id":"ef37107f8a62ff9d","type":"delay","z":"a9b943e599c9cad0","name":"FSM Cycle Time","pauseType":"delay","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":160,"y":1520,"wires":[["67417c1343c39888"]],"info":"Node Reds runtime will be blocked if using 100% of the available computing time for polling in the loops. Therefore we slowdown the loops to allow cooperative thread switching.\n\nFor 100mS delay in the FSM loop, timer resolution will be 100mS.\n"},{"id":"206ddf2c03ef56d9","type":"comment","z":"a9b943e599c9cad0","name":"Zustandsmaschine","info":"","x":190,"y":1420,"wires":[]},{"id":"0ea82d1f0cbb4fc3","type":"function","z":"a9b943e599c9cad0","name":"SOC Ist","func":"flow.set (\"pv1\", msg.payload);       //Primaerregler Process Value istwert SOC von Batterie\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":540,"y":2360,"wires":[[]]},{"id":"28a5fc2dc6998911","type":"ui_text","z":"a9b943e599c9cad0","group":"8dcf268406fa2d26","order":5,"width":0,"height":0,"name":"","label":"Y","format":"{{msg.out}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":690,"y":380,"wires":[]},{"id":"2cd496633dbac0ad","type":"function","z":"a9b943e599c9cad0","name":"StateNames","func":"\nswitch (msg.state)\n{\n    case 0: msg = {\"payload\" : \"Nachteinspeisung\"}; \n    break;\n\n    case 1: msg = {\"payload\" : \"Entladen am Morgen\"}; \n    break; \n\n    case 2: msg = {\"payload\" : \"Laden Nachmittags\"}; \n    break;\n    \n    case 3: msg = {\"payload\" : \"Teilentladen am Abend\"}; \n    break;\n    \n    default: msg = {\"payload\" : \"Fehler\"};\n}\n\nreturn msg;\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":1480,"wires":[["3109fdd2272f22d4"]]},{"id":"3109fdd2272f22d4","type":"ui_text","z":"a9b943e599c9cad0","group":"0dc5dc9a99723562","order":5,"width":0,"height":0,"name":"StateDisplay","label":"Zustand:","format":"{{msg.payload}}","layout":"row-spread","className":"","style":false,"font":"","fontSize":16,"color":"#000000","x":730,"y":1480,"wires":[]},{"id":"8dfb40f2e1497cf1","type":"function","z":"a9b943e599c9cad0","name":"Topic  AC_Ist","func":"msg.topic = \"AC_Ist\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":970,"y":1360,"wires":[[]]},{"id":"3209d24fc858bae5","type":"function","z":"a9b943e599c9cad0","name":"Topic AC_Soll","func":"msg.topic = \"AC_Soll\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":980,"y":1320,"wires":[[]]},{"id":"7506b2a8568a1289","type":"comment","z":"a9b943e599c9cad0","name":"Stromzähler","info":"","x":330,"y":1340,"wires":[]},{"id":"2a46186237dc1a13","type":"function","z":"a9b943e599c9cad0","name":"Topic  DC_Ist","func":"msg.topic = \"DC_Ist\";\nmsg.payload /= 1000;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":550,"y":640,"wires":[[]]},{"id":"fd9542f19250de83","type":"function","z":"a9b943e599c9cad0","name":"Topic DC_Soll","func":"msg.payload = flow.get (\"sv2\") /1000;\nmsg.topic = \"DC_Soll\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":600,"wires":[[]]},{"id":"32d894e9e67db03a","type":"inject","z":"a9b943e599c9cad0","name":"Reset","props":[{"p":"out","v":"3","vt":"num"},{"p":"errsum","v":"4","vt":"num"},{"p":"errold","v":"5","vt":"num"}],"repeat":"","crontab":"","once":true,"onceDelay":"0","topic":"","x":390,"y":1060,"wires":[["eb2930e347521e17"]]},{"id":"c9bfc45c7ec8a396","type":"function","z":"a9b943e599c9cad0","name":"Topic L1","func":"msg.topic = \"L1\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":2060,"wires":[["a4e84b8e9cad5585"]]},{"id":"ea026ffe533ac85c","type":"function","z":"a9b943e599c9cad0","name":"Topic L2","func":"msg.topic = \"L2\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":2100,"wires":[["a4e84b8e9cad5585"]]},{"id":"dfeb5503f247a2e7","type":"function","z":"a9b943e599c9cad0","name":"Topic L3","func":"msg.topic = \"L3\";\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":280,"y":2140,"wires":[["a4e84b8e9cad5585"]]},{"id":"a4e84b8e9cad5585","type":"ui_chart","z":"a9b943e599c9cad0","name":"Schieflast","group":"b7a9ced364d46a19","order":2,"width":0,"height":0,"label":"","chartType":"radar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":580,"y":2100,"wires":[[]]},{"id":"86be145731acd277","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/L1/Voltage","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/L1/Voltage","type":"float","name":"L1 Voltage (V)"},"name":"ABB","onlyChanges":false,"roundValues":"1","x":90,"y":2740,"wires":[["166d4941cbb3e356"]]},{"id":"2b35633c7f2eb11d","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/L1/Voltage","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/L1/Voltage","type":"float","name":"L1 Voltage (V)"},"name":"ABB","onlyChanges":false,"roundValues":"1","x":90,"y":2680,"wires":[["134e126146299568"]]},{"id":"915ba4a774f935f7","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/L3/Voltage","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/L3/Voltage","type":"float","name":"L3 Voltage (V)"},"name":"ABB","onlyChanges":false,"roundValues":"1","x":90,"y":2800,"wires":[["a8be76bfefbfd7ed"]]},{"id":"134e126146299568","type":"function","z":"a9b943e599c9cad0","name":"Topic  U1","func":"msg.topic = \"U1\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":2680,"wires":[["eb2dafdb92402a9d"]]},{"id":"166d4941cbb3e356","type":"function","z":"a9b943e599c9cad0","name":"Topic  U2","func":"msg.topic = \"U2\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":2740,"wires":[["eb2dafdb92402a9d"]]},{"id":"a8be76bfefbfd7ed","type":"function","z":"a9b943e599c9cad0","name":"Topic  U3","func":"msg.topic = \"U3\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":2800,"wires":[["eb2dafdb92402a9d"]]},{"id":"eb2dafdb92402a9d","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"5","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":410,"y":2740,"wires":[["8e20bf9ebf0d4e5e"]]},{"id":"8e20bf9ebf0d4e5e","type":"function","z":"a9b943e599c9cad0","name":"Zoom","func":"let values = Object.values(msg.payload);\nlet min = Math.min(...values);\nlet zoom = 4;\n\nmsg1 = {\"payload\" : msg.payload.U1 - min + zoom,\n        \"topic\" : \"U1\"};\n\nmsg2 = {\"payload\" : msg.payload.U2 - min + zoom,\n        \"topic\" : \"U2\"};\n\nmsg3 = {\"payload\" : msg.payload.U3 - min + zoom,\n        \"topic\" : \"U3\"};\n\nreturn [msg1,msg2,msg3];\n","outputs":3,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":2740,"wires":[["35b883d63aa31d4a"],["35b883d63aa31d4a"],["35b883d63aa31d4a"]]},{"id":"35b883d63aa31d4a","type":"ui_chart","z":"a9b943e599c9cad0","name":"","group":"5d6aa5fa2cd38a95","order":5,"width":0,"height":0,"label":"Spannungen","chartType":"radar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"5","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":690,"y":2740,"wires":[[]]},{"id":"0652000855be0f30","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/L2/Power","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/L2/Power","type":"float","name":"L2 Power (W)"},"name":"ABB","onlyChanges":false,"roundValues":"1","x":90,"y":2960,"wires":[["5534ad585b86ee4b"]]},{"id":"94c4d796add8034e","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/L1/Power","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/L1/Power","type":"float","name":"L1 Power (W)"},"name":"ABB","onlyChanges":false,"roundValues":"1","x":90,"y":2900,"wires":[["f8a2f40a2706347e"]]},{"id":"c537063f3192ce9c","type":"victron-input-gridmeter","z":"a9b943e599c9cad0","service":"com.victronenergy.grid/40","path":"/Ac/L3/Power","serviceObj":{"service":"com.victronenergy.grid/40","name":"eHZ18"},"pathObj":{"path":"/Ac/L3/Power","type":"float","name":"L3 Power (W)"},"name":"ABB","onlyChanges":false,"roundValues":"1","x":90,"y":3020,"wires":[["71def41ec179fd80"]]},{"id":"f8a2f40a2706347e","type":"function","z":"a9b943e599c9cad0","name":"Topic  P1","func":"msg.topic = \"P1\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":2900,"wires":[["7bb5ef9f2f847f5e"]]},{"id":"5534ad585b86ee4b","type":"function","z":"a9b943e599c9cad0","name":"Topic  P2","func":"msg.topic = \"P2\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":2960,"wires":[["7bb5ef9f2f847f5e"]]},{"id":"71def41ec179fd80","type":"function","z":"a9b943e599c9cad0","name":"Topic  P3","func":"msg.topic = \"P3\";\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":240,"y":3020,"wires":[["7bb5ef9f2f847f5e"]]},{"id":"7bb5ef9f2f847f5e","type":"join","z":"a9b943e599c9cad0","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"10","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":410,"y":2960,"wires":[["abd65f256a244796"]]},{"id":"abd65f256a244796","type":"function","z":"a9b943e599c9cad0","name":"Zoom","func":"msg1 = {\"payload\" : msg.payload.P1 *-1,\n        \"topic\" : \"P1\"};\n\nmsg2 = {\"payload\" : msg.payload.P2 *-1,\n        \"topic\" : \"P2\"};\n\nmsg3 = {\"payload\" : msg.payload.P3 *-1,\n        \"topic\" : \"P3\"};\n\nreturn [msg1,msg2,msg3];\n","outputs":3,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":530,"y":2960,"wires":[["a8b2a3444dfe5d43"],["a8b2a3444dfe5d43"],["a8b2a3444dfe5d43"]]},{"id":"a8b2a3444dfe5d43","type":"ui_chart","z":"a9b943e599c9cad0","name":"","group":"5d6aa5fa2cd38a95","order":5,"width":0,"height":0,"label":"Leistungen","chartType":"radar","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"5","removeOlderPoints":"","removeOlderUnit":"60","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":690,"y":2960,"wires":[[]]},{"id":"0dc5dc9a99723562","type":"ui_group","name":" ESS Regler","tab":"52c4a1be8450fe1a","order":5,"disp":true,"width":"6","collapse":false,"className":""},{"id":"5d6aa5fa2cd38a95","type":"ui_group","name":"Spalte1","tab":"52c4a1be8450fe1a","order":1,"disp":false,"width":6,"collapse":false,"className":""},{"id":"c4b14b3c0e4dc051","type":"ui_group","name":"Spalte3","tab":"52c4a1be8450fe1a","order":2,"disp":false,"width":"6","collapse":false,"className":""},{"id":"8dcf268406fa2d26","type":"ui_group","name":"Spalte2","tab":"52c4a1be8450fe1a","order":3,"disp":false,"width":"6","collapse":false,"className":""},{"id":"b7a9ced364d46a19","type":"ui_group","name":"Spalte4","tab":"52c4a1be8450fe1a","order":4,"disp":false,"width":"6","collapse":false,"className":""},{"id":"52c4a1be8450fe1a","type":"ui_tab","name":"Gottlieb-Daimler-Microgrid","icon":"dashboard","disabled":false,"hidden":false}]

Hallo Janvi,
Ich habe noch etwas fĂĽr den Abend gebaut.

  1. Check SOC ĂĽber 75%
  2. Check PV Prognose für den nächsten Tag Ausreichend, um meinen Verbrauch zu versorgen und den Speicher zu laden.
  3. Verbrauch kleiner 700 W (Ich habe nur einen Multiplus 3000)
    Wenn 1 bis 3 OK dann wird der Grid setpoint auf -500 gesetzt.
    Das ganze läuft zwischen 20.00 Uhr und 22:30 Uhr.
    Es werden also maximal 2,5 kWh eingespeist, wenn sie wirklich gebraucht werden.
    Am nächsten Tag ist dann Platz im Speicher für die Mittagsspitze.
    Meine Grundlast im Haus ist etwa 250 W. Der Multi arbeitet also nicht unter Vollladt. Wenn doch das Auto läd, oder jemand kocht, stoppt es.
    Man verliert natĂĽrlich die Speicherverluste als Einspeisung.
[
    {
        "id": "ac99470af6e84f17",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "Zeitpunkte festlegen",
        "rules": [
            {
                "t": "set",
                "p": "StartAbendeinspeisung",
                "pt": "flow",
                "to": "20:00",
                "tot": "str"
            },
            {
                "t": "set",
                "p": "EndeAbendeinspeisung",
                "pt": "flow",
                "to": "22:30",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 420,
        "y": 1300,
        "wires": [
            [
                "2f413808cc949009",
                "8bfcbb5e7b5c3baa"
            ]
        ],
        "icon": "node-red/alert.svg"
    },
    {
        "id": "db090b75d4c3780f",
        "type": "inject",
        "z": "119fd81c1ef113b4",
        "name": "Refresh täglich 4:00",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 04 * * *",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 160,
        "y": 1300,
        "wires": [
            [
                "ac99470af6e84f17"
            ]
        ]
    },
    {
        "id": "2f413808cc949009",
        "type": "function",
        "z": "119fd81c1ef113b4",
        "name": "StartZeit",
        "func": "var StartAbendeinspeisung = flow.get (\"StartAbendeinspeisung\");\n//var Startabendmin = flow.get (\"Startabendmin\");\n//var Startabendmin = $moment(StartAbendeinspeisung,'HH:mm').minute();\n//var Startabendh = $moment(StartAbendeinspeisung,'HH:mm').hour();\n//var Startabend = Number(Startabendh) * 60 + Number(Startabendmin);\n//flow.set('Startabend', Startabend);\nmsg.payload = StartAbendeinspeisung;\nnode.status({ fill: 'green', shape: 'dot', text: `${msg.payload} Uhr` });\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 720,
        "y": 1300,
        "wires": [
            []
        ]
    },
    {
        "id": "8bfcbb5e7b5c3baa",
        "type": "function",
        "z": "119fd81c1ef113b4",
        "name": "EndZeit",
        "func": "var EndeAbendeinspeisung = flow.get (\"EndeAbendeinspeisung\");\n\nmsg.payload = EndeAbendeinspeisung;\nnode.status({ fill: 'green', shape: 'dot', text: `${msg.payload} Uhr` });\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 860,
        "y": 1300,
        "wires": [
            []
        ]
    },
    {
        "id": "eff41bbdb50face3",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "Zeit fĂĽr Abendeinspeisung?",
        "rules": [
            {
                "t": "set",
                "p": "StartAbendeinspeisung",
                "pt": "msg",
                "to": "StartAbendeinspeisung",
                "tot": "flow"
            },
            {
                "t": "set",
                "p": "EndeAbendeinspeisung",
                "pt": "msg",
                "to": "EndeAbendeinspeisung",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 380,
        "y": 2160,
        "wires": [
            [
                "05c21610ad0b7ae6",
                "b9428aff82805705",
                "bb0b75ec389f80dd"
            ]
        ]
    },
    {
        "id": "05c21610ad0b7ae6",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "debug 78",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "StartAbendeinspeisung",
        "targetType": "msg",
        "statusVal": "StartAbendeinspeisung",
        "statusType": "auto",
        "x": 620,
        "y": 2160,
        "wires": []
    },
    {
        "id": "b9428aff82805705",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "debug 79",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "EndeAbendeinspeisung",
        "targetType": "msg",
        "statusVal": "EndeAbendeinspeisung",
        "statusType": "auto",
        "x": 780,
        "y": 2160,
        "wires": []
    },
    {
        "id": "bb0b75ec389f80dd",
        "type": "switch",
        "z": "119fd81c1ef113b4",
        "name": "",
        "property": "$moment()",
        "propertyType": "jsonata",
        "rules": [
            {
                "t": "btwn",
                "v": "$moment(StartAbendeinspeisung, 'HH:mm')",
                "vt": "jsonata",
                "v2": "$moment(EndeAbendeinspeisung, 'HH:mm')",
                "v2t": "jsonata"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 110,
        "y": 2240,
        "wires": [
            [
                "d0918ae342ba5afb"
            ],
            [
                "27f35e4a9171358e"
            ]
        ]
    },
    {
        "id": "1a0197c25982d812",
        "type": "inject",
        "z": "119fd81c1ef113b4",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "*/1 18-23 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 130,
        "y": 2160,
        "wires": [
            [
                "eff41bbdb50face3"
            ]
        ]
    },
    {
        "id": "1bffa949de82a4d9",
        "type": "comment",
        "z": "119fd81c1ef113b4",
        "name": "Abendeinspeisung",
        "info": "bei genĂĽgend SOC wird in den eingestelleten Zeiten Strom ins Netz eingespeist\n",
        "x": 130,
        "y": 1220,
        "wires": []
    },
    {
        "id": "b8d0050eb6be3b47",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "Verbrauch",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 1120,
        "y": 1880,
        "wires": [
            [
                "8c532aedb329c4e3"
            ]
        ]
    },
    {
        "id": "355ad5702f362c6b",
        "type": "rbe",
        "z": "119fd81c1ef113b4",
        "name": "",
        "func": "deadband",
        "gap": "100",
        "start": "",
        "inout": "out",
        "septopics": true,
        "property": "payload",
        "topi": "topic",
        "x": 910,
        "y": 1880,
        "wires": [
            [
                "b8d0050eb6be3b47"
            ]
        ]
    },
    {
        "id": "8c532aedb329c4e3",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "debug 81",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1040,
        "y": 1780,
        "wires": []
    },
    {
        "id": "941046ff9fe07e13",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "$sum(payload) Verbrauch",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "$sum(payload)",
                "tot": "jsonata"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 670,
        "y": 1880,
        "wires": [
            [
                "355ad5702f362c6b"
            ]
        ]
    },
    {
        "id": "f88f9c2beca81850",
        "type": "join",
        "z": "119fd81c1ef113b4",
        "name": "",
        "mode": "custom",
        "build": "array",
        "property": "payload",
        "propertyType": "msg",
        "key": "topic",
        "joiner": "\\n",
        "joinerType": "str",
        "accumulate": false,
        "timeout": "",
        "count": "3",
        "reduceRight": false,
        "reduceExp": "",
        "reduceInit": "",
        "reduceInitType": "",
        "reduceFixup": "",
        "x": 470,
        "y": 1880,
        "wires": [
            [
                "941046ff9fe07e13"
            ]
        ]
    },
    {
        "id": "5011418fa0f75e54",
        "type": "victron-input-system",
        "z": "119fd81c1ef113b4",
        "service": "com.victronenergy.system/0",
        "path": "/Ac/Consumption/L1/Power",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Ac/Consumption/L1/Power",
            "type": "float",
            "name": "AC Consumption L1 (W)"
        },
        "initial": "",
        "name": "",
        "onlyChanges": false,
        "roundValues": "0",
        "x": 190,
        "y": 1820,
        "wires": [
            [
                "f88f9c2beca81850"
            ]
        ]
    },
    {
        "id": "9465b9237745c7ec",
        "type": "victron-input-system",
        "z": "119fd81c1ef113b4",
        "service": "com.victronenergy.system/0",
        "path": "/Ac/Consumption/L2/Power",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Ac/Consumption/L2/Power",
            "type": "float",
            "name": "AC Consumption L2 (W)"
        },
        "initial": "",
        "name": "",
        "onlyChanges": false,
        "roundValues": "0",
        "x": 190,
        "y": 1880,
        "wires": [
            [
                "f88f9c2beca81850"
            ]
        ]
    },
    {
        "id": "93b0a4f0786d48d0",
        "type": "victron-input-system",
        "z": "119fd81c1ef113b4",
        "service": "com.victronenergy.system/0",
        "path": "/Ac/Consumption/L3/Power",
        "serviceObj": {
            "service": "com.victronenergy.system/0",
            "name": "Venus system"
        },
        "pathObj": {
            "path": "/Ac/Consumption/L3/Power",
            "type": "float",
            "name": "AC Consumption L3 (W)"
        },
        "initial": "",
        "name": "",
        "onlyChanges": false,
        "roundValues": "0",
        "x": 190,
        "y": 1960,
        "wires": [
            [
                "f88f9c2beca81850"
            ]
        ]
    },
    {
        "id": "e3288ff8f7283eb7",
        "type": "victron-input-ess",
        "z": "119fd81c1ef113b4",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/AcPowerSetPoint",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/AcPowerSetPoint",
            "type": "integer",
            "name": "Grid set-point (W)"
        },
        "name": "",
        "onlyChanges": true,
        "x": 180,
        "y": 2040,
        "wires": [
            [
                "131bd6686efc42e3"
            ]
        ]
    },
    {
        "id": "d613e614aede8f52",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "Gridsetpoint",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 880,
        "y": 2040,
        "wires": [
            [
                "7adc21156ea0cf36"
            ]
        ]
    },
    {
        "id": "7b639d41d9af3255",
        "type": "vrm-api",
        "z": "119fd81c1ef113b4",
        "vrm": "",
        "name": "Solar forecast",
        "api_type": "installations",
        "idUser": "",
        "users": "installations",
        "idSite": "",
        "installations": "stats",
        "attribute": "solar_yield_forecast",
        "stats_interval": "days",
        "show_instance": false,
        "stats_start": "bot",
        "stats_end": "86400",
        "use_utc": false,
        "gps_start": "",
        "gps_end": "",
        "widgets": "SolarChargerSummary",
        "instance": "",
        "vrm_id": "",
        "country": "de",
        "b_max": "",
        "tb_max": "",
        "fb_max": "",
        "tg_max": "",
        "fg_max": "",
        "b_cycle_cost": "",
        "buy_price_formula": "",
        "sell_price_formula": "",
        "green_mode_on": "",
        "feed_in_possible": "",
        "feed_in_control_on": "",
        "b_goal_hour": "",
        "b_goal_SOC": "",
        "store_in_global_context": false,
        "verbose": false,
        "x": 380,
        "y": 1660,
        "wires": [
            [
                "b0047f0e3a4c518d",
                "64e39cdef4b97fd8"
            ]
        ]
    },
    {
        "id": "b8940f183a3c555d",
        "type": "inject",
        "z": "119fd81c1ef113b4",
        "name": "refresch täglich 19:00 Uhr",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 19 * * *",
        "once": true,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 180,
        "y": 1460,
        "wires": [
            [
                "7b639d41d9af3255",
                "280a997fe06cbc32"
            ]
        ]
    },
    {
        "id": "b0047f0e3a4c518d",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "debug 82",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 660,
        "y": 1660,
        "wires": []
    },
    {
        "id": "64e39cdef4b97fd8",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "payload.totals.solar_yield_forecast",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 730,
        "y": 1600,
        "wires": [
            [
                "72c79e5f9206aca0"
            ]
        ]
    },
    {
        "id": "72c79e5f9206aca0",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "Store forecast",
        "rules": [
            {
                "t": "set",
                "p": "forecast_morgen",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 940,
        "y": 1600,
        "wires": [
            [
                "c78ecfe03fdb1556"
            ]
        ]
    },
    {
        "id": "c78ecfe03fdb1556",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "forecast_morgen",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1150,
        "y": 1600,
        "wires": []
    },
    {
        "id": "280a997fe06cbc32",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "Parameter festlegen",
        "rules": [
            {
                "t": "set",
                "p": "Netzsetpoint_Abend",
                "pt": "flow",
                "to": "-500",
                "tot": "num"
            },
            {
                "t": "set",
                "p": "AbendSOC",
                "pt": "flow",
                "to": "75",
                "tot": "num"
            },
            {
                "t": "set",
                "p": "MaxVerbrauch",
                "pt": "flow",
                "to": "700",
                "tot": "num"
            },
            {
                "t": "set",
                "p": "MinPVErtrag",
                "pt": "flow",
                "to": "45000",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 420,
        "y": 1460,
        "wires": [
            [
                "209378650fc978d6",
                "97eacce6af6dd3b8",
                "5758b7f649c474f7",
                "9bf4d7f1ec246110"
            ]
        ],
        "icon": "node-red/alert.svg"
    },
    {
        "id": "131bd6686efc42e3",
        "type": "switch",
        "z": "119fd81c1ef113b4",
        "name": "",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "btwn",
                "v": "100",
                "vt": "num",
                "v2": "-100",
                "v2t": "num"
            },
            {
                "t": "empty"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 430,
        "y": 2040,
        "wires": [
            [
                "d613e614aede8f52"
            ],
            [
                "05d33dd6c731cd24"
            ]
        ]
    },
    {
        "id": "7adc21156ea0cf36",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "debug 84",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1080,
        "y": 2040,
        "wires": []
    },
    {
        "id": "05d33dd6c731cd24",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "-20",
                "tot": "num"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 650,
        "y": 2080,
        "wires": [
            [
                "d613e614aede8f52"
            ]
        ]
    },
    {
        "id": "d0918ae342ba5afb",
        "type": "switch",
        "z": "119fd81c1ef113b4",
        "name": "Verbrauch?",
        "property": "Verbrauch",
        "propertyType": "flow",
        "rules": [
            {
                "t": "lt",
                "v": "MaxVerbrauch",
                "vt": "flow"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 330,
        "y": 2240,
        "wires": [
            [
                "e926c729327a959e"
            ],
            [
                "27f35e4a9171358e"
            ]
        ]
    },
    {
        "id": "27f35e4a9171358e",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "normaler Gridsetpoint",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Gridsetpoint",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 820,
        "y": 2320,
        "wires": [
            [
                "380b8e9171d3f21a",
                "44c52a95ec2070a4"
            ]
        ]
    },
    {
        "id": "e926c729327a959e",
        "type": "switch",
        "z": "119fd81c1ef113b4",
        "name": "PV morgen?",
        "property": "forecast_morgen",
        "propertyType": "flow",
        "rules": [
            {
                "t": "gt",
                "v": "MinPVErtrag",
                "vt": "flow"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 530,
        "y": 2240,
        "wires": [
            [
                "db4f7446473b7bba"
            ],
            [
                "27f35e4a9171358e"
            ]
        ]
    },
    {
        "id": "db4f7446473b7bba",
        "type": "switch",
        "z": "119fd81c1ef113b4",
        "name": "SOC?",
        "property": "SOC",
        "propertyType": "flow",
        "rules": [
            {
                "t": "gte",
                "v": "AbendSOC",
                "vt": "flow"
            },
            {
                "t": "else"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 690,
        "y": 2240,
        "wires": [
            [
                "69a2ce7551799cde"
            ],
            [
                "27f35e4a9171358e"
            ]
        ]
    },
    {
        "id": "380b8e9171d3f21a",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "debug 85",
        "active": true,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1100,
        "y": 2320,
        "wires": []
    },
    {
        "id": "44c52a95ec2070a4",
        "type": "victron-output-ess",
        "z": "119fd81c1ef113b4",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/AcPowerSetPoint",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/AcPowerSetPoint",
            "type": "integer",
            "name": "Grid set-point (W)",
            "writable": true
        },
        "name": "",
        "onlyChanges": false,
        "x": 1180,
        "y": 2240,
        "wires": []
    },
    {
        "id": "69a2ce7551799cde",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "Abendeinspeisung",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "Netzsetpoint_Abend",
                "tot": "flow"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 870,
        "y": 2240,
        "wires": [
            [
                "380b8e9171d3f21a",
                "44c52a95ec2070a4"
            ]
        ]
    },
    {
        "id": "209378650fc978d6",
        "type": "function",
        "z": "119fd81c1ef113b4",
        "name": "minimaler PV Ertrag",
        "func": "var MinPVErtrag = flow.get (\"MinPVErtrag\");\n\nmsg.payload = MinPVErtrag;\nnode.status({ fill: 'green', shape: 'dot', text: `${msg.payload} Wh` });\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 760,
        "y": 1360,
        "wires": [
            []
        ]
    },
    {
        "id": "5758b7f649c474f7",
        "type": "function",
        "z": "119fd81c1ef113b4",
        "name": "Setpoint Abendeinspeisung",
        "func": "var Netzsetpoint_Abend = flow.get (\"Netzsetpoint_Abend\");\n\nmsg.payload = Netzsetpoint_Abend;\nnode.status({ fill: 'green', shape: 'dot', text: `${msg.payload} W` });\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 780,
        "y": 1540,
        "wires": [
            []
        ]
    },
    {
        "id": "9bf4d7f1ec246110",
        "type": "function",
        "z": "119fd81c1ef113b4",
        "name": "MaxVerbrauch",
        "func": "var MaxVerbrauch = flow.get (\"MaxVerbrauch\");\n\nmsg.payload = MaxVerbrauch;\nnode.status({ fill: 'green', shape: 'dot', text: `${msg.payload} W` });\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 740,
        "y": 1420,
        "wires": [
            []
        ]
    },
    {
        "id": "97eacce6af6dd3b8",
        "type": "function",
        "z": "119fd81c1ef113b4",
        "name": "minimaler SOC fĂĽr Einspeisung",
        "func": "var AbendSOC = flow.get (\"AbendSOC\");\n\nmsg.payload = AbendSOC;\nnode.status({ fill: 'green', shape: 'dot', text: `${msg.payload} %` });\nreturn msg;",
        "outputs": 1,
        "timeout": 0,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 790,
        "y": 1480,
        "wires": [
            []
        ]
    },
    {
        "id": "5d3e8c4f2d46d9aa",
        "type": "victron-input-battery",
        "z": "119fd81c1ef113b4",
        "service": "com.victronenergy.battery/512",
        "path": "/Soc",
        "serviceObj": {
            "service": "com.victronenergy.battery/512",
            "name": "Pylontech battery"
        },
        "pathObj": {
            "path": "/Soc",
            "type": "float",
            "name": "State of charge (%)"
        },
        "name": "",
        "onlyChanges": false,
        "roundValues": "1",
        "x": 190,
        "y": 1740,
        "wires": [
            [
                "1ec6b4c1ebdef6e2"
            ]
        ]
    },
    {
        "id": "7ef50f8d49b54e07",
        "type": "debug",
        "z": "119fd81c1ef113b4",
        "name": "SOC",
        "active": false,
        "tosidebar": false,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 650,
        "y": 1740,
        "wires": []
    },
    {
        "id": "1ec6b4c1ebdef6e2",
        "type": "change",
        "z": "119fd81c1ef113b4",
        "name": "Store SOC",
        "rules": [
            {
                "t": "set",
                "p": "SOC",
                "pt": "flow",
                "to": "payload",
                "tot": "msg"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 450,
        "y": 1740,
        "wires": [
            [
                "7ef50f8d49b54e07"
            ]
        ]
    }
]

In den Flow unter !Zeitpunkte und !Parameter die Zeiten und die Analgenparameter eingeben. unter dem “Solar forecast” muss man seine Anlagen API wie oben beschrieben eingeben.

viel Spass

RĂĽdiger