HAPPY NEW YEAR!!!
I've solved it like this:
[
{
"id": "c89231cf7bc89672",
"type": "power-monitor",
"z": "a0ffbde30d80ea16",
"name": "Sunpower",
"startthreshold": 0,
"stopthreshold": 0,
"startafter": 1,
"stopafter": 1,
"energydecimals": 4,
"emitidle": true,
"x": 760,
"y": 2140,
"wires": [
[
"d5a54472a201cbdc"
]
]
},
{
"id": "cd2091a50475dec8",
"type": "ioBroker in",
"z": "a0ffbde30d80ea16",
"name": "WR1 out W",
"topic": "modbus.0.inputRegisters.1.30011_WR1_Output_Active_Power",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"outFormat": "MQTT",
"x": 110,
"y": 2080,
"wires": [
[
"40fba0e03b4fc497"
]
]
},
{
"id": "41efb2dbbfa7137d",
"type": "ioBroker in",
"z": "a0ffbde30d80ea16",
"name": "WR2 out W",
"topic": "modbus.0.inputRegisters.2.30011_WR2_Output_Active_Power",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"outFormat": "MQTT",
"x": 110,
"y": 2140,
"wires": [
[
"40fba0e03b4fc497"
]
]
},
{
"id": "a127358e0172d4c2",
"type": "ioBroker in",
"z": "a0ffbde30d80ea16",
"name": "WR3 out W",
"topic": "modbus.0.inputRegisters.3.30011_WR3_Output_Active_Power",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"outFormat": "MQTT",
"x": 110,
"y": 2200,
"wires": [
[
"40fba0e03b4fc497"
]
]
},
{
"id": "40fba0e03b4fc497",
"type": "SumUltimate",
"z": "a0ffbde30d80ea16",
"name": "Math",
"property": "payload",
"math": "sum",
"x": 370,
"y": 2140,
"wires": [
[
"2a499531e3138ce8",
"9b35d3a4ef0539a1"
]
]
},
{
"id": "d5a54472a201cbdc",
"type": "change",
"z": "a0ffbde30d80ea16",
"name": "kWh-filter",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.energy",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 940,
"y": 2140,
"wires": [
[
"bdd8fabfbf06033d"
]
]
},
{
"id": "d95d01336f6e8475",
"type": "ioBroker in",
"z": "a0ffbde30d80ea16",
"name": "WR1 Status",
"topic": "modbus.0.inputRegisters.1.30001_WR1_System_Status",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"outFormat": "MQTT",
"x": 110,
"y": 2020,
"wires": [
[
"4397f011ef4eda1d",
"a21e3f46ba6a5266"
]
]
},
{
"id": "2a499531e3138ce8",
"type": "gate",
"z": "a0ffbde30d80ea16",
"name": "",
"controlTopic": "control",
"defaultState": "open",
"openCmd": "open",
"closeCmd": "close",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": false,
"storeName": "memory",
"x": 610,
"y": 2140,
"wires": [
[
"c89231cf7bc89672"
]
]
},
{
"id": "9b35d3a4ef0539a1",
"type": "gate",
"z": "a0ffbde30d80ea16",
"name": "",
"controlTopic": "control",
"defaultState": "open",
"openCmd": "open",
"closeCmd": "close",
"toggleCmd": "toggle",
"defaultCmd": "default",
"statusCmd": "status",
"persist": false,
"storeName": "memory",
"x": 610,
"y": 2060,
"wires": [
[
"e2b365800f85f979"
]
]
},
{
"id": "e2b365800f85f979",
"type": "power-monitor",
"z": "a0ffbde30d80ea16",
"name": "Gridpower",
"startthreshold": 0,
"stopthreshold": 0,
"startafter": 1,
"stopafter": 1,
"energydecimals": 4,
"emitidle": true,
"x": 770,
"y": 2060,
"wires": [
[
"5dae14685eec6ad9"
]
]
},
{
"id": "5dae14685eec6ad9",
"type": "change",
"z": "a0ffbde30d80ea16",
"name": "kWh-filter",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "payload.energy",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 940,
"y": 2060,
"wires": [
[
"ac128e4e63a2e37b"
]
]
},
{
"id": "4397f011ef4eda1d",
"type": "function",
"z": "a0ffbde30d80ea16",
"name": "12 = open",
"func": "if (msg.payload === 12)\n msg.payload = \"open\";\n\nelse msg.payload = \"close\";\nmsg.topic = \"control\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 380,
"y": 2100,
"wires": [
[
"2a499531e3138ce8"
]
]
},
{
"id": "a21e3f46ba6a5266",
"type": "function",
"z": "a0ffbde30d80ea16",
"name": "12 = close",
"func": "if (msg.payload === 12)\n msg.payload = \"close\";\n\nelse msg.payload = \"open\";\nmsg.topic = \"control\"\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 390,
"y": 2060,
"wires": [
[
"9b35d3a4ef0539a1"
]
]
},
{
"id": "e65615fc24e4335b",
"type": "ioBroker out",
"z": "a0ffbde30d80ea16",
"name": "Sonne",
"topic": "0_userdata.0.PV_Anlage.WR.Aus_Sonne_Verbraucht",
"ack": "true",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 1230,
"y": 2140,
"wires": []
},
{
"id": "9e8d2a77f258a878",
"type": "ioBroker out",
"z": "a0ffbde30d80ea16",
"name": "Netz",
"topic": "0_userdata.0.PV_Anlage.WR.Aus_Netz_Verbraucht",
"ack": "true",
"autoCreate": "false",
"stateName": "",
"role": "",
"payloadType": "",
"readonly": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 1230,
"y": 2060,
"wires": []
},
{
"id": "ac128e4e63a2e37b",
"type": "delay",
"z": "a0ffbde30d80ea16",
"name": "1/s",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1090,
"y": 2060,
"wires": [
[
"9e8d2a77f258a878"
]
]
},
{
"id": "bdd8fabfbf06033d",
"type": "delay",
"z": "a0ffbde30d80ea16",
"name": "1/s",
"pauseType": "rate",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"allowrate": false,
"outputs": 1,
"x": 1090,
"y": 2140,
"wires": [
[
"e65615fc24e4335b"
]
]
}
]
Thank you all for your help.
BR
Phoenix