[ { "id": "3e29bacbc9176f39", "type": "function", "z": "933e7d2cb83f98b7", "name": "Leistung vom Shelly als globale Variable definieren", "func": "global.set(\"ShellyPower2\",msg.payload);", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 770, "y": 100, "wires": [ [] ] }, { "id": "5bad38f23e0e9e93", "type": "inject", "z": "933e7d2cb83f98b7", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "10", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 100, "wires": [ [ "7a039d49c2c50f77" ] ] }, { "id": "7a039d49c2c50f77", "type": "function", "z": "933e7d2cb83f98b7", "name": "Addition L1 L2", "func": "var L1 = global.get(\"L1\") || 0;\nvar L2 = global.get(\"L2\") || 0;\n//var L3 = global.get(\"L3\") || 0;\n\nmsg.payload = L1 + L2;\nmsg.payload = parseFloat((msg.payload).toFixed(2));\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 360, "y": 100, "wires": [ [ "3e29bacbc9176f39", "2fe0b29adc2ca719" ] ] }, { "id": "2fe0b29adc2ca719", "type": "debug", "z": "933e7d2cb83f98b7", "name": "debug 34", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 640, "y": 60, "wires": [] }, { "id": "2b8502c3ad9c1c24", "type": "influxdb out", "z": "933e7d2cb83f98b7", "influxdb": "e840b95d15d8b227", "name": "AhoyDB", "measurement": "power_from_grid", "precision": "", "retentionPolicy": "", "database": "database", "precisionV18FluxV20": "ms", "retentionPolicyV18Flux": "", "org": "organisation", "bucket": "bucket", "x": 540, "y": 240, "wires": [] }, { "id": "f3495d762fa76009", "type": "mqtt out", "z": "933e7d2cb83f98b7", "name": "WR MQTT", "topic": "inverter/ctrl/limit/0", "qos": "", "retain": "", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "4456b99c55c38cfe", "x": 1090, "y": 300, "wires": [] }, { "id": "7e8702a86859bb3e", "type": "inject", "z": "933e7d2cb83f98b7", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "20", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 300, "wires": [ [ "a61b99d7d2377533" ] ] }, { "id": "ad90b6b560bc5c7f", "type": "switch", "z": "933e7d2cb83f98b7", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "15", "vt": "num" }, { "t": "btwn", "v": "15", "vt": "num", "v2": "2599", "v2t": "num" }, { "t": "eq", "v": "300", "vt": "num" }, { "t": "btwn", "v": "-15", "vt": "num", "v2": "-2599", "v2t": "num" } ], "checkall": "true", "repair": false, "outputs": 4, "x": 530, "y": 300, "wires": [ [], [ "8279ee583e5606b9", "67f506ea791bcfeb" ], [], [ "3a6a7d5a762c3b3e", "67f506ea791bcfeb" ] ] }, { "id": "8279ee583e5606b9", "type": "debug", "z": "933e7d2cb83f98b7", "name": "debug 35", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 760, "y": 260, "wires": [] }, { "id": "67f506ea791bcfeb", "type": "function", "z": "933e7d2cb83f98b7", "name": "Berechnung Wechselrichter Setting", "func": "var ObtainedData = global.get(\"ShellyPower2\");\nvar ObtainedData = global.get(\"power2\") || 0;\n\n// MAX generation of the inverter Prozent\nvar maxPower = 100;\n\n// setting variable power2 \nvar power2 = ((global.get(\"ShellyPower2\") ) + 30) / 6 || maxPower;\n\n// clamp power between 0 and max\nif (power2 > maxPower) power2 = maxPower;\nif (power2 < 0) power2 = 1;\n\n// store current powerlimit and update message\nmsg.payload = parseFloat((msg.payload).toFixed(0));\nmsg.payload = power2;\nglobal.set(\"power2\", power2);\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 800, "y": 300, "wires": [ [ "3a5170c0867ea632", "f3495d762fa76009" ] ] }, { "id": "3a5170c0867ea632", "type": "debug", "z": "933e7d2cb83f98b7", "name": "debug 36", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 980, "y": 380, "wires": [] }, { "id": "a61b99d7d2377533", "type": "function", "z": "933e7d2cb83f98b7", "name": "Get ShellyPower", "func": "//Berechnung ob Wechselrichter neu gesetzt werden soll;\n\nvar ShellyPower2 = global.get(\"ShellyPower2\") || 0;\nvar power2 = (global.get(\"power2\") * 6) -30 || 0;\n\n\nmsg.payload = ShellyPower2 - power2;\n//msg.payload = global.get('ShellyPower2') - (global.get('power2')) * 6 || maxPower;\n\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 330, "y": 300, "wires": [ [ "ad90b6b560bc5c7f", "ba3a953ba7eeced0", "2b8502c3ad9c1c24" ] ] }, { "id": "ba3a953ba7eeced0", "type": "debug", "z": "933e7d2cb83f98b7", "name": "debug 37", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 540, "y": 400, "wires": [] }, { "id": "3a6a7d5a762c3b3e", "type": "debug", "z": "933e7d2cb83f98b7", "name": "debug 38", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 760, "y": 340, "wires": [] }, { "id": "77920513f3c63479", "type": "inject", "z": "933e7d2cb83f98b7", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "20", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 520, "wires": [ [ "1bde5ff16e25d956" ] ] }, { "id": "1bde5ff16e25d956", "type": "function", "z": "933e7d2cb83f98b7", "name": "Get power2", "func": "//var ObtainedData = global.get(\"power2\");\n\n//var ShellyPower2 = global.get(\"ShellyPower2\") || 0;\nvar power2 = global.get(\"power2\") * 6 || 0;\n\n\nmsg.payload = power2;\n\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 310, "y": 520, "wires": [ [ "5a1fbdff504c1dad" ] ] }, { "id": "5a1fbdff504c1dad", "type": "debug", "z": "933e7d2cb83f98b7", "name": "debug 39", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 580, "y": 520, "wires": [] }, { "id": "e840b95d15d8b227", "type": "influxdb", "hostname": "192.168.2.104", "port": "8086", "protocol": "http", "database": "PVDB", "name": "AhoyDB", "usetls": false, "tls": "", "influxdbVersion": "1.x", "url": "http://localhost:8086", "rejectUnauthorized": true }, { "id": "4456b99c55c38cfe", "type": "mqtt-broker", "name": "", "broker": "192.168.2.104", "port": "1883", "clientid": "", "autoConnect": true, "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "userProps": "", "sessionExpiry": "" }]
Hier nun mein Code zur Nulleinspeisung. Gemessen wird die Leistung an 2 Phasen. Die Phase auf der der Wechselrichter einspeist wird nicht gemessen und auch nicht in der Nulleinspeisung berĂŒcksichtigt. Grund hierfĂŒr ist, dass der Wechselrichter (hm 600) hĂ€ufig sehr schwankt und das Gesamtsystem dadurch nicht zur Ruhe kommt. Gibt bestimmt bessere Lösungen, aber immerhin lĂ€uft das System stabil.
Hardware:
2 Module mit insgesamt 760Wp
Victron 100/50 Laderegler
DIY 2,5kW LiFePO4 Battery mit Daly BMS
Wechselrichter Hoymiles HM 600
Ahoy DTU
Raspberry PI
by HarryP: ZusammenfĂŒhrung Doppelpost.
*@Bjoernix *
Bitte fĂŒr NachtrĂ€ge/Korrekturen die âbearbeitenâ Funktion verwenden. Danke!