@mashpony
ich musste nochmal das ganze etwas optimieren.
Der Tibber node unterteilt die leistungswerte in +. und -
Deswegen die Funktion um Einspeisung vom Bezug abzuziehen.
Hinten habe ich mit dem deadband das ganze noch etwas geglättet das es nicht immer wie wild regelt.
außerdem ist der WR jetzt nach unten auf 10% limitiert.
[
{
"id": "7bf3afac51a18e13",
"type": "tab",
"label": "PVNull",
"disabled": false,
"info": "",
"env": []
},
{
"id": "2dacc22b5419c832",
"type": "mqtt out",
"z": "7bf3afac51a18e13",
"name": "WR MQTT",
"topic": "solar/116484658617/cmd/limit_nonpersistent_absolute",
"qos": "",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "87b2d138566ff5cc",
"x": 1910,
"y": 300,
"wires": []
},
{
"id": "992140f008964c0e",
"type": "function",
"z": "7bf3afac51a18e13",
"name": "Berechnung für WR Limit",
"func": "// MAX generation of the inverter Watts\nvar maxPower = 1600;\n\n// Get current power limit or default\nvar power = context.get('power') || maxPower;\npower += msg.payload;\n\n// clamp power between 0 and max\nif (power > maxPower) power = maxPower;\nif (power > 0) power = power + 150;\nif (power < 10) power = 160;\n\n// Wenn keine Werte vom Zähler kommen dann 600 W\n//if (power == 0) power = 1600;\n\n// store current powerlimit and update message\ncontext.set('power', power);\nmsg.payload = power;\n\nreturn msg;",
"outputs": 1,
"timeout": "",
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1430,
"y": 300,
"wires": [
[
"cfc7a51cd2515e7c",
"50883943a3e33578"
]
]
},
{
"id": "cfc7a51cd2515e7c",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "WR Wert",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1680,
"y": 220,
"wires": []
},
{
"id": "7c9607b020e57be9",
"type": "tibber-feed",
"z": "7bf3afac51a18e13",
"name": "B4D",
"active": true,
"apiEndpointRef": "acaea9XXXXXXXXXX",
"homeId": "6453fa8f-XXXXXXXXXXXXX",
"timestamp": false,
"power": true,
"lastMeterConsumption": false,
"accumulatedConsumption": false,
"accumulatedProduction": false,
"accumulatedConsumptionLastHour": false,
"accumulatedProductionLastHour": false,
"accumulatedCost": false,
"accumulatedReward": false,
"currency": false,
"minPower": false,
"averagePower": false,
"maxPower": false,
"powerProduction": true,
"minPowerProduction": false,
"maxPowerProduction": false,
"lastMeterProduction": false,
"powerFactor": false,
"voltagePhase1": false,
"voltagePhase2": false,
"voltagePhase3": false,
"currentL1": false,
"currentL2": false,
"currentL3": false,
"signalStrength": false,
"x": 50,
"y": 300,
"wires": [
[
"303c3a9e684e3aca",
"acd3b41ba56f0995"
]
]
},
{
"id": "303c3a9e684e3aca",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "Tibber output",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 260,
"y": 220,
"wires": []
},
{
"id": "f2cca6ecae7ad5fc",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "Tibber positiv",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "positiv",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 640,
"y": 220,
"wires": []
},
{
"id": "727ade03c58e2d2b",
"type": "change",
"z": "7bf3afac51a18e13",
"name": "Positiv",
"rules": [
{
"t": "set",
"p": "positiv",
"pt": "msg",
"to": "payload.power",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 430,
"y": 300,
"wires": [
[
"f2cca6ecae7ad5fc",
"e957d8fb0f0bd489"
]
]
},
{
"id": "52b31c00780196ab",
"type": "delay",
"z": "7bf3afac51a18e13",
"name": "",
"pauseType": "rate",
"timeout": "10",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "10",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": true,
"allowrate": false,
"outputs": 1,
"x": 1110,
"y": 300,
"wires": [
[
"992140f008964c0e",
"aed44dec4557ee97"
]
]
},
{
"id": "aed44dec4557ee97",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "nach delay",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1390,
"y": 220,
"wires": []
},
{
"id": "50883943a3e33578",
"type": "rbe",
"z": "7bf3afac51a18e13",
"name": "",
"func": "deadband",
"gap": "30",
"start": "",
"inout": "out",
"septopics": true,
"property": "payload",
"topi": "topic",
"x": 1690,
"y": 300,
"wires": [
[
"2dacc22b5419c832",
"fb6e2a22c5dd3e5f"
]
]
},
{
"id": "fb6e2a22c5dd3e5f",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "nach Filter",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1910,
"y": 220,
"wires": []
},
{
"id": "acd3b41ba56f0995",
"type": "time-switch",
"z": "7bf3afac51a18e13",
"name": "zeitschaltung",
"lat": "48.1492455",
"lon": "12.0148575",
"startTime": "sunrise",
"endTime": "sunset",
"startOffset": 0,
"endOffset": 0,
"x": 250,
"y": 300,
"wires": [
[
"727ade03c58e2d2b"
],
[]
]
},
{
"id": "779a354a9c204395",
"type": "inject",
"z": "7bf3afac51a18e13",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "00 22 * * *",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "1600",
"payloadType": "num",
"x": 1370,
"y": 360,
"wires": [
[
"50883943a3e33578"
]
]
},
{
"id": "e957d8fb0f0bd489",
"type": "change",
"z": "7bf3afac51a18e13",
"name": "Negativ",
"rules": [
{
"t": "set",
"p": "negativ",
"pt": "msg",
"to": "payload.powerProduction",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 620,
"y": 300,
"wires": [
[
"7576e3b12206f405",
"cac94db4ac79fe23"
]
]
},
{
"id": "7576e3b12206f405",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "Tibber - negativ",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "negativ",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 840,
"y": 400,
"wires": []
},
{
"id": "6f770f0a3305a631",
"type": "debug",
"z": "7bf3afac51a18e13",
"name": "nach rechner",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1070,
"y": 360,
"wires": []
},
{
"id": "cac94db4ac79fe23",
"type": "change",
"z": "7bf3afac51a18e13",
"name": "Suptrahieren",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "msg.positiv - msg.negativ",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 830,
"y": 300,
"wires": [
[
"52b31c00780196ab",
"6f770f0a3305a631"
]
]
},
{
"id": "87b2d138566ff5cc",
"type": "mqtt-broker",
"name": "",
"broker": "192.168.1.2",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"autoUnsubscribe": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "acaea9118c2d1751",
"type": "tibber-api-endpoint",
"queryUrl": "https://api.tibber.com/v1-beta/gql",
"feedConnectionTimeout": "30",
"feedTimeout": "60",
"queryRequestTimeout": "30",
"name": "B4D"
}
]
Bildschirmfoto 2024-01-30 um 10.40.44.png