Hi zusammen,
heute will ich euch wieder einmal ein kleines Projekt visualisieren.
Bevor ich beginne, will ich an dieser Stelle ein riesengroßes Dankeschön an @langepil aussprechen, der mich mit seiner tollen Vorarbeit inspiriert und super unterstützt hat. Die Credits für große Teile des NR-Flows gehen an @langepil. Vielen, vielen Dank!!!
Seit kurzem haben wir ein Elektroauto. Um jetzt die Synergien mit der PV-Anlage optimal nutzen zu können habe ich mich im Vorfeld intensiv mit dem Thema Wallbox und Laden zu Hause beschäftigt.
Ich habe mich dann für einen go-e Charger entschieden. Diese mobile Walbox wird in einfach in eine Drehstromsteckdose gesteckt und bedarf keiner Festinstallation. Vorteil ist, dass man den Charger auch mal mitnehmen kann und mittels Adapter kann man ihn fast an allen Steckdosen-Varianten betreiben.
Das tolle am go-e Charger ist die Unterstützung von MQTT und REST-API. Damit hat man die volle Kontrolle über das Teil und kann z.B. über NR alles auswerten.
Über hih ist schnell ein virtuelles Gerät angelegt, welches in meinem Fall neben an/aus auch über 2 Modi verfügt: Modus 1 = Schnellladen 11 kW, Modus 2 = pv-moduliertes Laden. Einstellen kann man die Stromstärke (bei mir zwischen 6 und 16 A). Darüberhinaus werden die aktuelle Leistung, die Leistung des momentanen Ladevorgangs sowie die Gesamtleistung dokumentiert.
In NodeRed erfolgt dann die Verknüpfung des Ganzen. Der komplette Flow sieht etwas kompliziert aus, er ist aber eigentlich ganz einfach.
Der Schnelllademodus ist immer standardmäßig eingestellt, wenn das Kabel vom Auto entfernt wird und ist dann immer bei Einstecken eingeschaltet. Wenn das Auto mit Kabel und go-e Charger verbunden ist, kann ich aber dann in den PV-Modus wechseln. In diesem Modus wird die Ladeleistung je nach Überschuss zwischen aus bzw. 6 - 16 A automatisch moduliert, so dass man zu nahezu 100 % Solarstrom laden kann.
Um das ganze in der Garage etwas einfacher zu handhaben, habe ich noch schnell einen Eltako FT55 integriert.
Dieser startet zu einen den pv-modulierten Lademodus und zum anderen kann darüber der Ladevorgang gestoppt und der Ladeport entriegelt werden.
Der komplette Flow zum Ganzen füge ich anbei. Danke nochmals an @langepil!!!
[{"id":"762bc252.823d34","type":"mqtt in","z":"d2cc7511.6de028","name":"go-eCharger - Status","topic":"go-eCharger/XXXXXXstatus","qos":"2","datatype":"auto","broker":"306109be.a1add6","x":120,"y":120,"wires":[["b63034aa.607a8"]]},{"id":"b63034aa.607a8","type":"json","z":"d2cc7511.6de028","name":"","pretty":false,"x":110,"y":200,"wires":[["d7ed96eb.d29e5","ffffda90.faed38","eebccffd.e4c7a","d0d2bfb9.8b4c","f2f4d0d.05db0b","cfb7c2dc.2bdcc8","c371c08a.f587b"]]},{"id":"d7ed96eb.d29e5","type":"function","z":"d2cc7511.6de028","name":"Ladestrom","func":"msg.payload = {\"attribute\":{\"id\":1002,\"value\":Number(msg.payload.amp)}};\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":160,"wires":[["dca31b93.743b6"]]},{"id":"d37b148d.2a106","type":"switch","z":"d2cc7511.6de028","name":"Knöpfe","property":"payload.attributeId","propertyType":"msg","rules":[{"t":"eq","v":"1001","vt":"num"},{"t":"eq","v":"1002","vt":"str"},{"t":"eq","v":"1005","vt":"str"}],"checkall":"false","repair":false,"outputs":3,"x":180,"y":700,"wires":[["d9410886.cf596"],["74054c46.c6f3dc"],["24c4620c.571e56"]],"outputLabels":["Modus","Ladestrom","Aktivierung"]},{"id":"8f3c17b7.0df1b8","type":"mqtt out","z":"d2cc7511.6de028","name":"go-eCharger - Request","topic":"go-eCharger/XXXXXX/cmd/req","qos":"","retain":"","broker":"306109be.a1add6","x":1030,"y":680,"wires":[]},{"id":"74054c46.c6f3dc","type":"function","z":"d2cc7511.6de028","name":"Ladestrom","func":"msg.payload = \"amp=\"+msg.payload.targetValue;\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":680,"wires":[["8f3c17b7.0df1b8"]]},{"id":"1d027928.a9344f","type":"link in","z":"d2cc7511.6de028","name":"","links":["fdc5ff24.5cadb"],"x":75,"y":700,"wires":[["d37b148d.2a106"]]},{"id":"fdc5ff24.5cadb","type":"link out","z":"d2cc7511.6de028","name":"go-eCharger OUT","links":["1d027928.a9344f"],"x":1135,"y":180,"wires":[]},{"id":"ffffda90.faed38","type":"function","z":"d2cc7511.6de028","name":"akt. Ladevorgang","func":"msg.payload = {\"attribute\":{\"id\":1006,\"value\":Number(msg.payload.dws)*10/3600/1000}};\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":200,"wires":[["1a1f3c6f.e516bc"]]},{"id":"25571f33.1883c","type":"homeeDevice","z":"d2cc7511.6de028","virtual-homee":"","name":"go-eCharger","nodeId":"1000","profile":"11","icon":"default","attributes":"[{\"id\":1001,\"node_id\":1000,\"instance\":0,\"minimum\":1,\"maximum\":2,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"Modus\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":1573669587,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\",\"options\":{\"automations\":[\"step\"]}},{\"id\":1002,\"node_id\":1000,\"instance\":1,\"minimum\":6,\"maximum\":16,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"A\",\"step_value\":1,\"editable\":1,\"type\":2,\"state\":1,\"last_changed\":1573669587,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\",\"options\":{\"automations\":[\"step\"]}},{\"id\":1005,\"node_id\":1000,\"instance\":0,\"minimum\":0,\"maximum\":1,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"\",\"step_value\":1,\"editable\":1,\"type\":1,\"state\":1,\"last_changed\":1577388774,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":1006,\"node_id\":1000,\"instance\":0,\"minimum\":0,\"maximum\":100,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh (Ladevorgang)\",\"step_value\":0.01,\"editable\":0,\"type\":4,\"state\":1,\"last_changed\":1579510989,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":1007,\"node_id\":1000,\"instance\":0,\"minimum\":0,\"maximum\":25000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"W\",\"step_value\":1,\"editable\":0,\"type\":3,\"state\":1,\"last_changed\":1579512125,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"},{\"id\":1008,\"node_id\":1000,\"instance\":1,\"minimum\":0,\"maximum\":100000,\"current_value\":0,\"target_value\":0,\"last_value\":0,\"unit\":\"kWh (Gesamt)\",\"step_value\":0.01,\"editable\":0,\"type\":4,\"state\":1,\"last_changed\":1579510989,\"changed_by\":1,\"changed_by_id\":0,\"based_on\":1,\"data\":\"\"}]","x":990,"y":180,"wires":[["fdc5ff24.5cadb"]]},{"id":"d9410886.cf596","type":"switch","z":"d2cc7511.6de028","name":"","property":"payload.targetValue","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"},{"t":"eq","v":"2","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":350,"y":620,"wires":[["a8eafca.d7d268"],["11206bde.bbac1c"]],"outputLabels":["Sofort","Strompreis"]},{"id":"a8eafca.d7d268","type":"function","z":"d2cc7511.6de028","name":"Sofort","func":"global.set(\"goeModus\",1);\nvar msg1 = { payload:\"amp=16\" };\nvar msg2 = { payload:\"ast=0\" };\nvar msg3 = { payload:\"alw=1\" };\nvar msg4 = { payload:\"stp=0\" };\nreturn [ [ msg1, msg2, msg3, msg4 ]];","outputs":1,"noerr":0,"x":530,"y":600,"wires":[["8f3c17b7.0df1b8"]]},{"id":"24c4620c.571e56","type":"function","z":"d2cc7511.6de028","name":"Aktivierung","func":"msg.payload = \"alw=\"+msg.payload.targetValue;\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":720,"wires":[["8f3c17b7.0df1b8"]]},{"id":"eebccffd.e4c7a","type":"function","z":"d2cc7511.6de028","name":"Aktivierung","func":"msg.payload = {\"attribute\":{\"id\":1005,\"value\":Number(msg.payload.alw)}};\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":120,"wires":[["82c82650.61aae8"]]},{"id":"d0d2bfb9.8b4c","type":"function","z":"d2cc7511.6de028","name":"akt. Ladeleistung","func":"msg.payload = {\"attribute\":{\"id\":1007,\"value\":Number(msg.payload.nrg[11])*10}};\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":240,"wires":[["394603f1.1d43dc"]]},{"id":"f2f4d0d.05db0b","type":"function","z":"d2cc7511.6de028","name":"Gesamt","func":"msg.payload = {\"attribute\":{\"id\":1008,\"value\":Number(msg.payload.eto)/10}};\nreturn msg;","outputs":1,"noerr":0,"x":540,"y":280,"wires":[["e5928d.d8955d7"]]},{"id":"11206bde.bbac1c","type":"function","z":"d2cc7511.6de028","name":"Überschuss Start","func":"global.set(\"goeModus\",2);\nvar msg1 = { payload:\"amp=6\" };\nvar msg2 = { payload:\"ast=0\" };\nvar msg3 = { payload:\"alw=0\" };\nvar msg4 = { payload:\"stp=0\" };\nreturn [ [ msg1, msg2, msg3, msg4 ]];","outputs":1,"noerr":0,"x":570,"y":640,"wires":[["8f3c17b7.0df1b8"]]},{"id":"82c82650.61aae8","type":"rbe","z":"d2cc7511.6de028","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":770,"y":120,"wires":[["25571f33.1883c"]]},{"id":"dca31b93.743b6","type":"rbe","z":"d2cc7511.6de028","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":770,"y":160,"wires":[["25571f33.1883c"]]},{"id":"1a1f3c6f.e516bc","type":"rbe","z":"d2cc7511.6de028","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":770,"y":200,"wires":[["25571f33.1883c"]]},{"id":"394603f1.1d43dc","type":"rbe","z":"d2cc7511.6de028","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":770,"y":240,"wires":[["25571f33.1883c"]]},{"id":"e5928d.d8955d7","type":"rbe","z":"d2cc7511.6de028","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":770,"y":280,"wires":[["25571f33.1883c"]]},{"id":"cfb7c2dc.2bdcc8","type":"switch","z":"d2cc7511.6de028","name":"Auto da?","property":"payload.car","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"str"}],"checkall":"true","repair":false,"outputs":1,"x":340,"y":320,"wires":[["8c3365c.d368a18","a8eafca.d7d268"]]},{"id":"8c3365c.d368a18","type":"function","z":"d2cc7511.6de028","name":"Modus = 1","func":"msg.payload = {\"attribute\":{\"id\":1001,\"value\":1}};\nreturn msg;","outputs":1,"noerr":0,"x":550,"y":360,"wires":[["ea2a65a1.40eef8"]]},{"id":"ea2a65a1.40eef8","type":"delay","z":"d2cc7511.6de028","name":"1msg/10s","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"10","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":760,"y":360,"wires":[["25571f33.1883c"]]},{"id":"9e06d231.5af818","type":"function","z":"d2cc7511.6de028","name":"Start Überschussladung","func":"var aktUeberschuss = global.get(\"Einspeisung\");\nvar msgFreigabe;\n\nif (global.get(\"goeModus\") == 2 && Number(msg.payload.car) == 4 && Number(msg.payload.alw) === 0 && aktUeberschuss > 4140) {\n msgFreigabe = { payload:\"alw=1\" };\n}\nreturn msgFreigabe;","outputs":1,"noerr":0,"x":590,"y":440,"wires":[["8f3c17b7.0df1b8"]]},{"id":"7892248d.6e1474","type":"function","z":"d2cc7511.6de028","name":"Stopp Überschussladung","func":"var aktUeberschuss = global.get(\"Einspeisung\");\nvar msgFreigabe;\nvar negBatterie = global.get(\"Batterieentladung\");\nif (global.get(\"goeModus\") == 2 && Number(msg.payload.car) == 2 && Number(msg.payload.amp) == 6 && negBatterie < -500) {\n msgFreigabe = { payload:\"alw=0\" };\n}\nreturn msgFreigabe;","outputs":1,"noerr":0,"x":590,"y":520,"wires":[["8f3c17b7.0df1b8"]]},{"id":"c371c08a.f587b","type":"delay","z":"d2cc7511.6de028","name":"1Msg/30s","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"30","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":340,"y":440,"wires":[["9e06d231.5af818","7892248d.6e1474","a5595e46.56abd"]]},{"id":"a5595e46.56abd","type":"function","z":"d2cc7511.6de028","name":"Regelung Überschussladung","func":"var aktUeberschuss = global.get(\"Einspeisung\");\nvar negNetzbezug = global.get(\"Netzbezug\");\nvar negBatterie = global.get(\"Batterieentladung\");\nvar Ladestrom;\nvar msgLadestrom;\nif (global.get(\"goeModus\") == 2 && Number(msg.payload.car) == 2) {\n Ladestrom = (Number(msg.payload.amp) + ((aktUeberschuss + negNetzbezug + negBatterie) / 710)).toFixed(0); \n if (Ladestrom > 16)\n Ladestrom = 16;\n else if (Ladestrom < 6)\n Ladestrom = 6;\n msgLadestrom = { payload:\"amp=\"+Ladestrom };\n}\nreturn msgLadestrom;","outputs":1,"noerr":0,"x":600,"y":480,"wires":[["8f3c17b7.0df1b8"]]},{"id":"6bb3dcb7.edad5c","type":"function","z":"d2cc7511.6de028","name":"FT Garage Tesla","func":"var attribute = msg.payload.attribute;\nvar taster = 1855;\nif (attribute && attribute.id === taster && attribute.current_value === 1 ) {return [{payload: true}];}\nif (attribute && attribute.id === taster && attribute.current_value === 0 ) {return [{payload: true}];}\nif (attribute && attribute.id === taster && attribute.current_value === 2 ) {return [null,null,{payload: true}];}","outputs":2,"noerr":0,"x":340,"y":840,"wires":[["eb1fd96a.85bd4","23d1eb95.2bb8ac"],["eb1fd96a.85bd4","23d1eb95.2bb8ac"]],"outputLabels":["Taster 1 oben gedrückt","Taster 1 unten gedrückt"]},{"id":"e9c882da.40c2","type":"function","z":"d2cc7511.6de028","name":"Unlock","func":"if (msg.payload === true){\n return {payload: \"\" };\n}\n","outputs":1,"noerr":0,"x":800,"y":840,"wires":[["46d66d4.fcf9894"]]},{"id":"eb1fd96a.85bd4","type":"delay","z":"d2cc7511.6de028","name":"","pauseType":"delay","timeout":"1000","timeoutUnits":"milliseconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":580,"y":840,"wires":[["e9c882da.40c2"]]},{"id":"b4377e8a.05c94","type":"link in","z":"d2cc7511.6de028","name":"","links":["f229ac51.6e949"],"x":215,"y":840,"wires":[["6bb3dcb7.edad5c"]]},{"id":"46d66d4.fcf9894","type":"login","z":"d2cc7511.6de028","name":"Tessi","x":370,"y":880,"wires":[["8aecd0b1.90a508"]]},{"id":"8aecd0b1.90a508","type":"json","z":"d2cc7511.6de028","name":"","x":550,"y":880,"wires":[["23179821.bf108"]]},{"id":"23179821.bf108","type":"command","z":"d2cc7511.6de028","name":"Unlock Charge Port","command":"open_charge_port","x":770,"y":880,"wires":[[]]},{"id":"23d1eb95.2bb8ac","type":"function","z":"d2cc7511.6de028","name":"Ladestop","func":"if (msg.payload === true){\n return {payload: \"alw=0\" };\n}","outputs":1,"noerr":0,"x":540,"y":800,"wires":[["8f3c17b7.0df1b8"]]},{"id":"306109be.a1add6","type":"mqtt-broker","z":"","name":"","broker":"192.168.1.27","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Ich hoffe ich konnte euch etwas inspirieren…
Viel Spaß beim Nachmachen! Bei Fragen meldet euch gerne.
Schönen Sonntag noch.
Michael