Mijn Thuis-batterij

N1A. Node-Red & Zonneplan

Bij Zonneplan krijg je 2cnt extra wanneer je overdag tussen zonsopkomst en zonsondergang terugkeert.
Maar dit is niet in de de dynamische instellingen van de VRM in te stellen.

Ik heb hiervoor het volgende Node-Red script gemaakt, deze berekend op basis van jou GPS positie wat de zonsopkomst en zonsondergang is.

Als basis locatie heb ik Utrecht gebruikt omdat dit redelijk in het midden van het land light, maar de positie kun je instellen, door op “Utrecht” te kikken.

Vul dan de Lat en Lnk van je locatie in, je kunt deze hier opzoeken.

De formules kun je aanpassen in de groene blokjes:

Ik gebruik de formule van Harold met de aanpassing van Zonneplan tussen zonsopkomst en zonsondergang van 2cnt p/kWh. Klik hier voor het filmpje.
Deze formule stuurt meer aan op zelfconsumptie, er word alleen nog maar elektriciteit verkocht wanneer het echt lonend is.

Voor inkoop is de formule: (p + 0.0165 + 0.0915) * 1.21
Voor de verkoop is deze: (p + 0.01653) *1.21 tijdens zonsondergang en tijdens zonsopkomst ((p + 0.01653 ) * 1.10) * 1.21
De accu kosten staan op €:0.01 per kWh.

Het script word iedere nacht om “00:00” uur uitgevoerd.

Je moet alleen nog een API token aanmaken, je doet dat bij de “Voorkeuren” en vervolgens op “Intregaties” van de VRM.

Klik dan op “toevoegen”.

Geef de token een naam en klik dan op “Token aanmaken”.

Het Token ID word maar 1x verstrekt dus noteer deze goed.
Ik zet deze in mijn notieties.

Hieronder kun je het script downloaden:

