It does a couple of things you might not need but this JSON code will check the local time and send a 0 to disable charge. If you decide to AC couple the second ESS, this is how I stopped the charging overnight.
[
{
“id”: “ca8f992f0c0f0bb7”,
“type”: “inject”,
“z”: “1112bdc43019f870”,
“name”: “EVERY 5 SEC SEND 0”,
“props”: [
{
“p”: “payload”
},
{
“p”: “topic”,
“vt”: “str”
}
],
“repeat”: “5”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“topic”: “”,
“payload”: “0”,
“payloadType”: “num”,
“x”: 410,
“y”: 540,
“wires”: [
[
“545e4a3a975e9f59”
]
]
},
{
“id”: “545e4a3a975e9f59”,
“type”: “function”,
“z”: “1112bdc43019f870”,
“name”: “TIME FILTER NIGHT DVCC CHARGER”,
“func”: “// Get the current timestamp\nvar now = new Date();\n\n// Adjust for Australia time zone (UTC+10)\n//var localTime = new Date(now.getTime() + (10 * 60 * 60 * 1000));\n\n// Use local time\nvar localTime = new Date(now.getTime() + (0));\n\n// Get the current local hour and minute\nvar currentHour = localTime.getHours();\nvar currentMinute = localTime.getMinutes();\n\n// Define the start and end times (in hours and minutes)\nvar startTime = { hour: 17, minute: 2 }; // 3:25 PM\nvar endTime = { hour: 7, minute: 29 }; // 7:29 AM next day\n\n// Convert start and end times to total minutes for easier comparison\nvar startTotalMinutes = startTime.hour * 60 + startTime.minute;\nvar endTotalMinutes = endTime.hour * 60 + endTime.minute;\nvar currentTotalMinutes = currentHour * 60 + currentMinute;\n\n// Check if the current time is within the allowed range\n// The range spans from 3:25 PM to 7:29 AM the next day\n// To handle the overnight span, we check if the current time is greater than or equal to the start time\n// OR less than or equal to the end time (assuming the end time is the next day)\nif (currentTotalMinutes >= startTotalMinutes || currentTotalMinutes <= endTotalMinutes) {\n // Current time is within the allowed range, let the message pass through\n return msg;\n} else {\n // Current time is outside the allowed range, do not pass the message\n return null;\n}\n”,
“outputs”: 1,
“timeout”: 0,
“noerr”: 0,
“initialize”: “”,
“finalize”: “”,
“libs”: ,
“x”: 740,
“y”: 540,
“wires”: [
[
“5711b23639c1d4fa”
]
]
},
{
“id”: “5711b23639c1d4fa”,
“type”: “victron-output-settings”,
“z”: “1112bdc43019f870”,
“service”: “com.victronenergy.settings”,
“path”: “/Settings/SystemSetup/MaxChargeCurrent”,
“serviceObj”: {
“service”: “com.victronenergy.settings”,
“name”: “Venus settings”
},
“pathObj”: {
“path”: “/Settings/SystemSetup/MaxChargeCurrent”,
“type”: “float”,
“name”: “DVCC system max charge current (A DC)”,
“writable”: true
},
“name”: “”,
“onlyChanges”: false,
“x”: 1190,
“y”: 540,
“wires”:
},
{
“id”: “07b85bf4d24aed70”,
“type”: “victron-input-ess”,
“z”: “1112bdc43019f870”,
“service”: “com.victronenergy.settings”,
“path”: “/Settings/SystemSetup/MaxChargeCurrent”,
“serviceObj”: {
“service”: “com.victronenergy.settings”,
“name”: “Venus settings”
},
“pathObj”: {
“path”: “/Settings/SystemSetup/MaxChargeCurrent”,
“type”: “float”,
“name”: “DVCC Charge current limit (A)”
},
“name”: “”,
“onlyChanges”: false,
“x”: 1160,
“y”: 600,
“wires”: [
]
}
]