UNPKG

@iseeberg79/battery-usage-optimization-nodes

Version:
2,106 lines 54.4 kB
[ { "id": "0b8b5d37e2f6870d", "type": "tab", "label": "Example", "disabled": true, "info": "", "env": [] }, { "id": "c814c1258fca691b", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" }, { "p": "payload" } ], "repeat": "3600", "crontab": "", "once": true, "onceDelay": "20", "topic": "", "payload": "pvForecast1", "payloadType": "global", "x": 160, "y": 280, "wires": [ [ "b23b9ea49715ef77" ] ] }, { "id": "a6a33a7f44b8e2b5", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "erwarteter Solarertrag zweier PV Anlagen - stündlich", "info": "", "x": 290, "y": 240, "wires": [] }, { "id": "c2151b9f35b9b1a2", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": "10", "topic": "", "x": 110, "y": 180, "wires": [ [ "73ed64c5a8f44e54", "7291946152aa2961" ] ] }, { "id": "c8e23295d61a5349", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 880, "y": 160, "wires": [] }, { "id": "59831b40673936d4", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "pvForecast1", "pt": "global", "to": "payload", "tot": "msg" }, { "t": "set", "p": "pvForecast1", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 180, "wires": [ [ "c8e23295d61a5349", "ec778bfdb5482b51" ] ] }, { "id": "e220a6ab1baf9248", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 880, "y": 240, "wires": [] }, { "id": "cdc10bf472f66a97", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "pvForecast1", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 280, "wires": [ [ "e220a6ab1baf9248", "ec778bfdb5482b51" ] ] }, { "id": "a0781184c27fb37d", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Abruf des erwarten Solarertrags von zwei PV Anlagen - täglich", "info": "", "x": 320, "y": 140, "wires": [] }, { "id": "ebbcaa4c66e56a8a", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Abruf des erwarten Strompreises (Fraunhofer ISE)", "info": "", "x": 290, "y": 360, "wires": [] }, { "id": "324b33d71d619ece", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" }, { "p": "charges", "v": "12.945", "vt": "num" }, { "p": "tax", "v": "19", "vt": "num" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": "10", "topic": "", "x": 110, "y": 400, "wires": [ [ "11cc1e76689ba1f4" ] ] }, { "id": "6e9e8acfbb64752f", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "gridPrices", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "energy.priceData", "pt": "global", "to": "gridPrices.prices", "tot": "flow" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 400, "wires": [ [ "ab822f55e6600851" ] ] }, { "id": "ab822f55e6600851", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 400, "wires": [] }, { "id": "26fe6007c6e42349", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Abruf des erwarten Strompreises (evcc)", "info": "", "x": 250, "y": 460, "wires": [] }, { "id": "ab68d091115d72d5", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "3600", "crontab": "", "once": true, "onceDelay": "10", "topic": "", "x": 110, "y": 500, "wires": [ [ "411cbc6f3bda7130" ] ] }, { "id": "91ef3697b1d23803", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 500, "wires": [] }, { "id": "3376f2f5af4434f1", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "gridPrices", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "energy.priceData", "pt": "global", "to": "gridPrices.prices", "tot": "flow" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 500, "wires": [ [ "91ef3697b1d23803" ] ] }, { "id": "0b74cc2a4341730d", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" }, { "p": "profile", "v": "[0.4,0.4,0.4,0.4,0.4,0.4,1,1,0.4,0.4,0.4,0.4,1,1,0.4,0.4,0.4,1,1,1,1,1,0.4,0.4]", "vt": "jsonata" } ], "repeat": "3600", "crontab": "", "once": true, "onceDelay": "20", "topic": "", "x": 110, "y": 600, "wires": [ [ "318f073259d4193a" ] ] }, { "id": "06dbb167db2e8ddb", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "household", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "energy.household", "pt": "global", "to": "household.profile", "tot": "flow" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 600, "wires": [ [ "8c4be2ba1874e727" ] ] }, { "id": "8c4be2ba1874e727", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 600, "wires": [] }, { "id": "d2479802bbab8294", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Berechnung der benötigen Energie (Stromverbrauch)", "info": "", "x": 290, "y": 560, "wires": [] }, { "id": "ef49d4c218b58240", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Auswertung des heutigen Steuerungsmodus (1-2x täglich)", "info": "", "x": 310, "y": 660, "wires": [] }, { "id": "57422ed1ac334835", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Berechnung des aktuellen Batteriemodus, 5-minütlich", "info": "", "x": 300, "y": 800, "wires": [] }, { "id": "a60d24c7f3334cab", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Berechnung des aktuellen Batteriemodus, watchdog-Intervall", "info": "", "x": 320, "y": 920, "wires": [] }, { "id": "7fffc2a556e187e5", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "Mitternacht", "props": [ { "p": "average", "v": "gridPrices.average", "vt": "flow" }, { "p": "diff", "v": "gridPrices.diff", "vt": "flow" }, { "p": "deviation", "v": "gridPrices.deviation", "vt": "flow" }, { "p": "pvforecast", "v": "pvForecast.today", "vt": "flow" }, { "p": "avgWeekly", "v": "avgGridPriceWeekly", "vt": "flow" }, { "p": "priceLimit", "v": "lastGridChargePrice", "vt": "flow" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "10 00 * * *", "once": true, "onceDelay": "20", "topic": "", "x": 130, "y": 700, "wires": [ [ "6933bf565f948b6b" ] ] }, { "id": "f46f9d2522cb76f2", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" }, { "p": "optimize", "v": "control.optimize", "vt": "flow" }, { "p": "optimize", "v": "true", "vt": "bool" }, { "p": "enableGridcharge", "v": "control.gridcharge", "vt": "flow" }, { "p": "enableGridcharge", "v": "true", "vt": "bool" }, { "p": "batterymode", "v": "batterymode", "vt": "flow" }, { "p": "soc", "v": "evcc.batterySoc", "vt": "flow" }, { "p": "minimum", "v": "gridPrices.minimum", "vt": "flow" }, { "p": "price", "v": "evcc.tariffGrid", "vt": "flow" }, { "p": "pvforecast", "v": "pvForecast.remain", "vt": "flow" }, { "p": "lastGridchargePrice", "v": "lastGridchargePrice", "vt": "flow" }, { "p": "average", "v": "gridPrices.average", "vt": "flow" }, { "p": "avgGridPriceWeekly", "v": "avgGridPriceWeekly", "vt": "flow" }, { "p": "estimator", "v": "estimator", "vt": "flow" } ], "repeat": "60", "crontab": "", "once": true, "onceDelay": "40", "topic": "", "x": 110, "y": 840, "wires": [ [ "cefb46bd96aa111d" ] ] }, { "id": "ad145c45825a6bbb", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "optimize", "v": "true", "vt": "bool" }, { "p": "batterymode", "v": "batterymode", "vt": "flow" }, { "p": "evccBatteryMode", "v": "evcc.batteryMode", "vt": "flow" }, { "p": "actualsoc", "v": "evcc.batterySoc", "vt": "flow" }, { "p": "minsoc", "v": "minsoc", "vt": "flow" }, { "p": "price", "v": "0.2895", "vt": "num" }, { "p": "price", "v": "evcc.tariffGrid", "vt": "flow" }, { "p": "topic", "vt": "str" } ], "repeat": "20", "crontab": "", "once": true, "onceDelay": "60", "topic": "", "x": 110, "y": 980, "wires": [ [ "af8d5fca29264f35" ] ] }, { "id": "6b322cae4a54aad2", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 700, "wires": [] }, { "id": "45356e551cdb9d63", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 780, "wires": [] }, { "id": "d882e3d4995180e7", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 840, "wires": [] }, { "id": "2b1666e8cc801121", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 960, "wires": [] }, { "id": "35e77e7c208ad0da", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 1020, "wires": [] }, { "id": "4d5250ebc309eed8", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 1080, "wires": [] }, { "id": "df4362019424ebff", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 860, "y": 1140, "wires": [] }, { "id": "bc83ffe09694e85c", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "true", "targetType": "full", "statusVal": "", "statusType": "auto", "x": 860, "y": 900, "wires": [] }, { "id": "84ba259a38d29940", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "control", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 700, "wires": [ [ "6b322cae4a54aad2" ] ] }, { "id": "173f8dfa4a086eee", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "batterymode", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 780, "wires": [ [ "45356e551cdb9d63" ] ] }, { "id": "dc91923fc51f7263", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "lastGridchargePrice", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 840, "wires": [ [ "d882e3d4995180e7" ] ] }, { "id": "8d5d7b59c36772e2", "type": "comment", "z": "0b8b5d37e2f6870d", "name": "Abruf der aktuellen Leistungsdaten (evcc)", "info": "", "x": 260, "y": 60, "wires": [] }, { "id": "d6a7785a276a249b", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" } ], "repeat": "30", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "x": 110, "y": 100, "wires": [ [ "98c223deab12de15" ] ] }, { "id": "103c0cebb0801aac", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 880, "y": 100, "wires": [] }, { "id": "158bc5da842e61c3", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "evcc", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "energy.soc", "pt": "global", "to": "evcc.batterySoc", "tot": "flow" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 700, "y": 100, "wires": [ [ "103c0cebb0801aac" ] ] }, { "id": "46a0796815092b07", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "setBatterySoc", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 960, "wires": [ [ "2b1666e8cc801121" ] ] }, { "id": "d634e5b4de633d92", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "setBatteryMode", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 1000, "wires": [ [ "35e77e7c208ad0da" ] ] }, { "id": "066cc836848d5026", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "lastGridChargePrice", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 680, "y": 1040, "wires": [ [ "4d5250ebc309eed8" ] ] }, { "id": "73ed64c5a8f44e54", "type": "@iseeberg79/EvaluateSolarForecast", "z": "0b8b5d37e2f6870d", "name": "", "rooftopid": "", "token": "", "url": "", "x": 370, "y": 180, "wires": [ [ "59831b40673936d4" ] ] }, { "id": "b23b9ea49715ef77", "type": "@iseeberg79/EstimateSolarEnergy", "z": "0b8b5d37e2f6870d", "name": "", "x": 400, "y": 280, "wires": [ [ "cdc10bf472f66a97" ] ] }, { "id": "11cc1e76689ba1f4", "type": "@iseeberg79/EvaluateGridEnergyPrices", "z": "0b8b5d37e2f6870d", "name": "", "bzn": "DE-LU", "url": "https://api.energy-charts.info/price", "x": 380, "y": 400, "wires": [ [ "6e9e8acfbb64752f" ] ] }, { "id": "411cbc6f3bda7130", "type": "@iseeberg79/EvaluateGridEnergyPricesAPI", "z": "0b8b5d37e2f6870d", "name": "", "url": "http://localhost:7070/api/tariff/grid", "x": 390, "y": 500, "wires": [ [ "3376f2f5af4434f1" ] ] }, { "id": "318f073259d4193a", "type": "@iseeberg79/EstimateHouseholdConsumption", "z": "0b8b5d37e2f6870d", "name": "", "x": 400, "y": 600, "wires": [ [ "06dbb167db2e8ddb" ] ] }, { "id": "c77b8fe6abe47e6d", "type": "@iseeberg79/DetermineControlMode", "z": "0b8b5d37e2f6870d", "name": "", "minPvRequired": "10000", "minPriceDeviation": "", "minPriceDifference": "", "priceLimit": "", "avg": "", "x": 490, "y": 700, "wires": [ [ "84ba259a38d29940" ] ] }, { "id": "cefb46bd96aa111d", "type": "@iseeberg79/DetermineBatteryMode", "z": "0b8b5d37e2f6870d", "name": "", "enableGridchargeThreshold": "", "disableGridchargeThreshold": "", "batteryCapacity": "", "minsoc": "", "maxsoc": "", "efficiency": "", "x": 370, "y": 840, "wires": [ [ "173f8dfa4a086eee" ], [ "dc91923fc51f7263" ], [ "bc83ffe09694e85c" ] ] }, { "id": "af8d5fca29264f35", "type": "@iseeberg79/ControlBattery", "z": "0b8b5d37e2f6870d", "name": "", "configuredMinSoC": "", "maximumGridprice": "", "configuredBatteryLock": false, "x": 340, "y": 980, "wires": [ [ "46a0796815092b07" ], [ "d634e5b4de633d92" ], [ "066cc836848d5026" ], [ "df4362019424ebff" ] ] }, { "id": "98c223deab12de15", "type": "@iseeberg79/DeterminePowerValues", "z": "0b8b5d37e2f6870d", "name": "", "url": "http://localhost:7070/api/state", "x": 390, "y": 100, "wires": [ [ "158bc5da842e61c3" ] ] }, { "id": "7291946152aa2961", "type": "@iseeberg79/EvaluateSolarForecast", "z": "0b8b5d37e2f6870d", "name": "", "rooftopid": "", "token": "", "url": "", "x": 390, "y": 200, "wires": [ [ "c268397e63a23ef9" ] ] }, { "id": "c268397e63a23ef9", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "pvForecast2", "pt": "global", "to": "payload", "tot": "msg" }, { "t": "set", "p": "pvForecast2", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 700, "y": 200, "wires": [ [ "ec778bfdb5482b51" ] ] }, { "id": "c70d1185a6bb8ff3", "type": "@iseeberg79/EstimateSolarEnergy", "z": "0b8b5d37e2f6870d", "name": "", "x": 420, "y": 300, "wires": [ [ "fa037f70cc8d5c4f" ] ] }, { "id": "61e2d5bbf8461420", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "topic", "vt": "str" }, { "p": "payload" } ], "repeat": "3600", "crontab": "", "once": true, "onceDelay": "20", "topic": "", "payload": "pvForecast2", "payloadType": "global", "x": 180, "y": 300, "wires": [ [ "c70d1185a6bb8ff3" ] ] }, { "id": "fa037f70cc8d5c4f", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "pvForecast2", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 700, "y": 300, "wires": [ [ "ec778bfdb5482b51" ] ] }, { "id": "ec778bfdb5482b51", "type": "change", "z": "0b8b5d37e2f6870d", "name": "summieren", "rules": [ { "t": "set", "p": "pv1", "pt": "msg", "to": "pvForecast1", "tot": "flow" }, { "t": "set", "p": "pv2", "pt": "msg", "to": "pvForecast2", "tot": "flow" }, { "t": "set", "p": "payload", "pt": "msg", "to": "{ \"today\": pv1.today + pv2.today, \"tomorrow\": pv1.tomorrow + pv2.tomorrow, \"remain\": pv1.remain + pv2.remain }", "tot": "jsonata" }, { "t": "set", "p": "pvForecast", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "energy.pvforecast", "pt": "global", "to": "pvForecast2.forecasts", "tot": "flow" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 890, "y": 300, "wires": [ [ "f3e65588e9c3bfc1" ] ] }, { "id": "f3e65588e9c3bfc1", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 1060, "y": 300, "wires": [] }, { "id": "6933bf565f948b6b", "type": "change", "z": "0b8b5d37e2f6870d", "name": "Maximum", "rules": [ { "t": "set", "p": "tomorrow", "pt": "msg", "to": "pvForecast.tomorrow", "tot": "flow" }, { "t": "set", "p": "today", "pt": "msg", "to": "pvforecast", "tot": "msg" }, { "t": "set", "p": "pvforecast", "pt": "msg", "to": "$max([$number(today),$number(tomorrow)])", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 300, "y": 700, "wires": [ [ "c77b8fe6abe47e6d" ] ] }, { "id": "98d954ca97cc59a5", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "avgGridPriceWeekly", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 880, "y": 1300, "wires": [ [ "c01558d89612f410" ] ] }, { "id": "c01558d89612f410", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 1020, "y": 1300, "wires": [] }, { "id": "f4e1b881b70b1515", "type": "ioBroker in", "z": "0b8b5d37e2f6870d", "name": "price_avg_weekly", "attrname": "payload", "topic": "alias.0.energy.grid.price_avg_weekly", "payloadType": "value", "onlyack": "", "func": "rbe-preinitvalue", "gap": "", "fireOnStart": "false", "outFormat": "MQTT", "x": 560, "y": 1330, "wires": [ [ "fc930de34be88341" ] ] }, { "id": "37ebd20a9e8cbb06", "type": "ioBroker get", "z": "0b8b5d37e2f6870d", "name": "", "topic": "alias.0.energy.grid.price_avg_weekly", "attrname": "payload", "payloadType": "value", "errOnInvalidState": "nothing", "x": 500, "y": 1290, "wires": [ [ "fc930de34be88341" ] ] }, { "id": "eff46a92c81dbae7", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 1240, "wires": [ [ "d5966f329aa35b78" ] ] }, { "id": "d5966f329aa35b78", "type": "change", "z": "0b8b5d37e2f6870d", "name": "initialisieren", "rules": [ { "t": "set", "p": "lastGridchargePrice", "pt": "flow", "to": "0.095", "tot": "num" }, { "t": "set", "p": "lastMessage", "pt": "flow", "to": "initial", "tot": "str" }, { "t": "set", "p": "batteryModeTS", "pt": "flow", "to": "", "tot": "date" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 290, "y": 1240, "wires": [ [ "37ebd20a9e8cbb06", "1ed054933cd8314a" ] ] }, { "id": "fc930de34be88341", "type": "json", "z": "0b8b5d37e2f6870d", "name": "", "property": "payload", "action": "obj", "pretty": false, "x": 750, "y": 1300, "wires": [ [ "98d954ca97cc59a5" ] ] }, { "id": "1ed054933cd8314a", "type": "ioBroker get", "z": "0b8b5d37e2f6870d", "name": "", "topic": "alias.0.energy.battery.minsoc", "attrname": "payload", "payloadType": "value", "errOnInvalidState": "nothing", "x": 530, "y": 1240, "wires": [ [ "44a17aab9efb073f" ] ] }, { "id": "44a17aab9efb073f", "type": "json", "z": "0b8b5d37e2f6870d", "name": "", "property": "payload", "action": "obj", "pretty": false, "x": 750, "y": 1240, "wires": [ [ "f121ded33aa09ebb" ] ] }, { "id": "f121ded33aa09ebb", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "minsoc", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 880, "y": 1240, "wires": [ [ "bf0d4f7137589d21" ] ] }, { "id": "51d76b4bc3ce9403", "type": "ioBroker in", "z": "0b8b5d37e2f6870d", "name": "", "attrname": "payload", "topic": "alias.0.energy.battery.minsoc", "payloadType": "value", "onlyack": "", "func": "rbe-preinitvalue", "gap": "", "fireOnStart": "false", "outFormat": "MQTT", "x": 530, "y": 1190, "wires": [ [ "44a17aab9efb073f" ] ] }, { "id": "bf0d4f7137589d21", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 1020, "y": 1240, "wires": [] }, { "id": "a52d5d6ead953b43", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "14 Uhr", "props": [ { "p": "average", "v": "gridPrices.average", "vt": "flow" }, { "p": "diff", "v": "gridPrices.diff", "vt": "flow" }, { "p": "deviation", "v": "gridPrices.deviation", "vt": "flow" }, { "p": "pvforecast", "v": "pvForecast.today", "vt": "flow" }, { "p": "avgWeekly", "v": "avgGridPriceWeekly", "vt": "flow" }, { "p": "priceLimit", "v": "lastGridChargePrice", "vt": "flow" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "00 14 * * *", "once": false, "onceDelay": "20", "topic": "", "x": 120, "y": 740, "wires": [ [ "6933bf565f948b6b" ] ] }, { "id": "c577a75af380b456", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "force charge", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 1500, "wires": [ [ "0173975d276a3397" ] ] }, { "id": "0173975d276a3397", "type": "change", "z": "0b8b5d37e2f6870d", "name": "", "rules": [ { "t": "set", "p": "control", "pt": "flow", "to": "{\"optimize\":true,\"gridcharge\":true,\"mode\":\"GRID\"}", "tot": "jsonata" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 310, "y": 1500, "wires": [ [] ] }, { "id": "9e1946a96f333ac9", "type": "function", "z": "0b8b5d37e2f6870d", "name": "transformieren", "func": "const startTimestamp = (new Date()).setHours(0,0,0,0);\nconst interval = 60 * 60 * 1000;\n\n// Transformation priceData\nconst transformPriceData = (data) => {\n return data.map(item => ({\n value: item.price,\n start: item.start,\n exportPrice: 0.079, // Bei Bedarf anpassen\n importPrice: item.price\n }));\n};\n\n// Transformation productionForecast\nconst transformProductionForecast = (data) => {\n return data.map(item => ({\n start: new Date(new Date(item.period_end).getTime() - 3600000).toISOString(),\n value: item.pv_estimate // in kWh\n }));\n};\n\n// Transformation consumptionForecast\nconst transformConsumptionForecast = (data, startTimestamp, interval) => {\n return data.map((value, index) => ({\n start: (new Date(startTimestamp + index * interval)).toISOString(),\n value: value // in kWh\n }));\n};\n\nconst priceData = msg.input.priceData;\nconst productionForecast = msg.input.pvforecast;\nconst consumptionForecast = msg.input.household;\n\nconst transformedData = {\n priceData: transformPriceData(priceData),\n productionForecast: transformProductionForecast(productionForecast),\n consumptionForecast: transformConsumptionForecast(consumptionForecast, startTimestamp, interval),\n soc: msg.input.soc\n};\n\ndelete msg.input;\n\nmsg.payload = transformedData;\n\nreturn msg;", "outputs": 1, "timeout": 0, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 320, "y": 1400, "wires": [ [ "17772782358bc77e" ] ] }, { "id": "17772782358bc77e", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "energy", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 500, "y": 1400, "wires": [ [ "10d5a08f10a3bdca" ] ] }, { "id": "b1e387827dc7d81f", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "energy", "payloadType": "flow", "x": 490, "y": 1440, "wires": [ [ "10d5a08f10a3bdca" ] ] }, { "id": "10d5a08f10a3bdca", "type": "@iseeberg79/EstimateBatterymode", "z": "0b8b5d37e2f6870d", "name": "", "batteryBuffer": "", "batteryCapacity": "", "maxCharge": "", "feedin": "", "efficiency": "", "performance": "", "x": 700, "y": 1400, "wires": [ [ "5a1776c68020b3fd" ] ] }, { "id": "5a1776c68020b3fd", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "calculatedEnergyFlow", "pt": "flow", "to": "payload", "tot": "msg" }, { "t": "set", "p": "estimator", "pt": "flow", "to": "payload.batteryModes", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 880, "y": 1400, "wires": [ [ "ba7aef57e47318de" ] ] }, { "id": "ba7aef57e47318de", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Ergebnis", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targetType": "full", "statusVal": "payload", "statusType": "msg", "x": 1020, "y": 1400, "wires": [] }, { "id": "bd4867a8d5520917", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "Bereitstellung", "props": [ { "p": "topic", "vt": "str" }, { "p": "input.household", "v": "energy.household", "vt": "global" }, { "p": "input.priceData", "v": "energy.priceData", "vt": "global" }, { "p": "input.pvforecast", "v": "energy.pvforecast", "vt": "global" }, { "p": "input.soc", "v": "energy.soc", "vt": "global" }, { "p": "debug", "v": "false", "vt": "bool" }, { "p": "charge", "v": "false", "vt": "bool" } ], "repeat": "3600", "crontab": "", "once": true, "onceDelay": "35", "topic": "", "x": 140, "y": 1400, "wires": [ [ "9e1946a96f333ac9" ] ] }, { "id": "c7800eb6ba4594f5", "type": "inject", "z": "0b8b5d37e2f6870d", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 120, "y": 1580, "wires": [ [ "aa86585d6188c4c0" ] ] }, { "id": "0dae1ca63e5a94d2", "type": "change", "z": "0b8b5d37e2f6870d", "name": "speichern", "rules": [ { "t": "set", "p": "solar_evcc", "pt": "flow", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 620, "y": 1580, "wires": [ [ "6ec6d2ebeaf99873" ] ] }, { "id": "aa86585d6188c4c0", "type": "@iseeberg79/EvaluateSolarForecastAPI", "z": "0b8b5d37e2f6870d", "name": "", "url": "", "x": 340, "y": 1580, "wires": [ [ "0dae1ca63e5a94d2" ] ] }, { "id": "59b9cc91c05542c7", "type": "debug", "z": "0b8b5d37e2f6870d", "name": "Solardaten", "active": false, "tosidebar": true, "console": false, "tostatus": true, "complete": "true", "targe