Hello,
I recently installed a 3f Multiplus II system.
System is running great.
I want to lower the maximum AC1 input current during the night.
Found out node red is the way to go.
I know how to programm Siemens PLC, but i am new to node red.
Therefore a used AI to write me a flow, because i hear about the great programming skills of AI all the time.
But the script doesn’t work.
Would someone like to review it and show me the fault’s?
I would like to learn from it.
Thank’s.
[
{
“id”: “a1d0f6c123456789”,
“type”: “inject”,
“z”: “main”,
“name”: “Elke 5 minuten”,
“props”: ,
“repeat”: “300”,
“once”: true,
“onceDelay”: 0.1,
“topic”: “”,
“x”: 160,
“y”: 120,
“wires”: [[“f2b3c6d123456789”]]
},
{
“id”: “f2b3c6d123456789”,
“type”: “function”,
“z”: “main”,
“name”: “Check tijd & stel limit”,
“func”: “var now = new Date();\nvar hour = now.getHours();\n\nif (hour >= 23 || hour < 5) {\n // Nacht - verlaag stroomlimiet\n msg.payload = {“value”: 3.5};\n} else {\n // Dag - normale limiet\n msg.payload = {“value”: 32};\n}\n\nreturn msg;”,
“outputs”: 1,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“libs”: ,
“x”: 390,
“y”: 120,
“wires”: [[“m3q9x7y123456789”]]
},
{
“id”: “m3q9x7y123456789”,
“type”: “mqtt out”,
“z”: “main”,
“name”: “AC Limit naar Cerbo”,
“topic”: “W/set/com.victronenergy.settings/Settings/SystemSetup/AcInput1/CurrentLimit”,
“qos”: “”,
“retain”: “”,
“broker”: “b4c7d8e123456789”,
“x”: 670,
“y”: 120,
“wires”:
},
{
“id”: “b4c7d8e123456789”,
“type”: “mqtt-broker”,
“name”: “Victron MQTT”,
“broker”: “192.168.0.197”,
“port”: “1883”,
“clientid”: “nodered_cerbo”,
“usetls”: false,
“protocolVersion”: “4”,
“keepalive”: “60”,
“cleansession”: true,
“birthTopic”: “”,
“birthQos”: “0”,
“birthPayload”: “”,
“birthMsg”: {},
“closeTopic”: “”,
“closeQos”: “0”,
“closePayload”: “”,
“closeMsg”: {},
“willTopic”: “”,
“willQos”: “0”,
“willPayload”: “”,
“willMsg”: {},
“sessionExpiry”: “”
}
]