Community

PV-Analge - SMA Wechselrichter und Batterie an homee simulieren [hih]

Hi zusammen,

in Anlehnung an das große Simulationsprojekt von @stfnhmplr, will ich hier nur kurz eine spezielle Anwendung vorstellen:

Trotz homee Energiemanager, war es mir nicht möglich die Werte meiner PV Anlage suffizient in homee abzubilden, obwohl Wechselrichter von SMA “unterstützt” werden. Allerdings wird mir nur der Wert “PV Produktion” übermittelt, vom Batteriewechselrichter der Wert für Ladung/ Entladung.

An dieser Stelle war ich enttäuscht und hätte echt mehr erwartet.

Zu meinem Setting:

  • PV Wechelrichter SMA Sunny Tripower 25000
  • Batterie Wechselrichter SMA Sunny Island 6.0H
  • Batterie BYD B-Box 10.5 LV

Mit der homee in homee Simulation (kurz hih) ändert sich das jetzt… So kann ich jetzt alle Werte der PV Anlage von beiden WR auslesen und in einen simulierten Energiemanager übertragen.

Hier ein paar Impressionen:

Jetzt macht die Verwendung in Homeegrammen auch richtig Sinn, um Dinge im Haus automatisiert in Anlehnung an die Stromsituation zu steuern.

Das ganze läuft natürlich in NodeRed. Für die Auslesung der Daten ist ein Modbus node notwendig. Hier mal der Flow für Interessierte:

