Feed additional electricity from the battery into the grid at night

Hello everyone

I want to feed 1 kWh of electricity back into the grid every day from 8 p.m. to 11 p.m. and from

5 to 7 a.m.

In Red Node, this never works properly. The system does start, but then it doesn’t stop. Is there another way to do this?

Probably your scheduler is the issue.

Rather use two inject nodes for starting at specific times and another two for stopping.

You can inject the value you want directly into the setpoint node.

No need to switch or use intermediary nodes.

[
    {
        "id": "b7c7c697c988d637",
        "type": "inject",
        "z": "fc76aca644a454c7",
        "name": "8pm",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 20 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-1000",
        "payloadType": "num",
        "x": 390,
        "y": 140,
        "wires": [
            [
                "e5920ab40d3b70fa"
            ]
        ]
    },
    {
        "id": "e5920ab40d3b70fa",
        "type": "victron-output-ess",
        "z": "fc76aca644a454c7",
        "service": "com.victronenergy.settings",
        "path": "/Settings/CGwacs/AcPowerSetPoint",
        "serviceObj": {
            "service": "com.victronenergy.settings",
            "name": "Venus settings",
            "communityTag": "ess"
        },
        "pathObj": {
            "path": "/Settings/CGwacs/AcPowerSetPoint",
            "type": "integer",
            "name": "Grid set-point (W)",
            "mode": "both"
        },
        "name": "Setpoint",
        "onlyChanges": false,
        "roundValues": "no",
        "rateLimit": 0,
        "conditionalMode": false,
        "condition1Operator": ">",
        "condition1HysteresisEnabled": false,
        "condition1HysteresisThreshold": "",
        "condition2Enabled": false,
        "condition2Service": "",
        "condition2Path": "",
        "condition2Operator": ">",
        "logicOperator": "AND",
        "outputTrue": "true",
        "outputFalse": "false",
        "outputOnChange": false,
        "debounce": 2000,
        "x": 680,
        "y": 180,
        "wires": []
    },
    {
        "id": "d86b71c94b3947a3",
        "type": "inject",
        "z": "fc76aca644a454c7",
        "name": "5am",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 05 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "-1000",
        "payloadType": "num",
        "x": 390,
        "y": 240,
        "wires": [
            [
                "e5920ab40d3b70fa"
            ]
        ]
    },
    {
        "id": "c9501a87a9ea981b",
        "type": "inject",
        "z": "fc76aca644a454c7",
        "name": "11pm",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 23 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 390,
        "y": 180,
        "wires": [
            [
                "e5920ab40d3b70fa"
            ]
        ]
    },
    {
        "id": "1ed688cc0415ba29",
        "type": "inject",
        "z": "fc76aca644a454c7",
        "name": "7am",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "00 07 * * *",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "0",
        "payloadType": "num",
        "x": 390,
        "y": 280,
        "wires": [
            [
                "e5920ab40d3b70fa"
            ]
        ]
    },
    {
        "id": "04e604e01b8e64ab",
        "type": "global-config",
        "env": [],
        "modules": {
            "@victronenergy/node-red-contrib-victron": "1.7.20"
        }
    }
]

Your scheduler isn’t necessarily the problem; it’s simply the setup:
what exactly do the two switch nodes do?
If you set it to active at -500 W, then of course you also need to set it back to active at 0 (or 30, or whatever you configured) two hours later.
That’s not the case here, in my opinion (without knowing the settings in the switch nodes), based on how you’ve set it up!

Edit: But yes, the way @nickdb showed it makes more sense: just use several inject nodes with the respective payload for each time, and you’re done. So, in my opinion, Nick’s explanation is at least incomplete, but his result is absolutely right!

I did say probably :wink:
But indeed, the more nodes, the more room for error, especially if someone is new to nodered.
Always keep it simple.

Thanks!

The “Light Schedular” lets me set it to turn on and off from 8 to 11 p.m., and then from 4 to 7 a.m. It always turns on, but suddenly it no longer turns off since I got this simple version.

These settings work, although the problem is that I’m not allowed to set the power draw in the second node to 0; otherwise, the battery only discharges to a maximum of 20%… So I always have to draw around 10 watts from the grid (which I don’t want to do).

That’s why I’m also trying the approach with the inject nodes, so that the red node only intervenes when I want to feed power from the house into the grid — and not otherwise.

Here’s the diagram with the scheduler

e

Hi

I did it like you suggested.

At 8pm Red Node inject the -1000. To stopp this and set ist back to the “normal” Victron-System I use at midnight and 7 am the Setpoint / “Jason” and write “null”. Hop this will work, thank for input! pre