Interesting, lets stress test this feature.
Here is my ‘work in progress’ hybrid dess flow:
FAIL: “An error occurred: Body is limited to 150000 characters; you entered 419084.”
Lets try again with smaller flow, see below.
Conclusions:
- Yes it works
- Standard message size is too limited for complex flows (works fine in the editor but fails when trying to ‘save’.
- Standard ‘nodes’ are ‘recognized’ showing correct ‘graphics’ (color, icons) but nodes from imported libraries are all shown plain white, no icons
[
{
"id": "39aff6142244bf9b",
"type": "tab",
"label": "UpCycle Hybrid DESS Trade : Price & Forecast Charge Trigger Flow",
"disabled": false,
"info": "",
"env": []
},
{
"id": "34b73fba4df2b7ba",
"type": "group",
"z": "39aff6142244bf9b",
"name": "UpCycle Hybrid DESS Trade : Timing Triggers and Schedule Stats ",
"style": {
"label": true
},
"nodes": [
"a9340f62cd8d4177",
"6e20a65590cc8a40",
"411756b661548bf9",
"d3da4a5c8306b088",
"3db67e14521de383",
"1cc25eb445fcf8cc",
"db194818094b4925",
"bc089157fce2bf11",
"c40dbe8aa1e9b3ab",
"c7211cfdcf4cb15c",
"60c55dc2b82ec14b",
"54d84885e231f53a",
"7a640a73e09cb300",
"9aab3e2d1768eb31",
"5315927a0aaabd3e",
"7457fd5b4ca9bec6",
"428d71112d385807",
"24252155f172d682",
"48e5a38f95f3f435",
"0f6a22182792864e",
"1b49437f8343be41",
"beac66ce2b26e039",
"536b30d1848df7e8",
"cc5dd99e74177e63",
"3645d84eebe3c088",
"5d505c55fa072459",
"68f3cb8cbbc1d6bb"
],
"x": 74,
"y": 199,
"w": 1082,
"h": 337
},
{
"id": "bf18e86e4d04ccde",
"type": "group",
"z": "39aff6142244bf9b",
"name": "UpCycle Hybrid DESS Trade : Node-RED DESS Price Schedules",
"style": {
"label": true
},
"nodes": [
"e7e3a970f8a273f6",
"1cfc811b4dfbf231",
"514ab233feb8c6fe",
"ceeb5021cc6fab96",
"901ae3d8f3d44af8",
"77191f449ba6dda2",
"78f9ed33b2332ae4",
"e54a3b013ee93f2e",
"37975819dc439ca6",
"9b248c90038d6405",
"c5442330dd904551",
"63a684dbcc751e55",
"b8b3eec45376cda5",
"e742f5d6c009770c",
"532a486f9af8e0af",
"d672430a7fc1299b",
"aa72794658804631",
"549036c0ec518277",
"1af236892cf8d3be",
"6c3f3ea707d4176d",
"56fde0836c2d8f1d",
"6066d27c980740a8",
"1b8dc2059bae1dbe",
"901960a59fc25171",
"f195a41e88a3a6be",
"e4190fcaafaabbe6",
"46bc470d9a6d3390",
"cadb2f6a85c397ee",
"dd0c8e91f3fe5037",
"7ab35540e117665a",
"7f92ad276f401a33"
],
"x": 74,
"y": 559,
"w": 1082,
"h": 362
},
{
"id": "19e122760e98d65a",
"type": "group",
"z": "39aff6142244bf9b",
"name": "UpCycle Hybrid DESS Trade :VRM DESS Price Schedules",
"style": {
"label": true
},
"nodes": [
"a616c6585bebaa2d",
"18dcfc44fac28aef",
"9d711c42519e72e1",
"946c0d8e1ca122ec",
"c717b544e028f640",
"b412e55f68f19085",
"1fe50b930330db7c",
"3430bc7a59a00d69",
"dfdc83f34a2e6c2c",
"1e49c7b7e67f5f5a",
"1106452e37f469ab",
"6a83040718bd6a92",
"640f267c2da4ab3d",
"ed33c948f55b270a",
"9c2074b8a2a8899a",
"da226947de9aba2f",
"4004cd7008d4180a",
"d69a8a374fd95981",
"6de9191c10fc4db1",
"b9626c0e2928092a",
"d5afd2047d9f0e81",
"cc47706e6a573be8",
"30947317ba565089",
"70957d7169c3350f",
"dffb2c5f19be2daa",
"ad9ec2995dc85fe3",
"2f29ad86d68c9df6",
"dd958f208a7e877f",
"8eabce534faff0ef",
"c1a0a5f1cab9dfd3",
"02bf8520492ac5fe"
],
"x": 74,
"y": 939,
"w": 1082,
"h": 362
},
{
"id": "a9c10fb87af2e1b7",
"type": "group",
"z": "39aff6142244bf9b",
"name": "UpCycle Hybrid DESS Trade : Node-RED Grid to Battery Forecast - Charge Override",
"style": {
"label": true
},
"nodes": [
"4b05af0a35daa436",
"e8a806ee6679078e",
"41e5417e9f9424f5",
"6117e56c471d76c3",
"a902179e23f578c7",
"ec77f0abe7da50fb",
"ea268b31b0a04f39",
"b8ab6f6e58d27355",
"b5621b08c088c279",
"20c79aa6fc5cf853",
"8f1d92806f1af11f",
"964b56b00a9c50b7",
"985148527157a4ee",
"5ad834e2a880a7ce",
"f00274ee3aead9f9",
"e9aae8a399b0fa19",
"3cb6186863b5e1c5",
"48840887dbe8e1ab",
"8d149755ca148829",
"a24b581452b1d4c6",
"ca77e3cf803398fb",
"f5ed7156153e4dbe",
"2279f310ec4e2f42",
"8316001bac9be6b5",
"3295daa35b749302",
"cd49f0f75f3d949f",
"4da2e4fb8ef9c092",
"b465d74a23bf4971",
"feaaa5737bd8aa91",
"1a6fbfe92bad130e",
"a173767a076a3c72",
"4ff1f65593fa72da",
"3b646167607365a4",
"664a9401106afe9d",
"0f8e506b40d6ab4c",
"e495aa3dae6b229b",
"ec4520a1351024f8",
"bbf8849cdd3ab166",
"327a8e1e51cccf49",
"f15c0ec84fefe063",
"64e08cc19828e8b5"
],
"x": 74,
"y": 1319,
"w": 1082,
"h": 542
},
{
"id": "a9340f62cd8d4177",
"type": "function",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "hour",
"func": "let date = new Date()\nlet hour = Number( date.getHours() )\nlet fill = ( 'green' )\nlet shape = 'dot'\nlet text = ( 'hour : ' + hour )\nnode.status({fill, shape, text})\nmsg.payload = hour\nmsg.topic = 'hour'\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 240,
"wires": [
[
"1cc25eb445fcf8cc",
"60c55dc2b82ec14b",
"54d84885e231f53a"
]
]
},
{
"id": "6e20a65590cc8a40",
"type": "function",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "quarter",
"func": "let date = new Date()\nlet minutes = date.getMinutes()\nlet quarterf = ( minutes / 15 ) \nlet quarter = quarterf - ( quarterf % 1 )\nlet fill = ( 'green' )\nlet shape = 'dot'\nlet text = ( 'quarter : ' + quarter )\nnode.status({fill, shape, text})\nmsg.payload = quarter\nmsg.topic = 'quarter'\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 740,
"y": 300,
"wires": [
[
"db194818094b4925",
"9aab3e2d1768eb31",
"7a640a73e09cb300"
]
]
},
{
"id": "411756b661548bf9",
"type": "function",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "minute",
"func": "let date = new Date()\nlet minute = date.getMinutes()\nlet fill = ( 'green' )\nlet shape = 'dot'\nlet text = ( 'minute : ' + minute )\nnode.status({fill, shape, text})\nmsg.payload = minute\nmsg.topic = 'minute'\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 730,
"y": 360,
"wires": [
[
"c40dbe8aa1e9b3ab",
"7457fd5b4ca9bec6",
"5315927a0aaabd3e"
]
]
},
{
"id": "d3da4a5c8306b088",
"type": "function",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "second",
"func": "let date = new Date()\nlet second = date.getSeconds()\nlet fill = ( 'green' )\nlet shape = 'dot'\nlet text = ( 'second : ' + second )\nnode.status({fill, shape, text})\nmsg.payload = second\nmsg.topic = 'second'\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 740,
"y": 420,
"wires": [
[
"bc089157fce2bf11",
"428d71112d385807",
"24252155f172d682"
]
]
},
{
"id": "3db67e14521de383",
"type": "function",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "mux",
"func": "return msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 530,
"y": 300,
"wires": [
[
"a9340f62cd8d4177",
"6e20a65590cc8a40",
"411756b661548bf9",
"d3da4a5c8306b088",
"1b49437f8343be41",
"0f6a22182792864e"
]
]
},
{
"id": "1cc25eb445fcf8cc",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "link out 22",
"mode": "link",
"links": [
"dd0c8e91f3fe5037",
"02bf8520492ac5fe",
"3b646167607365a4"
],
"x": 1115,
"y": 240,
"wires": []
},
{
"id": "db194818094b4925",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "link out 23",
"mode": "link",
"links": [],
"x": 1115,
"y": 300,
"wires": []
},
{
"id": "bc089157fce2bf11",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "link out 24",
"mode": "link",
"links": [],
"x": 1115,
"y": 420,
"wires": []
},
{
"id": "c40dbe8aa1e9b3ab",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "link out 25",
"mode": "link",
"links": [],
"x": 1115,
"y": 360,
"wires": []
},
{
"id": "c7211cfdcf4cb15c",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "link in 10",
"links": [
"2b8364435ba7b68c"
],
"x": 115,
"y": 300,
"wires": [
[
"3db67e14521de383"
]
]
},
{
"id": "60c55dc2b82ec14b",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1000,
"y": 240,
"wires": []
},
{
"id": "54d84885e231f53a",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 870,
"y": 240,
"wires": []
},
{
"id": "7a640a73e09cb300",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 870,
"y": 300,
"wires": []
},
{
"id": "9aab3e2d1768eb31",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1000,
"y": 300,
"wires": []
},
{
"id": "5315927a0aaabd3e",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 870,
"y": 360,
"wires": []
},
{
"id": "7457fd5b4ca9bec6",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1000,
"y": 360,
"wires": []
},
{
"id": "428d71112d385807",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 870,
"y": 420,
"wires": []
},
{
"id": "24252155f172d682",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1000,
"y": 420,
"wires": []
},
{
"id": "536b30d1848df7e8",
"type": "inject",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "VRM Site ID",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "siteId",
"payload": "888888",
"payloadType": "num",
"x": 510,
"y": 480,
"wires": [
[
"cc5dd99e74177e63"
]
]
},
{
"id": "cc5dd99e74177e63",
"type": "function",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "flow set siteId",
"func": "flow.set('siteId', msg.payload)\nreturn msg\n// use : {{flow.siteId}} ",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 760,
"y": 480,
"wires": [
[
"5d505c55fa072459"
]
]
},
{
"id": "48e5a38f95f3f435",
"type": "inject",
"z": "39aff6142244bf9b",
"d": true,
"g": "34b73fba4df2b7ba",
"name": "hourly-ts",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "0 0-23 * * *",
"once": true,
"onceDelay": 0.1,
"topic": "hourly-ts",
"payload": "",
"payloadType": "date",
"x": 200,
"y": 420,
"wires": [
[
"beac66ce2b26e039",
"68f3cb8cbbc1d6bb"
]
]
},
{
"id": "0f6a22182792864e",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 370,
"y": 240,
"wires": []
},
{
"id": "1b49437f8343be41",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 520,
"y": 240,
"wires": []
},
{
"id": "2b8364435ba7b68c",
"type": "link out",
"z": "39aff6142244bf9b",
"name": "link out 26",
"mode": "link",
"links": [
"c7211cfdcf4cb15c"
],
"x": 35,
"y": 300,
"wires": []
},
{
"id": "e7e3a970f8a273f6",
"type": "function",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "nodered_p_b",
"func": "//\nlet hour = msg.payload\nlet output_object = 'p_b'\nlet topic = 'nodered_' + output_object\nlet get_flow_item = 'dess'\nlet flow_item = flow.get( get_flow_item )\nlet flow_object = flow_item.output[output_object]\nlet object_keys = Object.keys(flow_object).length\nlet is_object = ( object_keys > 0 )\nlet get_value = ( is_object ? flow_object[hour] : false )\n\nlet rounded = get_value\nif ( is_object)\n{\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n\nlet fill = ( is_object ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( output_object + ' at ' + hour + 'h : ' + rounded + 'ct')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 820,
"wires": [
[
"e742f5d6c009770c"
]
]
},
{
"id": "1cfc811b4dfbf231",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 820,
"wires": []
},
{
"id": "514ab233feb8c6fe",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 820,
"wires": []
},
{
"id": "ceeb5021cc6fab96",
"type": "function",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "nodered_p_s",
"func": "//\nlet hour = msg.payload\nlet output_object = 'p_s'\nlet topic = 'nodered_' + output_object\nlet get_flow_item = 'dess'\nlet flow_item = flow.get( get_flow_item )\nlet flow_object = flow_item.output[output_object]\nlet object_keys = Object.keys(flow_object).length\nlet is_object = ( object_keys > 0 )\nlet get_value = ( is_object ? flow_object[hour] : false )\n\nlet rounded = get_value\nif ( is_object)\n{\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n\nlet fill = ( is_object ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( output_object + ' at ' + hour + 'h : ' + rounded + 'ct')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 700,
"wires": [
[
"901960a59fc25171"
]
]
},
{
"id": "901ae3d8f3d44af8",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 700,
"wires": []
},
{
"id": "77191f449ba6dda2",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 700,
"wires": []
},
{
"id": "78f9ed33b2332ae4",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 600,
"wires": []
},
{
"id": "e54a3b013ee93f2e",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 600,
"wires": []
},
{
"id": "37975819dc439ca6",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "link out 28",
"mode": "link",
"links": [
"d672430a7fc1299b"
],
"x": 1115,
"y": 600,
"wires": []
},
{
"id": "9b248c90038d6405",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Status",
"property": "payload",
"x": 750,
"y": 600,
"wires": [
[
"78f9ed33b2332ae4",
"e54a3b013ee93f2e",
"37975819dc439ca6"
]
]
},
{
"id": "c5442330dd904551",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Status",
"property": "payload",
"x": 750,
"y": 820,
"wires": [
[
"1cfc811b4dfbf231",
"514ab233feb8c6fe",
"7f92ad276f401a33"
]
]
},
{
"id": "63a684dbcc751e55",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Status",
"property": "payload",
"x": 750,
"y": 700,
"wires": [
[
"901ae3d8f3d44af8",
"77191f449ba6dda2",
"7ab35540e117665a"
]
]
},
{
"id": "b8b3eec45376cda5",
"type": "function",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "nodered_avg",
"func": "//\nlet hour = msg.payload\nlet output_object = 'p_b'\nlet topic = 'nodered_avg'\nlet get_flow_item = 'dess'\nlet flow_item = flow.get( get_flow_item )\nlet flow_object = flow_item.output[output_object]\nlet object_keys = Object.keys(flow_object).length\nlet is_object = ( object_keys > 0 )\nlet get_value = ( is_object ? flow_object[hour] : false )\n\nlet rounded = get_value\n\nlet prices_sum = 0\nlet first_hour = 0\nlet last_hour = 24\nif ( is_object )\n{\n if ( object_keys == 48 ) // rolling 24 hour averaging block\n {\n first_hour = hour\n last_hour = first_hour + 24 \n } \n for (let i = first_hour ; i < last_hour ; i++) \n {\n prices_sum += flow_object[i]\n }\n rounded = prices_sum / ( last_hour - first_hour )\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n\nlet fill = ( is_object ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( first_hour + 'h to ' + last_hour + 'h avg: ' + rounded + 'ct')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 760,
"wires": [
[
"549036c0ec518277",
"56fde0836c2d8f1d",
"46bc470d9a6d3390"
]
]
},
{
"id": "e742f5d6c009770c",
"type": "Comparator",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "buy",
"property": "payload",
"math": "<=",
"topic1": "nodered_p_b",
"topic2": "lowprice",
"x": 430,
"y": 820,
"wires": [
[
"aa72794658804631"
]
]
},
{
"id": "532a486f9af8e0af",
"type": "change",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "sellprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "sellprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 700,
"wires": [
[
"63a684dbcc751e55"
]
]
},
{
"id": "d672430a7fc1299b",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "link in 12",
"links": [
"37975819dc439ca6"
],
"x": 115,
"y": 760,
"wires": [
[
"b8b3eec45376cda5",
"ceeb5021cc6fab96",
"e7e3a970f8a273f6"
]
]
},
{
"id": "aa72794658804631",
"type": "change",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "buyprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "buyprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 820,
"wires": [
[
"c5442330dd904551"
]
]
},
{
"id": "549036c0ec518277",
"type": "SumUltimate",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Math",
"property": "payload",
"math": "sum",
"subtractstartfrom": "",
"x": 430,
"y": 880,
"wires": [
[
"6c3f3ea707d4176d"
]
]
},
{
"id": "1af236892cf8d3be",
"type": "inject",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "lowprice",
"payload": "-5",
"payloadType": "num",
"x": 230,
"y": 880,
"wires": [
[
"549036c0ec518277"
]
]
},
{
"id": "6c3f3ea707d4176d",
"type": "change",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "lowprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "lowprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 880,
"wires": [
[
"e742f5d6c009770c"
]
]
},
{
"id": "56fde0836c2d8f1d",
"type": "SumUltimate",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Math",
"property": "payload",
"math": "sum",
"subtractstartfrom": "",
"x": 430,
"y": 640,
"wires": [
[
"1b8dc2059bae1dbe"
]
]
},
{
"id": "6066d27c980740a8",
"type": "inject",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "highprice",
"payload": "+0",
"payloadType": "num",
"x": 230,
"y": 640,
"wires": [
[
"56fde0836c2d8f1d"
]
]
},
{
"id": "1b8dc2059bae1dbe",
"type": "change",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "highprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "highprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 640,
"wires": [
[
"901960a59fc25171"
]
]
},
{
"id": "901960a59fc25171",
"type": "Comparator",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "sell",
"property": "payload",
"math": ">",
"topic1": "nodered_p_s",
"topic2": "highprice",
"x": 430,
"y": 700,
"wires": [
[
"532a486f9af8e0af"
]
]
},
{
"id": "f195a41e88a3a6be",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Node-RED DESS 24h PRICE Average",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "text",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 910,
"y": 760,
"wires": []
},
{
"id": "e4190fcaafaabbe6",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "link out 30",
"mode": "link",
"links": [],
"x": 1115,
"y": 760,
"wires": []
},
{
"id": "46bc470d9a6d3390",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "Status",
"property": "payload",
"x": 430,
"y": 760,
"wires": [
[
"cadb2f6a85c397ee"
]
]
},
{
"id": "cadb2f6a85c397ee",
"type": "rbe",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "dedup",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": false,
"property": "payload",
"topi": "topic",
"x": 590,
"y": 760,
"wires": [
[
"e4190fcaafaabbe6",
"f195a41e88a3a6be"
]
]
},
{
"id": "a616c6585bebaa2d",
"type": "function",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "vrmdess_deGb",
"func": "//\nlet hour = msg.payload\nlet stats_key = 'deGb'\nlet topic = 'vrmdess_' + stats_key\n\nlet vrmsiteid = flow.get('siteId')\nlet get_global = 'installations.stats.' + vrmsiteid.toFixed(0)\nlet get_stats = global.get( get_global )\nlet is_stats = !( get_stats == undefined || get_stats == null )\n\nlet get_records = null\n//let get_totals = 0\nlet get_price = 0\nlet records_length = 0\nvar is_records = false\n\nif ( is_stats )\n{\n get_records = get_stats.records[stats_key]\n// get_totals = get_stats.totals[stats_key]\n records_length = get_records.length\n is_records = ( (records_length > 0) ? true : false )\n get_value = ( is_records ? get_records[hour][1] : false )\n}\n\nlet rounded = get_value\n\nif ( rounded )\n{\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier \n}\n/*\nlet prices_sum = 0\nlet first_hour = 0\nlet last_hour = 24\n\nif ( is_records )\n{\n if ( records_length == 48 ) // rolling 24 hour averaging block\n {\n first_hour = hour\n last_hour = first_hour + 24 \n } \n for (let i = first_hour ; i < last_hour ; i++) \n {\n prices_sum += get_records[i][1]\n }\n rounded = prices_sum / ( last_hour - first_hour )\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n*/\n\nlet fill = ( (rounded != false) ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( stats_key + ' at ' + hour + 'h : ' + rounded + 'ct')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 240,
"y": 1200,
"wires": [
[
"ed33c948f55b270a"
]
]
},
{
"id": "18dcfc44fac28aef",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1200,
"wires": []
},
{
"id": "9d711c42519e72e1",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1200,
"wires": []
},
{
"id": "946c0d8e1ca122ec",
"type": "function",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "vrmdess_deGs",
"func": "//\nlet hour = msg.payload\nlet stats_key = 'deGs'\nlet topic = 'vrmdess_' + stats_key\n\nlet vrmsiteid = flow.get('siteId')\nlet get_global = 'installations.stats.' + vrmsiteid.toFixed(0)\nlet get_stats = global.get( get_global )\nlet is_stats = !( get_stats == undefined || get_stats == null )\n\nlet get_records = null\n//let get_totals = 0\nlet get_price = 0\nlet records_length = 0\nvar is_records = false\n\nif ( is_stats )\n{\n get_records = get_stats.records[stats_key]\n// get_totals = get_stats.totals[stats_key]\n records_length = get_records.length\n is_records = ( (records_length > 0) ? true : false )\n get_value = ( is_records ? get_records[hour][1] : false )\n}\n\nlet rounded = get_value\n\nif ( rounded )\n{\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier \n}\n/*\nlet prices_sum = 0\nlet first_hour = 0\nlet last_hour = 24\n\nif ( is_records )\n{\n if ( records_length == 48 ) // rolling 24 hour averaging block\n {\n first_hour = hour\n last_hour = first_hour + 24 \n } \n for (let i = first_hour ; i < last_hour ; i++) \n {\n prices_sum += get_records[i][1]\n }\n rounded = prices_sum / ( last_hour - first_hour )\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n*/\n\nlet fill = ( (rounded != false) ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( stats_key + ' at ' + hour + 'h : ' + rounded + 'ct')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 240,
"y": 1080,
"wires": [
[
"70957d7169c3350f"
]
]
},
{
"id": "c717b544e028f640",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1080,
"wires": []
},
{
"id": "b412e55f68f19085",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1080,
"wires": []
},
{
"id": "1fe50b930330db7c",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 980,
"wires": []
},
{
"id": "3430bc7a59a00d69",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 980,
"wires": []
},
{
"id": "dfdc83f34a2e6c2c",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "link out 31",
"mode": "link",
"links": [
"da226947de9aba2f"
],
"x": 1115,
"y": 980,
"wires": []
},
{
"id": "1e49c7b7e67f5f5a",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "Status",
"property": "payload",
"x": 750,
"y": 980,
"wires": [
[
"1fe50b930330db7c",
"3430bc7a59a00d69",
"dfdc83f34a2e6c2c"
]
]
},
{
"id": "1106452e37f469ab",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "Status",
"property": "payload",
"x": 750,
"y": 1200,
"wires": [
[
"c1a0a5f1cab9dfd3",
"18dcfc44fac28aef",
"9d711c42519e72e1"
]
]
},
{
"id": "6a83040718bd6a92",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "Status",
"property": "payload",
"x": 750,
"y": 1080,
"wires": [
[
"8eabce534faff0ef",
"c717b544e028f640",
"b412e55f68f19085"
]
]
},
{
"id": "640f267c2da4ab3d",
"type": "function",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "vrmdess_avg",
"func": "//\nlet hour = msg.payload\nlet topic = 'vrmdess_avg'\n\nlet stats_key = 'deGb'\nlet vrmsiteid = flow.get('siteId')\nlet get_global = 'installations.stats.' + vrmsiteid.toFixed(0)\nlet get_stats = global.get( get_global )\nlet is_stats = !( get_stats == undefined || get_stats == null )\n\nlet get_records = null\nlet get_totals = 0\nlet get_price = 0\nlet records_length = 0\nvar is_records = false\n\nif ( is_stats )\n{\n get_records = get_stats.records[stats_key]\n get_totals = get_stats.totals[stats_key]\n records_length = get_records.length\n is_records = ( (records_length > 0) ? true : false )\n get_value = ( is_records ? get_records[hour][1] : false )\n}\n\n/*\nlet get_flow_item = 'dess'\nlet flow_item = flow.get( get_flow_item )\nlet flow_object = flow_item.output[output_object]\nlet object_keys = Object.keys(flow_object).length\nlet is_object = ( object_keys > 0 )\nlet get_value = ( is_object ? flow_object[hour] : false )\n*/\n\nlet rounded = get_value\n\nlet prices_sum = 0\nlet first_hour = 0\nlet last_hour = 24\n\nif ( is_records )\n{\n if ( records_length == 48 ) // rolling 24 hour averaging block\n {\n first_hour = hour\n last_hour = first_hour + 24 \n } \n for (let i = first_hour ; i < last_hour ; i++) \n {\n prices_sum += get_records[i][1]\n }\n rounded = prices_sum / ( last_hour - first_hour )\n let factor = 100\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n\nlet fill = ( is_records ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( first_hour + 'h to ' + last_hour + 'h avg: ' + rounded + 'ct')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg\n\n/*\nlet topic = 'vrm_price_avg'\nlet key = 'deGb'\n\nlet vrmsiteid = flow.get('siteId')\nlet global_get = 'installations.stats.' + vrmsiteid.toFixed(0)\nlet installations = global.get( global_get )\nlet get_vrm_array = installations.records[key]\nlet get_vrm_total = installations.totals[key]\nlet array_length = get_vrm_array.length\nlet is_vrm_array = ( array_length > 0 )\nlet vrm_value = ( is_vrm_array ? get_vrm_array[hour][1] : false )\n*/",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 1140,
"wires": [
[
"d69a8a374fd95981",
"d5afd2047d9f0e81",
"2f29ad86d68c9df6"
]
]
},
{
"id": "ed33c948f55b270a",
"type": "Comparator",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "buy",
"property": "payload",
"math": "<=",
"topic1": "vrmdess_deGb",
"topic2": "lowprice",
"x": 430,
"y": 1200,
"wires": [
[
"4004cd7008d4180a"
]
]
},
{
"id": "9c2074b8a2a8899a",
"type": "change",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "sellprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "sellprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 1080,
"wires": [
[
"6a83040718bd6a92"
]
]
},
{
"id": "da226947de9aba2f",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "link in 14",
"links": [
"dfdc83f34a2e6c2c"
],
"x": 115,
"y": 1140,
"wires": [
[
"640f267c2da4ab3d",
"946c0d8e1ca122ec",
"a616c6585bebaa2d"
]
]
},
{
"id": "4004cd7008d4180a",
"type": "change",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "buyprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "buyprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 1200,
"wires": [
[
"1106452e37f469ab"
]
]
},
{
"id": "d69a8a374fd95981",
"type": "SumUltimate",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "Math",
"property": "payload",
"math": "sum",
"subtractstartfrom": "",
"x": 430,
"y": 1260,
"wires": [
[
"b9626c0e2928092a"
]
]
},
{
"id": "6de9191c10fc4db1",
"type": "inject",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "lowprice",
"payload": "-5",
"payloadType": "num",
"x": 230,
"y": 1260,
"wires": [
[
"d69a8a374fd95981"
]
]
},
{
"id": "b9626c0e2928092a",
"type": "change",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "lowprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "lowprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 1260,
"wires": [
[
"ed33c948f55b270a"
]
]
},
{
"id": "d5afd2047d9f0e81",
"type": "SumUltimate",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "Math",
"property": "payload",
"math": "sum",
"subtractstartfrom": "",
"x": 430,
"y": 1020,
"wires": [
[
"30947317ba565089"
]
]
},
{
"id": "cc47706e6a573be8",
"type": "inject",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "highprice",
"payload": "+0",
"payloadType": "num",
"x": 230,
"y": 1020,
"wires": [
[
"d5afd2047d9f0e81"
]
]
},
{
"id": "30947317ba565089",
"type": "change",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "highprice",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "highprice",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 580,
"y": 1020,
"wires": [
[
"70957d7169c3350f"
]
]
},
{
"id": "70957d7169c3350f",
"type": "Comparator",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "sell",
"property": "payload",
"math": ">",
"topic1": "vrmdess_deGs",
"topic2": "highprice",
"x": 430,
"y": 1080,
"wires": [
[
"9c2074b8a2a8899a"
]
]
},
{
"id": "dffb2c5f19be2daa",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "VRM DESS 24h PRICE Average",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "text",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 930,
"y": 1140,
"wires": []
},
{
"id": "ad9ec2995dc85fe3",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "link out 32",
"mode": "link",
"links": [],
"x": 1115,
"y": 1140,
"wires": []
},
{
"id": "2f29ad86d68c9df6",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "Status",
"property": "payload",
"x": 430,
"y": 1140,
"wires": [
[
"dd958f208a7e877f"
]
]
},
{
"id": "dd958f208a7e877f",
"type": "rbe",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "dedup",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": false,
"property": "payload",
"topi": "topic",
"x": 590,
"y": 1140,
"wires": [
[
"ad9ec2995dc85fe3",
"dffb2c5f19be2daa"
]
]
},
{
"id": "8eabce534faff0ef",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "link out 33",
"mode": "link",
"links": [
"d2ce4a6ecc4ca7fe"
],
"x": 1115,
"y": 1080,
"wires": []
},
{
"id": "c1a0a5f1cab9dfd3",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "link out 34",
"mode": "link",
"links": [
"7fa5e37f12fec967"
],
"x": 1115,
"y": 1200,
"wires": []
},
{
"id": "02bf8520492ac5fe",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "19e122760e98d65a",
"name": "link in 18",
"links": [
"1cc25eb445fcf8cc"
],
"x": 115,
"y": 980,
"wires": [
[
"1e49c7b7e67f5f5a"
]
]
},
{
"id": "dd0c8e91f3fe5037",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "link in 24",
"links": [
"1cc25eb445fcf8cc"
],
"x": 115,
"y": 600,
"wires": [
[
"9b248c90038d6405"
]
]
},
{
"id": "7ab35540e117665a",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "link out 42",
"mode": "link",
"links": [
"0c999681d4662b67"
],
"x": 1115,
"y": 700,
"wires": []
},
{
"id": "7f92ad276f401a33",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "bf18e86e4d04ccde",
"name": "link out 46",
"mode": "link",
"links": [
"7fb61ba4bcbfc238",
"4da2e4fb8ef9c092"
],
"x": 1115,
"y": 820,
"wires": []
},
{
"id": "7fa5e37f12fec967",
"type": "link in",
"z": "39aff6142244bf9b",
"name": "link in 32",
"links": [
"c1a0a5f1cab9dfd3"
],
"x": 1195,
"y": 1200,
"wires": [
[]
]
},
{
"id": "7fb61ba4bcbfc238",
"type": "link in",
"z": "39aff6142244bf9b",
"name": "link in 34",
"links": [
"7f92ad276f401a33"
],
"x": 1195,
"y": 820,
"wires": [
[]
]
},
{
"id": "0c999681d4662b67",
"type": "link in",
"z": "39aff6142244bf9b",
"name": "link in 35",
"links": [
"7ab35540e117665a"
],
"x": 1195,
"y": 700,
"wires": [
[]
]
},
{
"id": "d2ce4a6ecc4ca7fe",
"type": "link in",
"z": "39aff6142244bf9b",
"name": "link in 41",
"links": [
"8eabce534faff0ef"
],
"x": 1195,
"y": 1080,
"wires": [
[]
]
},
{
"id": "beac66ce2b26e039",
"type": "vrm-api",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"vrm": "cb2c784a33130f48",
"name": "",
"api_type": "installations",
"idUser": "",
"users": "",
"idSite": "{{flow.siteId}}",
"installations": "stats",
"attribute": "dynamic_ess",
"stats_interval": "hours",
"show_instance": false,
"stats_start": "bod",
"stats_end": "172800",
"use_utc": false,
"gps_start": "",
"gps_end": "",
"widgets": "PVInverterStatus",
"instance": "",
"vrm_id": "888888888888",
"country": "nl",
"b_max": "90.24",
"tb_max": "8.5",
"fb_max": "4.8",
"tg_max": "5",
"fg_max": "15",
"b_cycle_cost": "0.1",
"buy_price_formula": "(p+0.0205+0.10154)*1.21",
"sell_price_formula": "(p+0.0205+0.10154)*1.21",
"green_mode_on": "",
"feed_in_possible": true,
"feed_in_control_on": "",
"b_goal_hour": "18",
"b_goal_SOC": "100",
"store_in_global_context": true,
"verbose": true,
"x": 260,
"y": 360,
"wires": [
[
"3645d84eebe3c088"
]
]
},
{
"id": "3645d84eebe3c088",
"type": "change",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "stats-ts",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "stats-ts",
"tot": "str"
},
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "",
"tot": "date"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 520,
"y": 360,
"wires": [
[
"3db67e14521de383"
]
]
},
{
"id": "5d505c55fa072459",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1000,
"y": 480,
"wires": []
},
{
"id": "d61c38f2082425b7",
"type": "link in",
"z": "39aff6142244bf9b",
"name": "link in 6",
"links": [
"ec4520a1351024f8"
],
"x": 1195,
"y": 1780,
"wires": [
[]
]
},
{
"id": "4b05af0a35daa436",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1420,
"wires": []
},
{
"id": "e8a806ee6679078e",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1420,
"wires": []
},
{
"id": "41e5417e9f9424f5",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1500,
"wires": []
},
{
"id": "6117e56c471d76c3",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1500,
"wires": []
},
{
"id": "a902179e23f578c7",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link in 11",
"links": [
"664a9401106afe9d"
],
"x": 115,
"y": 1500,
"wires": [
[
"ca77e3cf803398fb"
]
]
},
{
"id": "ec77f0abe7da50fb",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link in 13",
"links": [
"e495aa3dae6b229b"
],
"x": 115,
"y": 1420,
"wires": [
[
"5ad834e2a880a7ce"
]
]
},
{
"id": "ea268b31b0a04f39",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 390,
"y": 1420,
"wires": [
[
"f00274ee3aead9f9"
]
]
},
{
"id": "b8ab6f6e58d27355",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "CHARGE",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1820,
"wires": []
},
{
"id": "b5621b08c088c279",
"type": "InjectUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "AUTO",
"topic": "master",
"curVal": true,
"outputJSON": "{ \n\t\"payload\":\"mypayload\",\n\t\"topic\":\"mytopic\"\n}",
"x": 310,
"y": 1780,
"wires": [
[],
[],
[
"a24b581452b1d4c6"
],
[]
]
},
{
"id": "20c79aa6fc5cf853",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link in 16",
"links": [
"0f8e506b40d6ab4c"
],
"x": 115,
"y": 1600,
"wires": [
[
"8f1d92806f1af11f",
"f15c0ec84fefe063"
]
]
},
{
"id": "8f1d92806f1af11f",
"type": "BooleanLogicUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "",
"payloadPropName": "payload",
"filtertrue": "both",
"persist": true,
"sInitializeWith": "WaitForPayload",
"triggertopic": "trigger",
"outputtriggeredby": "all",
"inputCount": "2",
"topic": "price-fc",
"restrictinputevaluation": false,
"delayEvaluation": "0",
"translatorConfig": "",
"x": 300,
"y": 1660,
"wires": [
[
"cd49f0f75f3d949f"
],
[],
[]
]
},
{
"id": "964b56b00a9c50b7",
"type": "change",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "charge",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "charge",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 750,
"y": 1780,
"wires": [
[
"8d149755ca148829",
"e9aae8a399b0fa19"
]
]
},
{
"id": "985148527157a4ee",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1820,
"wires": []
},
{
"id": "5ad834e2a880a7ce",
"type": "function",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "nodered_b",
"func": "//\n/*\nlet hour = msg.payload\nlet topic = 'nr_dess_b'\n\nlet flow_get = 'dess'\nlet dess = flow.get( flow_get )\nlet get_dess_array = dess.output.b\n\nlet is_dess_array = get_dess_array[hour] !== undefined\nlet dess_array = ( is_dess_array ? get_dess_array[hour] : false )\n\nif ( is_dess_array )\n{\n let kWfactor = 1000\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = kWfactor * dess_array * multiplier \n dess_array = ( multiplied - multiplied % 1 ) / multiplier\n}\n\nlet fill = ( is_dess_array ? 'grey' : 'red')\nlet shape = 'dot'\nlet text = ( topic + ' : ' + dess_array )\nnode.status({fill, shape, text})\n\nmsg.payload = dess_array\nmsg.topic = topic\nreturn msg\n*/\n\n//\nlet hour = msg.payload\nlet output_object = 'b'\nlet topic = 'nodered_' + output_object\nlet get_flow_item = 'dess'\nlet flow_item = flow.get( get_flow_item )\nlet flow_object = flow_item.output[output_object]\nlet object_keys = Object.keys(flow_object).length\nlet is_object = ( object_keys > 0 )\nlet get_value = ( is_object ? flow_object[hour] : false )\n\nlet rounded = get_value\nif ( is_object)\n{\n let factor = 1000 //kW to W\n let digits = 3\n let multiplier = 10 ** digits\n let multiplied = rounded * factor * multiplier\n rounded = ( multiplied - multiplied % 1 ) / multiplier\n}\n\nlet fill = ( is_object ? 'green' : 'red')\nlet shape = 'dot'\nlet text = ( output_object + ' at ' + hour + 'h : ' + rounded + 'W')\nnode.status({fill, shape, text})\n\nmsg.payload = rounded\nmsg.text = text\nmsg.topic = topic\nreturn msg",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 230,
"y": 1420,
"wires": [
[
"ea268b31b0a04f39"
]
]
},
{
"id": "f00274ee3aead9f9",
"type": "function",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "nodered_fc (-)",
"func": "msg.payload = - msg.payload\nlet fill = 'grey'\nlet shape = 'dot'\nlet text = ( msg.payload )\nnode.status({fill, shape, text})\nmsg.topic = 'nodered_fc'\nreturn msg",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 620,
"y": 1420,
"wires": [
[
"e8a806ee6679078e",
"48840887dbe8e1ab",
"664a9401106afe9d"
]
]
},
{
"id": "e9aae8a399b0fa19",
"type": "rbe",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "dedup",
"func": "rbe",
"gap": "",
"start": "",
"inout": "out",
"septopics": false,
"property": "payload",
"topi": "topic",
"x": 750,
"y": 1820,
"wires": [
[
"b8ab6f6e58d27355",
"985148527157a4ee"
]
]
},
{
"id": "3cb6186863b5e1c5",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 770,
"y": 1500,
"wires": [
[
"41e5417e9f9424f5",
"6117e56c471d76c3",
"0f8e506b40d6ab4c"
]
]
},
{
"id": "48840887dbe8e1ab",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 770,
"y": 1420,
"wires": [
[
"4b05af0a35daa436"
]
]
},
{
"id": "8d149755ca148829",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 890,
"y": 1780,
"wires": [
[
"ec4520a1351024f8"
]
]
},
{
"id": "a24b581452b1d4c6",
"type": "InterruptFlowUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "AUTO",
"triggertopic": "master",
"initializewith": "1",
"autoToggle": "0",
"payloadPropName": "payload",
"translatorConfig": "",
"x": 540,
"y": 1780,
"wires": [
[
"964b56b00a9c50b7"
]
]
},
{
"id": "ca77e3cf803398fb",
"type": "Comparator",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "forecast >= setpoint",
"property": "payload",
"math": ">=",
"topic1": "nodered_fc",
"topic2": "setpoint",
"x": 430,
"y": 1500,
"wires": [
[
"f5ed7156153e4dbe"
]
]
},
{
"id": "f5ed7156153e4dbe",
"type": "change",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "nodered_charge",
"rules": [
{
"t": "set",
"p": "topic",
"pt": "msg",
"to": "nodered_charge",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 620,
"y": 1500,
"wires": [
[
"3cb6186863b5e1c5"
]
]
},
{
"id": "2279f310ec4e2f42",
"type": "inject",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": true,
"onceDelay": 0.1,
"topic": "setpoint",
"payload": "3000",
"payloadType": "num",
"x": 240,
"y": 1540,
"wires": [
[
"ca77e3cf803398fb"
]
]
},
{
"id": "8316001bac9be6b5",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1660,
"wires": []
},
{
"id": "3295daa35b749302",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1660,
"wires": []
},
{
"id": "cd49f0f75f3d949f",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 510,
"y": 1660,
"wires": [
[
"a24b581452b1d4c6",
"8316001bac9be6b5",
"3295daa35b749302"
]
]
},
{
"id": "4da2e4fb8ef9c092",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link in 18",
"links": [
"7f92ad276f401a33"
],
"x": 115,
"y": 1720,
"wires": [
[
"8f1d92806f1af11f",
"64e08cc19828e8b5"
]
]
},
{
"id": "b465d74a23bf4971",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1720,
"wires": []
},
{
"id": "feaaa5737bd8aa91",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1600,
"wires": []
},
{
"id": "1a6fbfe92bad130e",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "topic",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "topic",
"statusType": "msg",
"x": 890,
"y": 1360,
"wires": []
},
{
"id": "a173767a076a3c72",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1360,
"wires": []
},
{
"id": "4ff1f65593fa72da",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 770,
"y": 1360,
"wires": [
[
"1a6fbfe92bad130e",
"a173767a076a3c72",
"e495aa3dae6b229b"
]
]
},
{
"id": "3b646167607365a4",
"type": "link in",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link in 43",
"links": [
"1cc25eb445fcf8cc"
],
"x": 115,
"y": 1360,
"wires": [
[
"4ff1f65593fa72da"
]
]
},
{
"id": "664a9401106afe9d",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link out 6",
"mode": "link",
"links": [
"a902179e23f578c7"
],
"x": 1115,
"y": 1420,
"wires": []
},
{
"id": "0f8e506b40d6ab4c",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link out 8",
"mode": "link",
"links": [
"20c79aa6fc5cf853"
],
"x": 1115,
"y": 1500,
"wires": []
},
{
"id": "e495aa3dae6b229b",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link out 20",
"mode": "link",
"links": [
"ec77f0abe7da50fb"
],
"x": 1115,
"y": 1360,
"wires": []
},
{
"id": "ec4520a1351024f8",
"type": "link out",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "link out 47",
"mode": "link",
"links": [
"d61c38f2082425b7"
],
"x": 1115,
"y": 1780,
"wires": []
},
{
"id": "bbf8849cdd3ab166",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1600,
"wires": []
},
{
"id": "327a8e1e51cccf49",
"type": "debug",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "payload",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 1020,
"y": 1720,
"wires": []
},
{
"id": "f15c0ec84fefe063",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 770,
"y": 1600,
"wires": [
[
"feaaa5737bd8aa91",
"bbf8849cdd3ab166"
]
]
},
{
"id": "64e08cc19828e8b5",
"type": "StatusUltimate",
"z": "39aff6142244bf9b",
"g": "a9c10fb87af2e1b7",
"name": "Status",
"property": "payload",
"x": 750,
"y": 1720,
"wires": [
[
"b465d74a23bf4971",
"327a8e1e51cccf49"
]
]
},
{
"id": "68f3cb8cbbc1d6bb",
"type": "victron-dynamic-ess",
"z": "39aff6142244bf9b",
"g": "34b73fba4df2b7ba",
"name": "",
"vrm_id": "888888888888",
"vrmtoken": "8888888888888888888888888888888888888888888888888888888888888888",
"country": "nl",
"contract_buy": "AGILE-24-04-03",
"contract_sell": "AGILE-24-04-03",
"b_max": "90",
"fb_max": "5",
"tb_max": "8.5",
"fg_max": "9",
"tg_max": "4.5",
"b_cycle_cost": "0.1",
"buy_price_formula": "p*1.21",
"sell_price_formula": "p*1.21",
"green_mode_on": false,
"b_goal_hour": "18",
"b_goal_SOC": "95",
"feed_in_possible": true,
"feed_in_control_on": false,
"verbose": false,
"x": 200,
"y": 480,
"wires": [
[],
[],
[],
[]
]
},
{
"id": "cb2c784a33130f48",
"type": "config-vrm-api",
"name": "VRM"
}
]