[
{
"id": "31e3713bc9113957",
"type": "tab",
"label": "DESS Prijs Zonneplan",
"disabled": false,
"info": "",
"env": []
},
{
"id": "98a6cb70bc3e74b1",
"type": "function",
"z": "31e3713bc9113957",
"name": "Sunrise",
"func": "\nvar pl = msg.payload.split(\":\");\n\nvar sunrise_h = parseInt(pl[0]);\nvar sunrise_m = parseInt(pl[1]);\n\nif (msg.payload.kwartier == true) {\n if (sunrise_m > 0 && sunrise_m < 14) sunrise_m = 15;\n if (sunrise_m > 15 && sunrise_m < 30) sunrise_m = 30;\n if (sunrise_m > 30 && sunrise_m < 45) sunrise_m = 45;\n if (sunrise_m > 45 && sunrise_m < 60) {sunrise_m = 0; sunrise_h++;}\n} else {\n if (sunrise_m != 0) {sunrise_m = 0; sunrise_h++;}\n}\n\n\nvar sunrise_hh = sunrise_h < 10 ? \"0\" + sunrise_h : sunrise_h;\nvar sunrise_mm = sunrise_m < 10 ? \"0\" + sunrise_m : sunrise_m;\n\nmsg.payload = sunrise_hh + \":\" + sunrise_mm\n\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 340,
"wires": [
[
"7bf2604e0421effa"
]
]
},
{
"id": "2d7f014d2691def2",
"type": "function",
"z": "31e3713bc9113957",
"name": "Sunset",
"func": "\n\nvar pl = msg.payload.split(\":\");\n\nvar sunset_h = parseInt(pl[0]);\nvar sunset_m = parseInt(pl[1]);\n\nif (msg.payload.kwartier) {\n if (sunset_m > 0 && sunset_m < 14) sunset_m = 0;\n if (sunset_m > 15 && sunset_m < 30) sunset_m = 15;\n if (sunset_m > 30 && sunset_m < 45) sunset_m = 30;\n if (sunset_m > 45 && sunset_m < 60) sunset_m = 45;\n} else {\n if (sunset_m != 0) sunset_m = 0;\n}\n\nvar sunset_hh = sunset_h < 10 ? \"0\" + sunset_h : sunset_h;\nvar sunset_mm = sunset_m < 10 ? \"0\" + sunset_m : sunset_m;\n\nmsg.payload = sunset_hh + \":\" + sunset_mm;\n\nreturn msg;",
"outputs": 1,
"timeout": 0,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 340,
"y": 400,
"wires": [
[
"f9a8c448e2d264e7"
]
]
},
{
"id": "7bf2604e0421effa",
"type": "change",
"z": "31e3713bc9113957",
"name": "Set sunrise",
"rules": [
{
"t": "set",
"p": "sunrise",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 340,
"wires": [
[
"d11f2fe6ee30e73a"
]
]
},
{
"id": "f9a8c448e2d264e7",
"type": "change",
"z": "31e3713bc9113957",
"name": "Set sunset",
"rules": [
{
"t": "set",
"p": "sunset",
"pt": "global",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 510,
"y": 400,
"wires": [
[
"0fb6760f4a927bdb"
]
]
},
{
"id": "a1860632f2f4e18d",
"type": "vrm-api",
"z": "31e3713bc9113957",
"vrm": "a2bfb9c74d6d15f8",
"name": "Get",
"api_type": "installations",
"idUser": "",
"usersQuery": "me",
"idSite": "0",
"installations": "dynamic-ess-settings",
"attribute": "",
"stats_interval": "",
"show_instance": false,
"stats_start": "",
"stats_end": "",
"use_utc": false,
"gps_start": "",
"gps_end": "",
"widgets": "",
"instance": "",
"store_in_global_context": false,
"verbose": false,
"transform_price_schedule": false,
"outputs": 1,
"x": 250,
"y": 680,
"wires": [
[
"87b51d6ba0d53bc6"
]
]
},
{
"id": "87b51d6ba0d53bc6",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 9",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 380,
"y": 680,
"wires": []
},
{
"id": "d11f2fe6ee30e73a",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 12",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 960,
"y": 340,
"wires": []
},
{
"id": "0fb6760f4a927bdb",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 13",
"active": true,
"tosidebar": false,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 960,
"y": 400,
"wires": []
},
{
"id": "9d50c75859134e53",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 5",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 260,
"wires": []
},
{
"id": "243721df2cb7e4bb",
"type": "change",
"z": "31e3713bc9113957",
"name": "",
"rules": [
{
"t": "set",
"p": "store",
"pt": "msg",
"to": "payload",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 440,
"y": 280,
"wires": [
[
"1ef6e48977822311"
]
]
},
{
"id": "1ef6e48977822311",
"type": "template",
"z": "31e3713bc9113957",
"name": "create the URL",
"field": "url",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "https://api.sunrisesunset.io/json?time_format=24&lat={{store.lat}}&lng={{store.lng}}",
"output": "str",
"x": 620,
"y": 280,
"wires": [
[
"50d73bb42fd381ba"
]
]
},
{
"id": "50d73bb42fd381ba",
"type": "http request",
"z": "31e3713bc9113957",
"name": "",
"method": "GET",
"ret": "obj",
"paytoqs": "ignore",
"url": "",
"tls": "",
"persist": false,
"proxy": "",
"insecureHTTPParser": false,
"authType": "",
"senderr": false,
"headers": [],
"x": 790,
"y": 280,
"wires": [
[
"9d50c75859134e53",
"aafdd9e69636e5a5"
]
]
},
{
"id": "9c3db00f4567d165",
"type": "inject",
"z": "31e3713bc9113957",
"name": "Utrecht",
"props": [
{
"p": "payload.city",
"v": "Utrecht",
"vt": "str"
},
{
"p": "payload.lat",
"v": "52.0907006",
"vt": "str"
},
{
"p": "payload.lng",
"v": "5.1215634",
"vt": "str"
},
{
"p": "payload.kwartier",
"v": "false",
"vt": "bool"
}
],
"repeat": "",
"crontab": "00 00 * * *",
"once": true,
"onceDelay": 0.1,
"topic": "",
"x": 120,
"y": 280,
"wires": [
[
"d4544f739ee34bf3"
]
]
},
{
"id": "e883388f5f6d5db3",
"type": "change",
"z": "31e3713bc9113957",
"name": "Set Sunrise",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.results.sunrise",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 170,
"y": 340,
"wires": [
[
"98a6cb70bc3e74b1"
]
]
},
{
"id": "266d6774107ae6f2",
"type": "change",
"z": "31e3713bc9113957",
"name": "Set Senset",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.results.sunset",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 170,
"y": 400,
"wires": [
[
"2d7f014d2691def2"
]
]
},
{
"id": "e879119c7a4414f0",
"type": "inject",
"z": "31e3713bc9113957",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "",
"payloadType": "date",
"x": 120,
"y": 680,
"wires": [
[
"a1860632f2f4e18d"
]
]
},
{
"id": "aafdd9e69636e5a5",
"type": "link out",
"z": "31e3713bc9113957",
"name": "Set Sunrise & Sunset",
"mode": "link",
"links": [
"fa5243c343a2a62d",
"82ef6f957ad71c4f",
"cfb0b92a80922349",
"eae9c9ba2cf3ad21",
"7015de8a7e4a191c"
],
"x": 915,
"y": 300,
"wires": []
},
{
"id": "fa5243c343a2a62d",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 5",
"links": [
"aafdd9e69636e5a5"
],
"x": 55,
"y": 340,
"wires": [
[
"e883388f5f6d5db3"
]
]
},
{
"id": "82ef6f957ad71c4f",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 6",
"links": [
"aafdd9e69636e5a5"
],
"x": 55,
"y": 400,
"wires": [
[
"266d6774107ae6f2"
]
]
},
{
"id": "d4544f739ee34bf3",
"type": "link out",
"z": "31e3713bc9113957",
"name": "Call",
"mode": "link",
"links": [
"6083f8cf7cc1237a",
"bfe7c48ecee05609"
],
"x": 255,
"y": 280,
"wires": []
},
{
"id": "6083f8cf7cc1237a",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 7",
"links": [
"d4544f739ee34bf3"
],
"x": 325,
"y": 280,
"wires": [
[
"243721df2cb7e4bb"
]
]
},
{
"id": "08e441752edf9ea4",
"type": "comment",
"z": "31e3713bc9113957",
"name": "Set the Sell price dynamicaly in de Dynamic ESS settings page.",
"info": "",
"x": 270,
"y": 40,
"wires": []
},
{
"id": "5fbbc75225b3334b",
"type": "comment",
"z": "31e3713bc9113957",
"name": "Get",
"info": "",
"x": 90,
"y": 640,
"wires": []
},
{
"id": "2b8604854810620b",
"type": "vrm-api",
"z": "31e3713bc9113957",
"vrm": "a2bfb9c74d6d15f8",
"name": "Set",
"api_type": "installations",
"idUser": "",
"usersQuery": "me",
"idSite": "789886",
"installations": "patch-dynamic-ess-settings",
"attribute": "",
"stats_interval": "",
"show_instance": false,
"stats_start": "",
"stats_end": "",
"use_utc": false,
"gps_start": "",
"gps_end": "",
"widgets": "",
"instance": "",
"store_in_global_context": false,
"verbose": true,
"transform_price_schedule": false,
"outputs": 1,
"x": 750,
"y": 460,
"wires": [
[
"8a85a972e8b93a40"
]
]
},
{
"id": "9d57867bb05c87c2",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 10",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 580,
"y": 680,
"wires": []
},
{
"id": "f5b3da5c38dc8405",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 15",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 520,
"wires": []
},
{
"id": "cfb0b92a80922349",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 9",
"links": [
"aafdd9e69636e5a5"
],
"x": 55,
"y": 520,
"wires": [
[
"cfb1ddbd955aea86"
]
]
},
{
"id": "eae9c9ba2cf3ad21",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 8",
"links": [
"aafdd9e69636e5a5"
],
"x": 475,
"y": 100,
"wires": [
[
"8d6fdb086225cda5"
]
]
},
{
"id": "7015de8a7e4a191c",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 10",
"links": [
"aafdd9e69636e5a5"
],
"x": 475,
"y": 160,
"wires": [
[
"56c36f11cd1329aa"
]
]
},
{
"id": "8d6fdb086225cda5",
"type": "change",
"z": "31e3713bc9113957",
"name": "Set Formula fsr (SunRise)",
"rules": [
{
"t": "set",
"p": "fsr",
"pt": "global",
"to": "((p+0.01653)*1.10)*1.21",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 630,
"y": 100,
"wires": [
[]
]
},
{
"id": "56c36f11cd1329aa",
"type": "change",
"z": "31e3713bc9113957",
"name": "Set Formula fss (SunSet)",
"rules": [
{
"t": "set",
"p": "fss",
"pt": "global",
"to": "(p+0.01653)*1.21",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 630,
"y": 160,
"wires": [
[]
]
},
{
"id": "8a85a972e8b93a40",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 3",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "false",
"statusVal": "",
"statusType": "auto",
"x": 960,
"y": 460,
"wires": []
},
{
"id": "cfb1ddbd955aea86",
"type": "template",
"z": "31e3713bc9113957",
"name": "",
"field": "payload",
"fieldType": "msg",
"format": "json",
"syntax": "plain",
"template": "{\"###\"[{\\\"days\\\":[0,1,2,3,4,5,6],\\\"schedule\\\":[{\\\"from\\\":\\\"00:00\\\",\\\"to\\\":\\\"#sunrise#\\\",\\\"formula\\\":\\\"#fss#\\\"},{\\\"from\\\":\\\"#sunrise#\\\",\\\"to\\\":\\\"#sunset#\\\",\\\"formula\\\":\\\"#fsr#\\\"},{\\\"from\\\":\\\"#sunset#\\\",\\\"to\\\":\\\"00:00\\\",\\\"formula\\\":\\\"#fss#\\\"}]}]\"}",
"output": "str",
"x": 180,
"y": 520,
"wires": [
[
"a34a1eda75a1f976"
]
]
},
{
"id": "a34a1eda75a1f976",
"type": "change",
"z": "31e3713bc9113957",
"name": "",
"rules": [
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "#sunrise#",
"fromt": "str",
"to": "sunrise",
"tot": "global"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "#sunset#",
"fromt": "str",
"to": "sunset",
"tot": "global"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "#fsr#",
"fromt": "str",
"to": "fsr",
"tot": "global"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "#fss#",
"fromt": "str",
"to": "fss",
"tot": "global"
},
{
"t": "change",
"p": "payload",
"pt": "msg",
"from": "###",
"fromt": "str",
"to": "sellPriceFormulaSchedule\":",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 400,
"y": 520,
"wires": [
[
"b2dd5991c2c121f0"
]
]
},
{
"id": "b2dd5991c2c121f0",
"type": "json",
"z": "31e3713bc9113957",
"name": "",
"property": "payload",
"action": "",
"pretty": true,
"x": 570,
"y": 520,
"wires": [
[
"f5b3da5c38dc8405",
"2b8604854810620b"
]
]
},
{
"id": "cb577c27d8df2b4f",
"type": "comment",
"z": "31e3713bc9113957",
"name": "Stel hier de formule in voor overdag",
"info": "Bij Zonneplan krijg je €:0,02 cent extra tijdens de daglicht uren.\n\nHiervoor is de formule:\n((p+0.0165+0.0915)*1.10)*1.21\n\n===========================================================\nHierbij is \"p\" de epex prijs \n\nJe krijgt 2cnt extra tijden de dag, dat is incl btw en dat is weer excl. btw €: 0,0165.\n\nVerder betaal je €: 0,0915 excl. btw aan belasting. \n",
"x": 180,
"y": 100,
"wires": []
},
{
"id": "79df30af6d2c09b3",
"type": "comment",
"z": "31e3713bc9113957",
"name": "Stel hier de formule in voor de donkere periode",
"info": "Bij Zonneplan krijg je €:0,02 cent extra tijdens de daglicht uren.\n\nHiervoor is de formule:\n(p+0.0165+0.0915)*1.21\n\n===========================================================\nHierbij is \"p\" de epex prijs \n\nAan Zonneplan betaal je 2cnt incl btw, dat is excl. btw €: 0,0165.\n\nVerder betaal je €: 0,0915 excl. btw aan belasting. \n",
"x": 220,
"y": 160,
"wires": []
},
{
"id": "2a192d311df70323",
"type": "comment",
"z": "31e3713bc9113957",
"name": "Als uitgangspunt heb ik Utrecht genomen, omdat dit redelijk in het midden van het land ligt..",
"info": "Je kunt hier de lokale GPS positie opgeven voor jouw woonplaats",
"x": 350,
"y": 240,
"wires": []
},
{
"id": "deb37d101380bffd",
"type": "debug",
"z": "31e3713bc9113957",
"name": "debug 1",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": true,
"complete": "payload",
"targetType": "msg",
"statusVal": "payload",
"statusType": "auto",
"x": 960,
"y": 180,
"wires": []
},
{
"id": "bfe7c48ecee05609",
"type": "link in",
"z": "31e3713bc9113957",
"name": "link in 11",
"links": [
"d4544f739ee34bf3"
],
"x": 845,
"y": 180,
"wires": [
[
"deb37d101380bffd"
]
]
},
{
"id": "a2bfb9c74d6d15f8",
"type": "config-vrm-api",
"name": "dess",
"forceIpv4": false
},
{
"id": "a5ab93f5fca9d726",
"type": "global-config",
"env": [],
"modules": {
"victron-vrm-api": "0.3.11"
}
}
]