Hi,
Ja, ich nehme die Werte direkt aus dem Fronius-Adapter.
Wenn du die „schnelle“ Variante willst, hier ist mein Flow:
[
{
"id": "31a2ac6f.c44c54",
"type": "tab",
"label": "PV",
"disabled": false,
"info": ""
},
{
"id": "ed8d772e.3f06d",
"type": "homeeDevice",
"z": "31a2ac6f.c44c54",
"virtual-homee": "",
"name": "vPhotovoltaik",
"nodeId": "2",
"profile": "38",
"icon": "default",
"attributes": [
{
"id": 200,
"node_id": 2,
"instance": 0,
"minimum": -50000,
"maximum": 50000,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "W",
"step_value": 100,
"editable": 0,
"type": 267,
"state": 1,
"last_changed": 1572785482,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": ""
},
{
"id": 201,
"node_id": 2,
"instance": 0,
"minimum": -50000,
"maximum": 50000,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "W",
"step_value": 100,
"editable": 0,
"type": 266,
"state": 1,
"last_changed": 1572785663,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": ""
},
{
"id": 202,
"node_id": 2,
"instance": 0,
"minimum": 0,
"maximum": 50000,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "W",
"step_value": 100,
"editable": 0,
"type": 264,
"state": 1,
"last_changed": 1572785482,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": ""
},
{
"id": 203,
"node_id": 2,
"instance": 0,
"minimum": 0,
"maximum": 50000,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "W",
"step_value": 100,
"editable": 0,
"type": 265,
"state": 1,
"last_changed": 1572785482,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": ""
}
],
"x": 660,
"y": 300,
"wires": [
[]
]
},
{
"id": "2e8abea2.40a9f2",
"type": "ioBroker in",
"z": "31a2ac6f.c44c54",
"name": "Verbrauch",
"topic": "fronius.0.powerflow.P_Load",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"x": 80,
"y": 200,
"wires": [
[
"a3457038.994038"
]
]
},
{
"id": "cd8fe927.d5c39",
"type": "template",
"z": "31a2ac6f.c44c54",
"name": "200 AV",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":200 ,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 200,
"wires": [
[
"ed8d772e.3f06d"
]
]
},
{
"id": "a3457038.994038",
"type": "change",
"z": "31a2ac6f.c44c54",
"name": "200",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$abs($number(payload))",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 270,
"y": 200,
"wires": [
[
"cd8fe927.d5c39"
]
]
},
{
"id": "f32be351.bec39",
"type": "ioBroker in",
"z": "31a2ac6f.c44c54",
"name": "Erzeugung",
"topic": "fronius.0.powerflow.P_PV",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"x": 80,
"y": 280,
"wires": [
[
"4f248f7d.cf4d58"
]
]
},
{
"id": "4f248f7d.cf4d58",
"type": "template",
"z": "31a2ac6f.c44c54",
"name": "201 AE",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":201 ,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 280,
"wires": [
[
"ed8d772e.3f06d"
]
]
},
{
"id": "c6fb0840.3cf51",
"type": "ioBroker in",
"z": "31a2ac6f.c44c54",
"name": "Bezug",
"topic": "fronius.0.powerflow.P_Grid",
"payloadType": "value",
"onlyack": "",
"func": "all",
"gap": "",
"fireOnStart": "false",
"x": 70,
"y": 360,
"wires": [
[
"b957224c.71887",
"13371964.a0c77f"
]
]
},
{
"id": "92260d16.e09cf8",
"type": "template",
"z": "31a2ac6f.c44c54",
"name": "202 AB",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":202 ,\"value\":{{payload}}}}",
"output": "json",
"x": 440,
"y": 360,
"wires": [
[
"ed8d772e.3f06d"
]
]
},
{
"id": "13371964.a0c77f",
"type": "change",
"z": "31a2ac6f.c44c54",
"name": "203",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$max([$number(payload)*-1,0])",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 270,
"y": 440,
"wires": [
[
"37375787.512098"
]
]
},
{
"id": "37375787.512098",
"type": "template",
"z": "31a2ac6f.c44c54",
"name": "203 AI",
"field": "payload",
"fieldType": "msg",
"format": "handlebars",
"syntax": "mustache",
"template": "{\"attribute\":{\"id\":203 ,\"value\":{{payload}}}}",
"output": "json",
"x": 430,
"y": 440,
"wires": [
[
"ed8d772e.3f06d"
]
]
},
{
"id": "b957224c.71887",
"type": "change",
"z": "31a2ac6f.c44c54",
"name": "202",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "$max([$number(payload),0])",
"tot": "jsonata"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 270,
"y": 360,
"wires": [
[
"92260d16.e09cf8"
]
]
}
]
So richtig fit bin ich damit auch noch nicht, aber das müsstest du in Node-Red importieren können. Dann vielleicht noch auf deinen virtuellen homee umstellen und es sollte laufen.
Ich habe wie gesagt keine Batterie. darum hab ich nur 4 Werte, die ich in den virtuellen homee übergebe.
Die Batterie-Sachen musst du dir selber basteln.
Gruß
Stefan