[{"id":"94c29a05.895178","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"Batterie Ladung","topic":"","dataType":"HoldingRegister","adr":"30845","quantity":"2","rate":"25","rateUnit":"s","server":"8eb3ef23.af869","ieeeType":"off","ieeeBE":"true","x":190,"y":4380,"wires":[["74129c2c.a3f334"]]},{"id":"c2e1fd11.95835","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"Einspeisung","topic":"","dataType":"HoldingRegister","adr":"30867","quantity":"2","rate":"25","rateUnit":"s","server":"8eb3ef23.af869","ieeeType":"off","ieeeBE":"true","x":190,"y":4560,"wires":[["bb218aeb.7204f8"]]},{"id":"6dcc21e.5e688e","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"Netzbezug","topic":"","dataType":"HoldingRegister","adr":"30865","quantity":"2","rate":"25","rateUnit":"s","server":"8eb3ef23.af869","ieeeType":"off","ieeeBE":"true","x":190,"y":4500,"wires":[["84ece0d0.ea8e8"]]},{"id":"209df9b9.00a856","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"PV Erzeugung","topic":"","dataType":"HoldingRegister","adr":"30775","quantity":"2","rate":"25","rateUnit":"s","server":"38eec1f5.1e71ee","ieeeType":"off","ieeeBE":"true","x":180,"y":4620,"wires":[["d7bfa086.5a044"]]},{"id":"5793819c.e8de5","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"Bewegung Batterie","topic":"","dataType":"HoldingRegister","adr":"30775","quantity":"2","rate":"25","rateUnit":"s","server":"8eb3ef23.af869","ieeeType":"off","ieeeBE":true,"x":170,"y":4440,"wires":[["95a33646.6f5588"]]},{"id":"74129c2c.a3f334","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":350,"y":4380,"wires":[["abf6aad6.4d9268"]]},{"id":"d7bfa086.5a044","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":350,"y":4620,"wires":[["1e7fbd44.061a53","c785586d.cc6178"]]},{"id":"84ece0d0.ea8e8","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":350,"y":4500,"wires":[["346d8c3d.3c2e44","ea1bf7ca.911dc8"]]},{"id":"bb218aeb.7204f8","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":350,"y":4560,"wires":[["1d5c374c.3f6439","c785586d.cc6178"]]},{"id":"95a33646.6f5588","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"msg.payload = msg.payload[1] - msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"x":350,"y":4440,"wires":[["20e012f7.ccbabe","ac683148.cba1e"]]},{"id":"e98dfae1.7ab698","type":"homeeDevice","z":"fd6d95c1.d70ae8","homee-sim":"236538fb.027108","name":"Energy Meter","nodeId":"280","profile":"38","icon":"","attributes":"[{\"id\":282,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":1700,\"target_value\":1700,\"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\":283,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":2500,\"target_value\":2500,\"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\":\"\"},{\"id\":284,\"node_id\":280,\"instance\":0,\"minimum\":-50000,\"maximum\":50000,\"current_value\":258,\"target_value\":258,\"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\":285,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":200,\"target_value\":200,\"last_value\":0,\"unit\":\"W\",\"step_value\":100,\"editable\":0,\"type\":268,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":286,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":980,\"target_value\":980,\"last_value\":0,\"unit\":\"W\",\"step_value\":100,\"editable\":0,\"type\":269,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":287,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":37,\"target_value\":37,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":0,\"type\":273,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":288,\"node_id\":280,\"instance\":0,\"minimum\":-50000,\"maximum\":50000,\"current_value\":1180,\"target_value\":1180,\"last_value\":1240,\"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\":289,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":274,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":290,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":275,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":291,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":276,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":292,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":277,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":293,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":278,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":294,\"node_id\":280,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":279,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"}]","x":750,"y":4500,"wires":[[]]},{"id":"346d8c3d.3c2e44","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":282,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":510,"y":4500,"wires":[["e98dfae1.7ab698"]]},{"id":"1d5c374c.3f6439","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":283,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":510,"y":4560,"wires":[["e98dfae1.7ab698"]]},{"id":"1e7fbd44.061a53","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":288,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":510,"y":4620,"wires":[["e98dfae1.7ab698"]]},{"id":"abf6aad6.4d9268","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":287,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":510,"y":4380,"wires":[["e98dfae1.7ab698"]]},{"id":"20e012f7.ccbabe","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\nvar msg1 = {payload:{ \"id\": 286, \"value\":-wert}};\nvar msg2 = {payload:{ \"id\": 285, \"value\": 0 }};\nvar msg3 = {payload:{ \"id\": 285, \"value\":wert}};\nvar msg4 = {payload:{ \"id\": 286, \"value\": 0 }};\n\nif (wert < 0){\nreturn [[msg1,msg2]]\n}\nif (wert >= 0){\nreturn [[msg3,msg4]]\n}","outputs":1,"noerr":0,"x":510,"y":4440,"wires":[["e98dfae1.7ab698"]]},{"id":"c785586d.cc6178","type":"join","z":"fd6d95c1.d70ae8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":310,"y":4700,"wires":[["eea9b379.4220a"]]},{"id":"ea1bf7ca.911dc8","type":"join","z":"fd6d95c1.d70ae8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":510,"y":4300,"wires":[["d90862bd.34975"]]},{"id":"ac683148.cba1e","type":"function","z":"fd6d95c1.d70ae8","name":"Vorzeichen +/-","func":"var wert = msg.payload\n\nif (wert < 0){\nreturn {payload:-wert};\n}\nif (wert >= 0){\nreturn {payload:wert};\n}\n\n","outputs":1,"noerr":0,"x":340,"y":4300,"wires":[["ea1bf7ca.911dc8"]]},{"id":"8b65e5aa.d98318","type":"function","z":"fd6d95c1.d70ae8","name":"Vorzeichen +/-","func":"var wert = msg.payload\n\nif (wert < 0){\nreturn {payload:wert};\n}\nif (wert >= 0){\nreturn {payload:-wert};\n}","outputs":1,"noerr":0,"x":640,"y":4700,"wires":[["5b4833ee.a4325c"]]},{"id":"eea9b379.4220a","type":"function","z":"fd6d95c1.d70ae8","name":"Differenz","func":"msg.payload = msg.payload[1] - msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"x":460,"y":4700,"wires":[["8b65e5aa.d98318"]]},{"id":"d90862bd.34975","type":"function","z":"fd6d95c1.d70ae8","name":"Summe","func":"msg.payload = msg.payload[1] + msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"x":660,"y":4300,"wires":[["5b4833ee.a4325c"]]},{"id":"5b4833ee.a4325c","type":"join","z":"fd6d95c1.d70ae8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":940,"y":4500,"wires":[["fa8bea64.a8ea48"]]},{"id":"fa8bea64.a8ea48","type":"function","z":"fd6d95c1.d70ae8","name":"Summe","func":"msg.payload = msg.payload[1] + msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"x":1080,"y":4500,"wires":[["991fc4e7.e3c7c"]]},{"id":"b6e98277.f1b2f","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":284,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":1490,"y":4500,"wires":[["e98dfae1.7ab698"]]},{"id":"991fc4e7.e3c7c","type":"function","z":"fd6d95c1.d70ae8","name":"Vorzeichen +/-","func":"var wert = msg.payload\n\nreturn {payload:-wert};\n\n\n","outputs":1,"noerr":0,"x":1280,"y":4500,"wires":[["b6e98277.f1b2f"]]},{"id":"8eb3ef23.af869","type":"modbustcp-server","z":"","name":"Batterie Ladung","host":"192.168.1.186","port":"502","unit_id":"3","reconnecttimeout":"1"},{"id":"38eec1f5.1e71ee","type":"modbustcp-server","z":"","name":"STP","host":"192.168.1.185","port":"502","unit_id":"3","reconnecttimeout":"1"},{"id":"236538fb.027108","type":"virtualHomee","z":"","name":"12345QWERT"}]

Viel Spaß beim Nachmachen!

Grüße
Michael

15 Like

Hi Michael,

danke für deinen Flow, den du hier bereitgestellt hast.
Ich habe mich daran gemacht, dies auch für mich umzusetzen.

Wobei ich 100% einspeise, daher sind die Werte für Netzbezug und Verbrauch sowie Einspeisung und Produktion jeweils identisch. Eine Batterie habe ich logischerweise auch nicht.

Jetzt kann ich die Werte (zusammengefasst) meiner Wechselrichter und meines Verbrauchs ablesen, soweit ist das echt super.

Mir sind aber noch ein paar Dinge unklar, die ich gerne verstehen würde.

    {
		"id": 288,
		"node_id": 280,
		"instance": 0,
		"minimum": -50000,
		"maximum": 50000,
		"current_value": 1180,
		"target_value": 1180,
		"last_value": 1240,
		"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": ""
	}

Evtl. wichtige aber zum Teil unklare Werte sind hier:

  • type
  • editable
  • step_value
  • state
  • based_on

Type habe ich glücklicherweise gefunden.

Somit verstehe ich, was da steht.
Editable ist auch klar, es gibt also einen “read-only” Wert.
Step_value steuert irgendeine Schrittweite, welche?
Aber was ist State? Was ist based_on?

Wie im Bild oben zu sehen bekomme ich also mit dem Node entsprechende Werte in meinen homee.

Bekommt man auch irgendwie diese Ansicht?

Auch bekomme ich kein Smart Widget Energie angeboten.

image

Im Gerät wird nur der Verbrauch (oder Netzbezug) angezeigt, keine Produktion. Und es steht nicht dabei, was es ist.

Gibt es etwas, wonach ich schauen kann? Kann man was vergleichen? Muss ich was anders machen?

Noch mal vielen Dank für alle, die dies möglich machen. Nach einem Jahr homee-Abstinenz bin ich durch dieses Projekt nun zurück gekehrt :slight_smile: zumindest mit einem Brain-Cube.

Viele Grüße,
Daniel

Hier mal die Antwort zum Type. Dort gab es auch was zum attribute.

State habe ich immer auf 1, vielleicht kann dir @Micha was dazu sagen.
based_on ist soweit ich verstanden habe auf welchem anderen “block” es basiert. Step_Value . Editable ist ob mans editieren kann oder nicht.

Das virtuelle Gerät durchläuft nicht den Einrichtungsprozess, wie ein normaler homee Energiemanager… deshlab wird man das, glaube ich, nicht hinbekommen… leider.

Ich habe mal mit den States gespielt.
Hierüber wird gesteuert, wie die Werte jeweils angezeigt werden.

1: normal
2: mit Sanduhr
6: ausgeblendet

Das ändern des based_on Wertes hat keine Änderung gebracht.

State ist einfach die Erreichbarkeit der Geräte…

1 Like

Hat das jemand mit Energiemanager und echtem homee in homee laufen? Bekommt man den da auch nicht in ein Smart Widget?

Nein, via homee in homee bekommst du das Widget nicht.
Der homee erwartet ein Node vom ENERGIEMANAGER, erst dann erscheint das Widget

Das ist schade… aber es gibt ja ein Node von Energiemanager über hih.

Jedenfalls ist homee selbst der Meinung.

Wenn man einen Energiemanager hinzufügen will kommt eine Meldung nach dem Motto „es kann nur einen geben“.

Könnte man den simulieren?
Ich habe ja einen echten hEM und schaue mir mal die nodes an… vielleicht gibt es einen zusätzlichen node.
Ich hatte den Energiemanager an sich mal mit allen Attributen (am Anfang gibt es noch die Software-Version sowie die SN als Attribut). Das änderte aber nichts.

2 Like

Hi, die blaue Node “Energy Meter”, welches NPM Paket ist das? (Und Virtual Home soll mir auch fehlen. Kannst du mir auch da sagen, welches Paket ich brauche )
Danke für deine Antwort.
Gruß

Moin,

läuft über @stfnhmplr ´s Plugin… siehe hier:

Ein zweiter homee wird simuliert und darin der Energymeter… das ganze wird dann in homee über WLAN -> homee in homee

Ich hab noch mal den aktuellen Flow etwas optimiert, um die Synchronität der Werte zu verbessern. Außerdem hab ich die Abfragenodes reduziert…

[{"id":"94c29a05.895178","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"SI","topic":"","dataType":"HoldingRegister","adr":"30845","quantity":"2","rate":"0","rateUnit":"s","server":"8eb3ef23.af869","ieeeType":"off","ieeeBE":"true","x":290,"y":4480,"wires":[["b1c3d4e9.a54768"]]},{"id":"209df9b9.00a856","type":"modbustcp-read","z":"fd6d95c1.d70ae8","name":"STP","topic":"","dataType":"HoldingRegister","adr":"30775","quantity":"2","rate":"0","rateUnit":"s","server":"38eec1f5.1e71ee","ieeeType":"off","ieeeBE":"true","x":310,"y":4580,"wires":[["d7bfa086.5a044"]]},{"id":"74129c2c.a3f334","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}\n","outputs":1,"noerr":0,"x":550,"y":4400,"wires":[["abf6aad6.4d9268"]]},{"id":"d7bfa086.5a044","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":550,"y":4640,"wires":[["1e7fbd44.061a53","30946e75.f8ca5a"]]},{"id":"84ece0d0.ea8e8","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":550,"y":4520,"wires":[["346d8c3d.3c2e44","30946e75.f8ca5a"]]},{"id":"bb218aeb.7204f8","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"return{payload:msg.payload[1]}","outputs":1,"noerr":0,"x":550,"y":4580,"wires":[["1d5c374c.3f6439","ac683148.cba1e"]]},{"id":"95a33646.6f5588","type":"function","z":"fd6d95c1.d70ae8","name":"Filter","func":"msg.payload = msg.payload[1] - msg.payload[0];\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":4460,"wires":[["20e012f7.ccbabe","5b4833ee.a4325c"]]},{"id":"346d8c3d.3c2e44","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":722,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":710,"y":4520,"wires":[["ef7ae323.09ab38"]]},{"id":"1d5c374c.3f6439","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":723,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":710,"y":4580,"wires":[["ef7ae323.09ab38"]]},{"id":"1e7fbd44.061a53","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":728,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":710,"y":4640,"wires":[["ef7ae323.09ab38"]]},{"id":"abf6aad6.4d9268","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":727,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":710,"y":4400,"wires":[["ef7ae323.09ab38"]]},{"id":"20e012f7.ccbabe","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\nvar msg1 = {payload:{ \"id\": 726, \"value\":-wert}};\nvar msg2 = {payload:{ \"id\": 725, \"value\": 0 }};\nvar msg3 = {payload:{ \"id\": 725, \"value\":wert}};\nvar msg4 = {payload:{ \"id\": 726, \"value\": 0 }};\n\nif (wert < 0){\nreturn [[msg1,msg2]]\n}\nif (wert >= 0){\nreturn [[msg3,msg4]]\n}","outputs":1,"noerr":0,"x":710,"y":4460,"wires":[["ef7ae323.09ab38"]]},{"id":"ac683148.cba1e","type":"function","z":"fd6d95c1.d70ae8","name":"Vorzeichen auf -","func":"var wert = msg.payload\n\nreturn {payload:-wert};\n\n","outputs":1,"noerr":0,"x":740,"y":4700,"wires":[["5b4833ee.a4325c"]]},{"id":"5b4833ee.a4325c","type":"join","z":"fd6d95c1.d70ae8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"3","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":930,"y":4700,"wires":[["fa8bea64.a8ea48"]]},{"id":"fa8bea64.a8ea48","type":"function","z":"fd6d95c1.d70ae8","name":"Summe","func":"msg.payload = msg.payload[0] + msg.payload[1] + msg.payload[2];\nreturn msg;","outputs":1,"noerr":0,"x":1060,"y":4700,"wires":[["991fc4e7.e3c7c"]]},{"id":"b6e98277.f1b2f","type":"function","z":"fd6d95c1.d70ae8","name":"Wert  an EM","func":"var wert = msg.payload\n\nnode.send({payload:{\"id\":724,\"value\":msg.payload}})\n","outputs":1,"noerr":0,"x":1390,"y":4700,"wires":[["ef7ae323.09ab38"]]},{"id":"991fc4e7.e3c7c","type":"function","z":"fd6d95c1.d70ae8","name":"Vorzeichen +/-","func":"var wert = msg.payload\n\nif (wert < 0){\nreturn {payload:-wert};\n}\nif (wert >= 0){\nreturn {payload:wert};\n}\n\n\n\n","outputs":1,"noerr":0,"x":1220,"y":4700,"wires":[["b6e98277.f1b2f"]]},{"id":"30946e75.f8ca5a","type":"join","z":"fd6d95c1.d70ae8","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":690,"y":4340,"wires":[["1b5ce2e7.e17885"]]},{"id":"1b5ce2e7.e17885","type":"function","z":"fd6d95c1.d70ae8","name":"Summe Positiv","func":"msg.payload = msg.payload[0] + msg.payload[1];\nreturn msg;","outputs":1,"noerr":0,"x":860,"y":4340,"wires":[["5b4833ee.a4325c"]]},{"id":"ef7ae323.09ab38","type":"homeeDevice","z":"fd6d95c1.d70ae8","virtual-homee":"9d154771.cd16c8","name":"hEM","nodeId":"720","profile":"38","icon":"","attributes":"[{\"id\":720,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":10000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"text\",\"step_value\":1,\"editable\":0,\"type\":84,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"HM0000422\"},{\"id\":721,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":10000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"text\",\"step_value\":1,\"editable\":0,\"type\":45,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"11.4.11\"},{\"id\":722,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":1700,\"target_value\":1700,\"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\":723,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":2500,\"target_value\":2500,\"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\":\"\"},{\"id\":724,\"node_id\":720,\"instance\":0,\"minimum\":-50000,\"maximum\":50000,\"current_value\":258,\"target_value\":258,\"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\":725,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":200,\"target_value\":200,\"last_value\":0,\"unit\":\"W\",\"step_value\":100,\"editable\":0,\"type\":268,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":726,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":50000,\"current_value\":980,\"target_value\":980,\"last_value\":0,\"unit\":\"W\",\"step_value\":100,\"editable\":0,\"type\":269,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":727,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":37,\"target_value\":37,\"last_value\":0,\"unit\":\"%25\",\"step_value\":1,\"editable\":0,\"type\":273,\"state\":1,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":728,\"node_id\":720,\"instance\":0,\"minimum\":-50000,\"maximum\":50000,\"current_value\":1180,\"target_value\":1180,\"last_value\":1240,\"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\":729,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":274,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":730,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":275,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":731,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":276,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":732,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":277,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":733,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":278,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"},{\"id\":734,\"node_id\":720,\"instance\":0,\"minimum\":0,\"maximum\":9999999,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh\",\"step_value\":1,\"editable\":0,\"type\":279,\"state\":6,\"last_changed\":1572785482,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":4,\"data\":\"\"}]","x":1070,"y":4460,"wires":[[]]},{"id":"cbec805e.bf178","type":"inject","z":"fd6d95c1.d70ae8","name":"Abfrage SI","topic":"","payload":"[{\"name\":\"Batterieladung\",\"topic\":\"Batterieladung\",\"dataType\":\"FC3\",\"address\":30845,\"quantity\":2,\"interval\":15000,\"ieeeType\":\"off\",\"ieeeBE\":true},{\"name\":\"Batteriebewegung\",\"topic\":\"Batteriebewegung\",\"dataType\":\"FC3\",\"address\":30775,\"quantity\":2,\"interval\":15000,\"ieeeType\":\"off\",\"ieeeBE\":true},{\"name\":\"Netzbezug\",\"topic\":\"Netzbezug\",\"dataType\":\"FC3\",\"address\":30865,\"quantity\":2,\"interval\":15000,\"ieeeType\":\"off\",\"ieeeBE\":true},{\"name\":\"Einspeisung\",\"topic\":\"Einspeisung\",\"dataType\":\"FC3\",\"address\":30867,\"quantity\":2,\"interval\":15000,\"ieeeType\":\"off\",\"ieeeBE\":true}]","payloadType":"json","repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"x":150,"y":4480,"wires":[["94c29a05.895178"]]},{"id":"b1c3d4e9.a54768","type":"switch","z":"fd6d95c1.d70ae8","name":"","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"Batterieladung","vt":"str"},{"t":"eq","v":"Batteriebewegung","vt":"str"},{"t":"eq","v":"Netzbezug","vt":"str"},{"t":"eq","v":"Einspeisung","vt":"str"}],"checkall":"true","repair":false,"outputs":4,"x":410,"y":4500,"wires":[["74129c2c.a3f334"],["95a33646.6f5588"],["84ece0d0.ea8e8"],["bb218aeb.7204f8"]]},{"id":"95cc52c2.4f77c","type":"inject","z":"fd6d95c1.d70ae8","name":"Abfrage STP","topic":"","payload":"[{\"name\":\"PV-Erzeugung\",\"topic\":\"PV-Erzeugung\",\"dataType\":\"FC3\",\"address\":30775,\"quantity\":2,\"interval\":15000,\"ieeeType\":\"off\",\"ieeeBE\":true}]","payloadType":"json","repeat":"1800","crontab":"","once":false,"onceDelay":0.1,"x":160,"y":4580,"wires":[["209df9b9.00a856"]]},{"id":"8eb3ef23.af869","type":"modbustcp-server","z":"","name":"Batterie Ladung","host":"192.168.1.186","port":"502","unit_id":"3","reconnecttimeout":"1"},{"id":"38eec1f5.1e71ee","type":"modbustcp-server","z":"","name":"STP","host":"192.168.1.185","port":"502","unit_id":"3","reconnecttimeout":"1"},{"id":"9d154771.cd16c8","type":"virtualHomee","z":"","name":"12345QWERT"}]

1 Like