Seite 2 von 7

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Sa Okt 31, 2020 7:44 am
von Berge
Vielen dank für das Node-Red Beispiel. Ich habe das Ganze etwas erweitert um eine Leistungsanzeige und die Einstellung des Lademodus.
Kleiner Hinweis für Neuanfänger wie mich: Die Nutzung des Beispiels setzt voraus, dass man folgende Pakete bei Node-Red installiert (am besten über das Webinterface unter Palette):
- node-red-dashboard
- node-red-contrib-moment

Code: Alles auswählen

[{"id":"c1de56d7.8a602","type":"tab","label":"OpenWB-EVU","disabled":false,"info":""},{"id":"fbb90dc5.fbb6","type":"switch","z":"c1de56d7.8a602","name":"OPENWB EVU","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"evu/VPhase1","vt":"str"},{"t":"cont","v":"evu/VPhase2","vt":"str"},{"t":"cont","v":"evu/VPhase3","vt":"str"},{"t":"cont","v":"evu/APhase1","vt":"str"},{"t":"cont","v":"evu/APhase2","vt":"str"},{"t":"cont","v":"evu/APhase3","vt":"str"},{"t":"eq","v":"openWB/evu/W","vt":"str"},{"t":"eq","v":"openWB/pv/W","vt":"str"},{"t":"else"}],"checkall":"true","repair":true,"outputs":9,"x":500,"y":380,"wires":[["cc1bf6d5.6d2c1"],["b5e8c2f4.623d28"],["7f78c5b4.b3acac"],["4f78d5f8.254f14","799d0d80.bb3da4"],["d670dab5.7f7f18","fe6f6572.572228"],["8b00022d.9bb71","c4bb8075.2f3498"],["d165eda.37b251"],[],["d60f854e.e5e078"]]},{"id":"cc1bf6d5.6d2c1","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":6,"width":"3","height":"1","name":"EVU V1","label":"V1:","format":"{{msg.payload}}V","layout":"row-center","x":1020,"y":160,"wires":[]},{"id":"b5e8c2f4.623d28","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":7,"width":"3","height":"1","name":"EVU V2","label":"V2:","format":"{{msg.payload}}V","layout":"row-center","x":1020,"y":200,"wires":[]},{"id":"7f78c5b4.b3acac","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":8,"width":"3","height":"1","name":"EVU V3","label":"V3:","format":"{{msg.payload}}V","layout":"row-center","x":1020,"y":240,"wires":[]},{"id":"4f78d5f8.254f14","type":"ui_gauge","z":"c1de56d7.8a602","name":"","group":"910cd9b8.54f308","order":9,"width":"3","height":"2","gtype":"gage","title":"EVU A1","label":"A","format":"{{value}}","min":0,"max":"64","colors":["#00b500","#e6e600","#ca3838"],"seg1":"16","seg2":"32","x":1020,"y":280,"wires":[]},{"id":"d670dab5.7f7f18","type":"ui_gauge","z":"c1de56d7.8a602","name":"","group":"910cd9b8.54f308","order":10,"width":"3","height":"2","gtype":"gage","title":"EVU A2","label":"A","format":"{{value}}","min":0,"max":"64","colors":["#00b500","#e6e600","#ca3838"],"seg1":"16","seg2":"32","x":1020,"y":320,"wires":[]},{"id":"8b00022d.9bb71","type":"ui_gauge","z":"c1de56d7.8a602","name":"","group":"910cd9b8.54f308","order":11,"width":"3","height":"2","gtype":"gage","title":"EVU A3","label":"A","format":"{{value}}","min":0,"max":"64","colors":["#00b500","#e6e600","#ca3838"],"seg1":"16","seg2":"32","x":1020,"y":360,"wires":[]},{"id":"92024dfb.661c9","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":1,"width":"9","height":"1","name":"Datum","label":"Datum","format":"{{msg.payload}}","layout":"row-center","x":1010,"y":560,"wires":[]},{"id":"d165eda.37b251","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":3,"width":"3","height":"1","name":"EVU Leistung","label":"EVU","format":"{{msg.payload}}W","layout":"row-spread","x":1040,"y":480,"wires":[]},{"id":"799d0d80.bb3da4","type":"change","z":"c1de56d7.8a602","name":"L1","rules":[{"t":"set","p":"topic","pt":"msg","to":"L1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":40,"wires":[["8d3ebe41.6f0ed"]]},{"id":"fe6f6572.572228","type":"change","z":"c1de56d7.8a602","name":"L2","rules":[{"t":"set","p":"topic","pt":"msg","to":"L2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":80,"wires":[["8d3ebe41.6f0ed"]]},{"id":"c4bb8075.2f3498","type":"change","z":"c1de56d7.8a602","name":"L3","rules":[{"t":"set","p":"topic","pt":"msg","to":"L3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":730,"y":120,"wires":[["8d3ebe41.6f0ed"]]},{"id":"8d3ebe41.6f0ed","type":"ui_chart","z":"c1de56d7.8a602","name":"EVU Amps","group":"910cd9b8.54f308","order":12,"width":0,"height":0,"label":"EVU - L1 L2 L3 (A)","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#0080ff","#00ff40","#ff0000","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":930,"y":80,"wires":[[]]},{"id":"84042e47.755ed","type":"mqtt in","z":"c1de56d7.8a602","name":"EVU","topic":"openWB/evu/+","qos":"2","datatype":"auto","broker":"82560540.6c0f78","x":170,"y":380,"wires":[["fbb90dc5.fbb6"]]},{"id":"d60f854e.e5e078","type":"function","z":"c1de56d7.8a602","name":"timestamp","func":"msg.payload = new Date().toISOString();\nreturn msg;","outputs":1,"noerr":0,"x":590,"y":580,"wires":[["7db45a05.7909f4"]]},{"id":"7db45a05.7909f4","type":"moment","z":"c1de56d7.8a602","name":"dd DD.MM.YY - HH:mm","topic":"date","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"dd DD.MM.YY - HH:mm","locale":"DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":610,"y":640,"wires":[["feaa483b.0f9168"]]},{"id":"feaa483b.0f9168","type":"rbe","z":"c1de56d7.8a602","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":850,"y":640,"wires":[["92024dfb.661c9","651a048e.bd8e14"]]},{"id":"8066c64b.9ff89","type":"mqtt out","z":"c1de56d7.8a602","name":"to openWB","topic":"","qos":"","retain":"","broker":"82560540.6c0f78","x":1030,"y":780,"wires":[]},{"id":"651a048e.bd8e14","type":"change","z":"c1de56d7.8a602","name":"openWB/evu/date","rules":[{"t":"set","p":"topic","pt":"msg","to":"openWB/evu/date","tot":"str"},{"t":"set","p":"retain","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":780,"y":720,"wires":[["8066c64b.9ff89"]]},{"id":"cd29ee39.63a3d8","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":4,"width":"3","height":"1","name":"PV Leistung","label":"PV","format":"{{msg.payload}}W","layout":"row-spread","x":1030,"y":520,"wires":[]},{"id":"7dcb682a.0d8708","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":5,"width":"3","height":"1","name":"Verbrauch","label":"Verbrauch","format":"{{msg.payload}}W","layout":"row-spread","x":1030,"y":440,"wires":[]},{"id":"917a7b.94239d88","type":"ui_text","z":"c1de56d7.8a602","group":"910cd9b8.54f308","order":2,"width":"9","height":"1","name":"","label":"Leistung","format":"","layout":"row-center","x":1020,"y":400,"wires":[]},{"id":"d7e55154.4aace8","type":"mqtt in","z":"c1de56d7.8a602","name":"PV","topic":"openWB/pv/+","qos":"2","datatype":"auto","broker":"82560540.6c0f78","x":170,"y":480,"wires":[["f583653f.663ed"]]},{"id":"f583653f.663ed","type":"switch","z":"c1de56d7.8a602","name":"OPENWB PV","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"openWB/pv/W","vt":"str"},{"t":"eq","v":"openWB/pv/DailyYieldKwh","vt":"str"}],"checkall":"true","repair":true,"outputs":2,"x":500,"y":480,"wires":[["90e59c41.b79cc"],[]]},{"id":"90e59c41.b79cc","type":"function","z":"c1de56d7.8a602","name":"pvPlus","func":"var pvPlus = msg.payload;\npvPlus = -pvPlus;\nreturn {payload:pvPlus};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":770,"y":520,"wires":[["cd29ee39.63a3d8"]]},{"id":"4ce1694d.be774","type":"ui_dropdown","z":"c1de56d7.8a602","name":"Charge Mode","label":"Lademodus","tooltip":"","place":"Select option","group":"910cd9b8.54f308","order":12,"width":0,"height":0,"passthru":false,"multiple":false,"options":[{"label":"Sofortladen","value":"0","type":"str"},{"label":"Min + PV","value":"1","type":"str"},{"label":"PV-Laden","value":"2","type":"str"},{"label":"Stop","value":"3","type":"str"},{"label":"Standby","value":"4","type":"str"}],"payload":"","topic":"openWB/set/ChargeMode","x":520,"y":780,"wires":[["8066c64b.9ff89"]]},{"id":"c2decfa8.b827e","type":"mqtt in","z":"c1de56d7.8a602","name":"ChargeMode","topic":"openWB/set/ChargeMode","qos":"2","datatype":"auto","broker":"82560540.6c0f78","x":190,"y":780,"wires":[["4ce1694d.be774"]]},{"id":"e331ead8.bf015","type":"mqtt in","z":"c1de56d7.8a602","name":"HouseConsumption","topic":"openWB/global/WHouseConsumption","qos":"2","datatype":"auto","broker":"82560540.6c0f78","x":210,"y":560,"wires":[["7dcb682a.0d8708"]]},{"id":"910cd9b8.54f308","type":"ui_group","name":"Übersicht","tab":"d55078b2.26bcd8","order":1,"disp":true,"width":"9","collapse":false},{"id":"82560540.6c0f78","type":"mqtt-broker","name":"WallBoxGarage","broker":"192.168.177.60","port":"1883","clientid":"","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"d55078b2.26bcd8","type":"ui_tab","name":"OPENWB","icon":"dashboard","order":2,"disabled":false,"hidden":false}]
Unter Global Configuration Nodes, mqtt Broker kann man dann die OpenWB hinzufügen.

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Sa Okt 31, 2020 9:21 am
von hominidae
...sehr schön, das Du das erweitert hast.
Ich nutze das Dashboard für die openWB gar nicht mehr, sondern Blynk....natürlich angebunden durch node-red.

Das Beispiel ist aus den ersten Tagen der openWB, wo MQTT noch ganz neu war und noch nicht so viele Topics vorhanden waren.
Auch wird die Datumsanzeige im Dashboard im "Human readable Format" (dafür eben node-contrib-moment) wieder in die openWB geschrieben, was eigentlich nicht die feine englische Art ist..inzwischen gibt es da unter openWB/system/Date ein eigenes Topics.

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Di Sep 21, 2021 1:24 pm
von Werner2000x
[Ich habe mir auch mal in NodeRed was programmiert.
Den ChargeMode habe ich mal anders modelliert s.Bild.
Auf einem Handy kann man die OpenWB so einfach bedienen.

NodeRed Code:

Code: Alles auswählen

[
    {
        "id": "59812e76.282eb",
        "type": "tab",
        "label": "Wallbox",
        "disabled": false,
        "info": ""
    },
    {
        "id": "d21437f6.cd79c8",
        "type": "ui_switch",
        "z": "59812e76.282eb",
        "name": "",
        "label": "Min + PV : 1",
        "tooltip": "",
        "group": "dbe87afe.d08e98",
        "order": 1,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "x": 970,
        "y": 380,
        "wires": [
            [
                "8b4c00ee.f15d5",
                "156b5a33.34a2d6",
                "1b63f614.eda3ca"
            ]
        ]
    },
    {
        "id": "2e661d83.259ce2",
        "type": "ui_switch",
        "z": "59812e76.282eb",
        "name": "",
        "label": "Nur PV : 2",
        "tooltip": "",
        "group": "dbe87afe.d08e98",
        "order": 3,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "x": 970,
        "y": 520,
        "wires": [
            [
                "abdfec1e.3f679",
                "d403d3a0.979de",
                "7eb839f3.060568"
            ]
        ]
    },
    {
        "id": "8b4c00ee.f15d5",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "radio",
        "func": "if (msg.payload === true) return {payload: false};",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 520,
        "wires": [
            [
                "80da9ece.cecb2",
                "5aed47f1.9a98d8",
                "a3440b67.bbad58",
                "2e661d83.259ce2"
            ]
        ]
    },
    {
        "id": "abdfec1e.3f679",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "radio",
        "func": "if (msg.payload === true) return {payload: false};",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 420,
        "wires": [
            [
                "d21437f6.cd79c8",
                "80da9ece.cecb2",
                "5aed47f1.9a98d8",
                "a3440b67.bbad58"
            ]
        ]
    },
    {
        "id": "a3440b67.bbad58",
        "type": "ui_switch",
        "z": "59812e76.282eb",
        "name": "",
        "label": "Stop Laden : 3",
        "tooltip": "",
        "group": "dbe87afe.d08e98",
        "order": 4,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "x": 980,
        "y": 160,
        "wires": [
            [
                "4c4a4fa8.de13a",
                "cf5ab9e7.84e4e8",
                "dbb6b92c.59d228"
            ]
        ]
    },
    {
        "id": "e719faff.fe33f8",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "radio",
        "func": "if (msg.payload === true) return {payload: false};",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 320,
        "wires": [
            [
                "a3440b67.bbad58",
                "d21437f6.cd79c8",
                "2e661d83.259ce2",
                "80da9ece.cecb2"
            ]
        ]
    },
    {
        "id": "4c4a4fa8.de13a",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "radio",
        "func": "if (msg.payload === true) return {payload: false};",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 550,
        "y": 220,
        "wires": [
            [
                "5aed47f1.9a98d8",
                "d21437f6.cd79c8",
                "2e661d83.259ce2",
                "80da9ece.cecb2"
            ]
        ]
    },
    {
        "id": "5aed47f1.9a98d8",
        "type": "ui_switch",
        "z": "59812e76.282eb",
        "name": "",
        "label": "Sofortladen : 0",
        "tooltip": "",
        "group": "dbe87afe.d08e98",
        "order": 2,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "x": 980,
        "y": 260,
        "wires": [
            [
                "e719faff.fe33f8",
                "c314e2da.fc874",
                "58ac18b6.950008"
            ]
        ]
    },
    {
        "id": "80da9ece.cecb2",
        "type": "ui_switch",
        "z": "59812e76.282eb",
        "name": "",
        "label": "StandBy : 4",
        "tooltip": "",
        "group": "dbe87afe.d08e98",
        "order": 5,
        "width": 0,
        "height": 0,
        "passthru": true,
        "decouple": "false",
        "topic": "",
        "topicType": "str",
        "style": "",
        "onvalue": "true",
        "onvalueType": "bool",
        "onicon": "",
        "oncolor": "",
        "offvalue": "false",
        "offvalueType": "bool",
        "officon": "",
        "offcolor": "",
        "animate": true,
        "x": 970,
        "y": 620,
        "wires": [
            [
                "579d41c7.5b603",
                "3cee3fe5.66f77",
                "47c38cd1.704654"
            ]
        ]
    },
    {
        "id": "579d41c7.5b603",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "radio",
        "func": "if (msg.payload === true) return {payload: false};",
        "outputs": 1,
        "noerr": 0,
        "x": 550,
        "y": 620,
        "wires": [
            [
                "2e661d83.259ce2",
                "d21437f6.cd79c8",
                "5aed47f1.9a98d8",
                "a3440b67.bbad58"
            ]
        ]
    },
    {
        "id": "a26c7b11.b45258",
        "type": "ioBroker in",
        "z": "59812e76.282eb",
        "name": "openWB/global/ChargeMode",
        "topic": "mqtt.0.openWB.global.ChargeMode",
        "payloadType": "value",
        "onlyack": "",
        "func": "all",
        "gap": "",
        "fireOnStart": "false",
        "x": 520,
        "y": 40,
        "wires": [
            [
                "7d3d891e.ac20d8",
                "407535b8.c63b2c"
            ]
        ]
    },
    {
        "id": "7d3d891e.ac20d8",
        "type": "debug",
        "z": "59812e76.282eb",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 990,
        "y": 40,
        "wires": []
    },
    {
        "id": "d403d3a0.979de",
        "type": "debug",
        "z": "59812e76.282eb",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1210,
        "y": 520,
        "wires": []
    },
    {
        "id": "3cee3fe5.66f77",
        "type": "debug",
        "z": "59812e76.282eb",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1210,
        "y": 620,
        "wires": []
    },
    {
        "id": "cf5ab9e7.84e4e8",
        "type": "debug",
        "z": "59812e76.282eb",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1210,
        "y": 160,
        "wires": []
    },
    {
        "id": "c314e2da.fc874",
        "type": "debug",
        "z": "59812e76.282eb",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1210,
        "y": 260,
        "wires": []
    },
    {
        "id": "156b5a33.34a2d6",
        "type": "debug",
        "z": "59812e76.282eb",
        "name": "",
        "active": true,
        "tosidebar": true,
        "console": false,
        "tostatus": true,
        "complete": "payload",
        "targetType": "msg",
        "statusVal": "payload",
        "statusType": "auto",
        "x": 1210,
        "y": 380,
        "wires": []
    },
    {
        "id": "1b63f614.eda3ca",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "1= Min + PV",
        "func": "if (msg.payload == 1) msg.payload = 1;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 990,
        "y": 340,
        "wires": [
            [
                "4e6605b0.a239cc"
            ]
        ]
    },
    {
        "id": "f2c35423.6a8678",
        "type": "ioBroker out",
        "z": "59812e76.282eb",
        "name": "openWB/set/ChargeMode",
        "topic": "mqtt.0.openWB.set.ChargeMode",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1230,
        "y": 100,
        "wires": []
    },
    {
        "id": "dbb6b92c.59d228",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "3= Stop Laden",
        "func": "if (msg.payload == 1) msg.payload = 3;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 1000,
        "y": 100,
        "wires": [
            [
                "f2c35423.6a8678"
            ]
        ]
    },
    {
        "id": "4e6605b0.a239cc",
        "type": "ioBroker out",
        "z": "59812e76.282eb",
        "name": "openWB/set/ChargeMode",
        "topic": "mqtt.0.openWB.set.ChargeMode",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1230,
        "y": 340,
        "wires": []
    },
    {
        "id": "7eb839f3.060568",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "2= Nur PV",
        "func": "if (msg.payload == 1) msg.payload = 2;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 990,
        "y": 460,
        "wires": [
            [
                "69fa2659.d14e08"
            ]
        ]
    },
    {
        "id": "47c38cd1.704654",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "4= StandBy",
        "func": "if (msg.payload == 1) msg.payload = 4;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 970,
        "y": 580,
        "wires": [
            [
                "33fb80b.9fe8f8"
            ]
        ]
    },
    {
        "id": "33fb80b.9fe8f8",
        "type": "ioBroker out",
        "z": "59812e76.282eb",
        "name": "openWB/set/ChargeMode",
        "topic": "mqtt.0.openWB.set.ChargeMode",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1230,
        "y": 580,
        "wires": []
    },
    {
        "id": "69fa2659.d14e08",
        "type": "ioBroker out",
        "z": "59812e76.282eb",
        "name": "openWB/set/ChargeMode",
        "topic": "mqtt.0.openWB.set.ChargeMode",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1230,
        "y": 480,
        "wires": []
    },
    {
        "id": "58ac18b6.950008",
        "type": "function",
        "z": "59812e76.282eb",
        "name": "0= Stop Laden",
        "func": "if (msg.payload == 1) msg.payload = 0;\nreturn msg;",
        "outputs": 1,
        "noerr": 0,
        "initialize": "",
        "finalize": "",
        "libs": [],
        "x": 980,
        "y": 220,
        "wires": [
            [
                "d901125.0fce3f"
            ]
        ]
    },
    {
        "id": "d901125.0fce3f",
        "type": "ioBroker out",
        "z": "59812e76.282eb",
        "name": "openWB/set/ChargeMode",
        "topic": "mqtt.0.openWB.set.ChargeMode",
        "ack": "false",
        "autoCreate": "false",
        "stateName": "",
        "role": "",
        "payloadType": "",
        "readonly": "",
        "stateUnit": "",
        "stateMin": "",
        "stateMax": "",
        "x": 1230,
        "y": 220,
        "wires": []
    },
    {
        "id": "407535b8.c63b2c",
        "type": "ui_text",
        "z": "59812e76.282eb",
        "group": "dbe87afe.d08e98",
        "order": 6,
        "width": 0,
        "height": 0,
        "name": "",
        "label": "ChargeMode :",
        "format": "{{msg.payload}}",
        "layout": "row-spread",
        "x": 770,
        "y": 100,
        "wires": []
    },
    {
        "id": "dbe87afe.d08e98",
        "type": "ui_group",
        "name": "Wallbox",
        "tab": "9e6b63bb.c14de",
        "order": 1,
        "disp": true,
        "width": "6",
        "collapse": false
    },
    {
        "id": "9e6b63bb.c14de",
        "type": "ui_tab",
        "name": "OpenWB",
        "icon": "dashboard",
        "order": 3,
        "disabled": false,
        "hidden": false
    }
]

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Mo Okt 04, 2021 11:17 am
von Werner2000x
hominidae hat geschrieben: Sa Nov 09, 2019 10:45 am Hallo Gemeinde,

dank MQTT (mit der REST-API geht es auch, ist aber mehr Arbeit) kann man nun ab 1.64beta die openWB in Node-Red (www.nodered.org) einbinden und so zum Beispiel eigene Dashboards oder komplexere Regeln abbilden.

Hier ein Beispiel, für die Darstellung der EVU Werte und ein Dashboard zur Einstellung für den manuellen Zielladiungsmodus (kWh) inkl. Startverzögerung, gezielt für einen LP.

Bild

..der Flow für die EVU Werte im Node-Red Dashboard:
Bild

und als Export zum Import in Node-Red:

Code: Alles auswählen

[{"id":"90f78b.543da878","type":"tab","label":"OpenWB-EVU","disabled":false,"info":""},{"id":"1920f887.874e27","type":"switch","z":"90f78b.543da878","name":"OPENWB EVU","property":"topic","propertyType":"msg","rules":[{"t":"cont","v":"evu/VPhase1","vt":"str"},{"t":"cont","v":"evu/VPhase2","vt":"str"},{"t":"cont","v":"evu/VPhase3","vt":"str"},{"t":"cont","v":"evu/APhase1","vt":"str"},{"t":"cont","v":"evu/APhase2","vt":"str"},{"t":"cont","v":"evu/APhase3","vt":"str"},{"t":"eq","v":"openWB/evu/W","vt":"str"},{"t":"else"}],"checkall":"false","repair":false,"outputs":8,"x":500,"y":300,"wires":[["58db8671.2eb288"],["278d750c.2e9caa"],["673ac631.70db08"],["7f8dd076.58719","429ddc96.4a0a14"],["4a55f8d5.8da4a8","1232b57f.b5dcab"],["aa1dff4e.07cc4","2420f6ae.b6fb0a"],["c86d07fe.98be38"],["48703c49.cf7214"]]},{"id":"58db8671.2eb288","type":"ui_text","z":"90f78b.543da878","group":"910cd9b8.54f308","order":3,"width":"3","height":"1","name":"EVU V1","label":"V1:","format":"{{msg.payload}}V","layout":"row-center","x":1020,"y":180,"wires":[]},{"id":"278d750c.2e9caa","type":"ui_text","z":"90f78b.543da878","group":"910cd9b8.54f308","order":4,"width":"3","height":"1","name":"EVU V2","label":"V2:","format":"{{msg.payload}}V","layout":"row-center","x":1020,"y":220,"wires":[]},{"id":"673ac631.70db08","type":"ui_text","z":"90f78b.543da878","group":"910cd9b8.54f308","order":5,"width":"3","height":"1","name":"EVU V3","label":"V3:","format":"{{msg.payload}}V","layout":"row-center","x":1020,"y":260,"wires":[]},{"id":"7f8dd076.58719","type":"ui_gauge","z":"90f78b.543da878","name":"","group":"910cd9b8.54f308","order":6,"width":"3","height":"2","gtype":"gage","title":"EVU A1","label":"A","format":"{{value}}","min":0,"max":"64","colors":["#00b500","#e6e600","#ca3838"],"seg1":"16","seg2":"32","x":1020,"y":300,"wires":[]},{"id":"4a55f8d5.8da4a8","type":"ui_gauge","z":"90f78b.543da878","name":"","group":"910cd9b8.54f308","order":7,"width":"3","height":"2","gtype":"gage","title":"EVU A2","label":"A","format":"{{value}}","min":0,"max":"64","colors":["#00b500","#e6e600","#ca3838"],"seg1":"16","seg2":"32","x":1020,"y":340,"wires":[]},{"id":"aa1dff4e.07cc4","type":"ui_gauge","z":"90f78b.543da878","name":"","group":"910cd9b8.54f308","order":8,"width":"3","height":"2","gtype":"gage","title":"EVU A3","label":"A","format":"{{value}}","min":0,"max":"64","colors":["#00b500","#e6e600","#ca3838"],"seg1":"16","seg2":"32","x":1020,"y":380,"wires":[]},{"id":"c3cbc362.ce125","type":"ui_text","z":"90f78b.543da878","group":"910cd9b8.54f308","order":1,"width":"6","height":"1","name":"Datum","label":"Datum","format":"{{msg.payload}}","layout":"col-center","x":1010,"y":460,"wires":[]},{"id":"c86d07fe.98be38","type":"ui_text","z":"90f78b.543da878","group":"910cd9b8.54f308","order":2,"width":"3","height":"1","name":"","label":"Leistung","format":"{{msg.payload}}W","layout":"col-center","x":1020,"y":420,"wires":[]},{"id":"429ddc96.4a0a14","type":"change","z":"90f78b.543da878","name":"L1","rules":[{"t":"set","p":"topic","pt":"msg","to":"L1","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":40,"wires":[["12d1cd38.d956a3"]]},{"id":"1232b57f.b5dcab","type":"change","z":"90f78b.543da878","name":"L2","rules":[{"t":"set","p":"topic","pt":"msg","to":"L2","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":80,"wires":[["12d1cd38.d956a3"]]},{"id":"2420f6ae.b6fb0a","type":"change","z":"90f78b.543da878","name":"L3","rules":[{"t":"set","p":"topic","pt":"msg","to":"L3","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":690,"y":120,"wires":[["12d1cd38.d956a3"]]},{"id":"12d1cd38.d956a3","type":"ui_chart","z":"90f78b.543da878","name":"EVU Amps","group":"910cd9b8.54f308","order":8,"width":0,"height":0,"label":"EVU - L1 L2 L3 (A)","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"86400","cutout":0,"useOneColor":false,"colors":["#0080ff","#00ff40","#ff0000","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":930,"y":80,"wires":[[]]},{"id":"41b64b63.c40fd4","type":"mqtt in","z":"90f78b.543da878","name":"EVU","topic":"openWB/evu/+","qos":"2","datatype":"auto","broker":"bddb336e.6dda","x":170,"y":300,"wires":[["1920f887.874e27"]]},{"id":"48703c49.cf7214","type":"function","z":"90f78b.543da878","name":"timestamp","func":"msg.payload = new Date().toISOString();\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":420,"wires":[["3e4ccaf8.9d2526"]]},{"id":"3e4ccaf8.9d2526","type":"moment","z":"90f78b.543da878","name":"dd DD.MM.YY - HH:mm","topic":"date","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"dd DD.MM.YY - HH:mm","locale":"DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":590,"y":480,"wires":[["f3896d9f.deb5d"]]},{"id":"f3896d9f.deb5d","type":"rbe","z":"90f78b.543da878","name":"","func":"rbe","gap":"","start":"","inout":"out","property":"payload","x":850,"y":460,"wires":[["c3cbc362.ce125","47c2ee55.7a954"]]},{"id":"e6f98b37.f93878","type":"mqtt out","z":"90f78b.543da878","name":"to openWB","topic":"","qos":"","retain":"","broker":"bddb336e.6dda","x":570,"y":640,"wires":[]},{"id":"47c2ee55.7a954","type":"change","z":"90f78b.543da878","name":"openWB/evu/date","rules":[{"t":"set","p":"topic","pt":"msg","to":"openWB/evu/date","tot":"str"},{"t":"set","p":"retain","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":560,"wires":[["e6f98b37.f93878"]]},{"id":"910cd9b8.54f308","type":"ui_group","z":"","name":"EVU","tab":"d55078b2.26bcd8","order":1,"disp":true,"width":"9","collapse":false},{"id":"bddb336e.6dda","type":"mqtt-broker","z":"","name":"mqtt on alarm","broker":"192.168.10.22","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"d55078b2.26bcd8","type":"ui_tab","z":"","name":"OPENWB","icon":"dashboard","order":2,"disabled":false,"hidden":false}]
Kannst du noch den Nodered Code für das LP 1 Zielladen veröffentlichen?

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Do Okt 07, 2021 10:54 am
von hominidae
Werner2000x hat geschrieben: Mo Okt 04, 2021 11:17 am Kannst du noch den Nodered Code für das LP 1 Zielladen veröffentlichen?
...das ist/war nur eine UI Spielerei..die Anbindung zum ansteuern der openWB musst Du noch bauen.
Zu der Zeit gab es die Zielladen- und SoC-Features dort ja noch nicht.

Ich bin aktuell on-the-road ... kann den Flow zur Inspiration mal am We einstellen, wenn ich zurück bin.

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Do Okt 07, 2021 4:50 pm
von Werner2000x
:-)

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Sa Okt 09, 2021 2:43 pm
von hominidae
Werner2000x hat geschrieben: Do Okt 07, 2021 4:50 pm:-)
...OK, hier ist er:

Code: Alles auswählen

[{"id":"135ab1a7.7d7d8e","type":"tab","label":"OpenWB LP1","disabled":false,"info":""},{"id":"8f806a67.b24418","type":"ui_slider","z":"135ab1a7.7d7d8e","name":"","label":"","tooltip":"","group":"cb797d1a.e0522","order":9,"width":"5","height":"1","passthru":true,"outs":"all","topic":"","min":0,"max":"100","step":1,"x":110,"y":60,"wires":[["2b96b93b.00ae76","95b0983c.3831b8","bdf4bfcb.1c9c"]]},{"id":"2b96b93b.00ae76","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":2,"width":"3","height":"1","name":"","label":"SoC (Start)","format":"{{msg.payload}}%","layout":"col-center","x":290,"y":60,"wires":[]},{"id":"d20de990.e5fc38","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":7,"width":"5","height":"1","name":"","label":"kWh","format":"{{msg.payload}}","layout":"col-center","x":430,"y":300,"wires":[]},{"id":"95b0983c.3831b8","type":"function","z":"135ab1a7.7d7d8e","name":"SoC-2-kWh","func":"var lp1socalt=flow.get('lp1socalt') || 0;\nvar max = 28;\nvar l = msg.payload;\nvar p = max / 100 * l;\nmsg.payload = p;\nflow.set('lp1socalt',p);\nreturn msg;","outputs":1,"noerr":0,"x":230,"y":200,"wires":[["453f7b46.22a4b4","4d427657.1e5b78"]]},{"id":"453f7b46.22a4b4","type":"calculator","z":"135ab1a7.7d7d8e","name":"round-3digits","inputMsgField":"payload","outputMsgField":"payload","operation":"rdec","constant":"3","x":220,"y":280,"wires":[["d20de990.e5fc38"]]},{"id":"3ab1c668.c2891a","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":5,"width":"3","height":"1","name":"","label":"SoC (Ziel)","format":"{{msg.payload}}%","layout":"col-center","x":900,"y":60,"wires":[]},{"id":"8eea38da.03d748","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":8,"width":"5","height":"1","name":"","label":"kWh","format":"{{msg.payload}}","layout":"col-center","x":1090,"y":200,"wires":[]},{"id":"b97b321a.87b22","type":"function","z":"135ab1a7.7d7d8e","name":"SoC-2-kWh","func":"var lp1socneu=flow.get('lp1socneu') || 0;\nvar max = 28;\nvar l = msg.payload;\nvar p = max / 100 * l;\nmsg.payload = p;\nflow.set('lp1socneu',p);\nreturn msg;","outputs":1,"noerr":0,"x":910,"y":120,"wires":[["114f484e.ab6388","4d427657.1e5b78"]]},{"id":"114f484e.ab6388","type":"calculator","z":"135ab1a7.7d7d8e","name":"round-3digits","inputMsgField":"payload","outputMsgField":"payload","operation":"rdec","constant":"3","x":1090,"y":100,"wires":[["8eea38da.03d748"]]},{"id":"9419834b.500e1","type":"function","z":"135ab1a7.7d7d8e","name":"Ist + 5 Prozent","func":"var lp1soc=flow.get('lp1soc') || 0;\nvar l = msg.payload;\nif (l<95) {\n    l=l+5;\n}\nflow.set('lp1soc',l);\nmsg.payload = l;\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":140,"wires":[["d892ef61.db736"]]},{"id":"d892ef61.db736","type":"ui_slider","z":"135ab1a7.7d7d8e","name":"","label":"","tooltip":"","group":"cb797d1a.e0522","order":10,"width":"5","height":"1","passthru":true,"outs":"all","topic":"","min":0,"max":"100","step":1,"x":530,"y":60,"wires":[["67b3c8ba.1c5728"]]},{"id":"ff6b2c1c.5210b","type":"function","z":"135ab1a7.7d7d8e","name":"soll > ist","func":"var lp1soc=flow.get('lp1soc') || 0;\nvar l = msg.payload;\nif (l<lp1soc) {\n    l = lp1soc;\n}\nmsg.payload = l;\nreturn msg;","outputs":1,"noerr":0,"x":700,"y":60,"wires":[["3ab1c668.c2891a","b97b321a.87b22"]]},{"id":"368d4489.5a6edc","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":11,"width":"5","height":"1","name":"","label":"Ziel-Lademenge","format":"{{msg.payload}} kWh","layout":"col-center","x":1080,"y":260,"wires":[]},{"id":"d7505c09.f25c4","type":"calculator","z":"135ab1a7.7d7d8e","name":"round-3digits","inputMsgField":"payload","outputMsgField":"payload","operation":"rdec","constant":"3","x":850,"y":260,"wires":[["368d4489.5a6edc"]]},{"id":"4d427657.1e5b78","type":"function","z":"135ab1a7.7d7d8e","name":"SocNeu - SocAlt","func":"var lp1socalt=flow.get('lp1socalt') || 0;\nvar lp1socneu=flow.get('lp1socneu') || 0;\nvar l = lp1socneu - lp1socalt;\nflow.set('lp1energy',l);\nmsg.payload = l;\nreturn msg;","outputs":1,"noerr":0,"x":820,"y":200,"wires":[["d7505c09.f25c4","5a5ccb7c.d4aeb4"]]},{"id":"40da9051.a0232","type":"ui_switch","z":"135ab1a7.7d7d8e","name":"Zielladen an/aus","label":"Zielladen an/aus","tooltip":"","group":"cb797d1a.e0522","order":19,"width":"4","height":"1","passthru":true,"decouple":"false","topic":"","style":"","onvalue":"true","onvalueType":"bool","onicon":"","oncolor":"","offvalue":"false","offvalueType":"bool","officon":"","offcolor":"","x":1060,"y":400,"wires":[[]]},{"id":"9bb18dd0.cef82","type":"ui_led","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":12,"width":"5","height":"1","label":"LP verbunden","labelPlacement":"left","labelAlignment":"center","colorForValue":[{"color":"green","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"name":"LP verbunden","x":1080,"y":320,"wires":[]},{"id":"ce537819.161eb8","type":"function","z":"135ab1a7.7d7d8e","name":"Duration ??A","func":"var l = flow.get('lp1energy') || 0;\nvar ll = flow.get('lp1WhActive') || 0;\nvar Amps = flow.get('lp1amps') || 6;\nvar Duration = flow.get('lp1duration') || 0;\nvar Now = Date.now();\nAmps = msg.payload;\nl = l - ll;\nDuration = l *  1000 * 1000 * 60 * 60 / Amps / 220;\nmsg.payload = Now;\nflow.set('lp1duration', Duration);\nflow.set('lp1amps', Amps);\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":480,"wires":[["5ce236b6.8b1e58"]]},{"id":"bdbf8e68.95b24","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":18,"width":"3","height":"1","name":"Fertig ??A","label":"Ende ","format":"{{msg.payload}}","layout":"col-center","x":1090,"y":480,"wires":[]},{"id":"38169a88.309536","type":"moment","z":"135ab1a7.7d7d8e","name":"to dd DD.MM.YY - HH:mm","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"dd - HH:mm","locale":"DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":860,"y":480,"wires":[["bdbf8e68.95b24"]]},{"id":"903171f1.0c4b1","type":"ui_slider","z":"135ab1a7.7d7d8e","name":"Ladestrom","label":"Ladestrom","tooltip":"","group":"cb797d1a.e0522","order":13,"width":"8","height":"1","passthru":true,"outs":"all","topic":"","min":"6","max":"32","step":1,"x":670,"y":380,"wires":[["1eb55af5.cbdef5","ce537819.161eb8"]]},{"id":"1eb55af5.cbdef5","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":14,"width":"2","height":"1","name":"Leistungstext A","label":" : ","format":"{{msg.payload}}A","layout":"row-spread","x":900,"y":340,"wires":[]},{"id":"5a5ccb7c.d4aeb4","type":"function","z":"135ab1a7.7d7d8e","name":"refresh Amps","func":"var Amps=flow.get('lp1amps') || 6;\nmsg.payload = Amps;\nflow.set('lp1amps', Amps);\nreturn msg;","outputs":1,"noerr":0,"x":600,"y":260,"wires":[["ce537819.161eb8","903171f1.0c4b1"]]},{"id":"5ce236b6.8b1e58","type":"function","z":"135ab1a7.7d7d8e","name":"Date-end","func":"var Duration = flow.get('lp1duration') || 0;\nvar delay = flow.get('lp1delay') || 0;\nvar Now = Date.now();\nNow = msg.payload;\nmsg.payload = Math.floor(Duration + + delay + Now);\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":480,"wires":[["38169a88.309536"]]},{"id":"32be15ed.a4880a","type":"inject","z":"135ab1a7.7d7d8e","name":"15sek Updates","repeat":"15","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":400,"y":540,"wires":[["5ce236b6.8b1e58","b255161d.945d78"]]},{"id":"246385e2.46995a","type":"ui_slider","z":"135ab1a7.7d7d8e","name":"Verzögerung","label":"Ladesstart","tooltip":"","group":"cb797d1a.e0522","order":15,"width":"8","height":"1","passthru":true,"outs":"all","topic":"","min":0,"max":"720","step":"15","x":590,"y":680,"wires":[["d6bdfa4f.0c0de8","6bf67e5c.d70bb"]]},{"id":"842abb3e.329d48","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":17,"width":"3","height":"1","name":"","label":"Start ","format":"{{msg.payload}}","layout":"col-center","x":1090,"y":580,"wires":[]},{"id":"75e65c7f.80e264","type":"moment","z":"135ab1a7.7d7d8e","name":"to dd DD.MM.YY - HH:mm","topic":"","input":"payload","inputType":"msg","inTz":"Europe/Berlin","adjAmount":0,"adjType":"days","adjDir":"add","format":"dd - HH:mm","locale":"DE","output":"payload","outputType":"msg","outTz":"Europe/Berlin","x":840,"y":580,"wires":[["842abb3e.329d48"]]},{"id":"d6bdfa4f.0c0de8","type":"function","z":"135ab1a7.7d7d8e","name":"delay","func":"var delay = flow.get('lp1delay') || 0;\ndelay = msg.payload * 60 * 1000;\nflow.set('lp1delay', delay);\nmsg.payload = delay;\nreturn msg;","outputs":1,"noerr":0,"x":430,"y":620,"wires":[["b255161d.945d78","5a5ccb7c.d4aeb4"]]},{"id":"6bf67e5c.d70bb","type":"ui_text","z":"135ab1a7.7d7d8e","group":"cb797d1a.e0522","order":16,"width":"2","height":"1","name":"Verzögerung (min)","label":": ","format":"{{msg.payload}}min","layout":"row-spread","x":1110,"y":680,"wires":[]},{"id":"b255161d.945d78","type":"function","z":"135ab1a7.7d7d8e","name":"Date-end","func":"var delay = flow.get('lp1delay') || 0;\nvar Now = Date.now();\ndelay = Math.floor(delay + Now);\nmsg.payload = delay;\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":580,"wires":[["75e65c7f.80e264"]]},{"id":"7de5f2cc.b2c62c","type":"ui_button","z":"135ab1a7.7d7d8e","name":"Ist+Plus","group":"cb797d1a.e0522","order":3,"width":"1","height":"1","passthru":false,"label":"+","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"","x":180,"y":480,"wires":[["65065edc.92d71"]]},{"id":"612a14c.56f0eec","type":"ui_button","z":"135ab1a7.7d7d8e","name":"Ist-Minus","group":"cb797d1a.e0522","order":1,"width":"1","height":"1","passthru":false,"label":"-","tooltip":"","color":"","bgcolor":"","icon":"","payload":"1","payloadType":"str","topic":"","x":100,"y":420,"wires":[["b1a98e05.47082"]]},{"id":"8eee3140.d9a91","type":"ui_button","z":"135ab1a7.7d7d8e","name":"Soll-Plus","group":"cb797d1a.e0522","order":6,"width":"1","height":"1","passthru":false,"label":"+","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"num","topic":"","x":120,"y":660,"wires":[["9ab30dd0.570b8"]]},{"id":"c57eedb4.346de","type":"ui_button","z":"135ab1a7.7d7d8e","name":"Soll-Minus","group":"cb797d1a.e0522","order":4,"width":"1","height":"1","passthru":false,"label":"-","tooltip":"","color":"","bgcolor":"","icon":"","payload":"","payloadType":"num","topic":"","x":110,"y":560,"wires":[["178d3712.2e4289"]]},{"id":"b1a98e05.47082","type":"function","z":"135ab1a7.7d7d8e","name":"","func":"var p=flow.get('lp1socA') || 0;\nif (p < 1) {\n    p = 1;\n}\nmsg.payload = p - 1;\nreturn msg;","outputs":1,"noerr":0,"x":110,"y":360,"wires":[["8f806a67.b24418"]]},{"id":"65065edc.92d71","type":"function","z":"135ab1a7.7d7d8e","name":"","func":"var p=flow.get('lp1socA') || 0;\nif (p > 99) {\n    p = 99;\n}\nmsg.payload = p + 1;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":380,"wires":[["8f806a67.b24418"]]},{"id":"9ab30dd0.570b8","type":"function","z":"135ab1a7.7d7d8e","name":"","func":"var l=flow.get('lp1socB') || 0;\nif (l > 99) {\n    l = 99;\n}\nmsg.payload = l + 1;\nreturn msg;","outputs":1,"noerr":0,"x":270,"y":660,"wires":[["d892ef61.db736"]]},{"id":"178d3712.2e4289","type":"function","z":"135ab1a7.7d7d8e","name":"","func":"var l=flow.get('lp1socB') || 0;\nvar p=flow.get('lp1socA') || 0;\nif (p<l) {\n    l = l - 1;\n}\nif (l < 1) {\n    l = 0;\n}\nmsg.payload = l;\nreturn msg;","outputs":1,"noerr":0,"x":250,"y":600,"wires":[["d892ef61.db736"]]},{"id":"67b3c8ba.1c5728","type":"function","z":"135ab1a7.7d7d8e","name":"","func":"var lp1socB=flow.get('lp1socB') || 0;\nvar l = msg.payload;\nif (l > 99) {\n    l = 100;\n}if (l < 1) {\n    l = 0;\n}\nflow.set('lp1socB',l);\nreturn msg;","outputs":1,"noerr":0,"x":620,"y":140,"wires":[["ff6b2c1c.5210b"]]},{"id":"bdf4bfcb.1c9c","type":"function","z":"135ab1a7.7d7d8e","name":"","func":"var lp1socA=flow.get('lp1socA') || 0;\nvar l = msg.payload;\nif (l > 99) {\n    l = 100;\n}\nif (l < 1) {\n    l = 0;\n}\nflow.set('lp1socA', l);\nreturn msg;","outputs":1,"noerr":0,"x":200,"y":140,"wires":[["9419834b.500e1"]]},{"id":"cb797d1a.e0522","type":"ui_group","name":"LP1 Zielladen","tab":"d55078b2.26bcd8","order":2,"disp":true,"width":"10","collapse":false},{"id":"d55078b2.26bcd8","type":"ui_tab","name":"OPENWB","icon":"dashboard","order":2,"disabled":false,"hidden":false}]
...aber eben nur als Inspiration...ist bisher nur das UI und der SoC/km werden berechnet...hier für unseren IONIQ vFL mit 28kWh.
Viele, globals Veriablen zur Synchronisation der einzelnen UI-Elemente....

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Sa Okt 09, 2021 4:48 pm
von Werner2000x
Danke, ich teste es mal am Montag. :-)

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Mo Okt 11, 2021 10:43 am
von Werner2000x
Ja das neue NodeRed Panel klappt schon ganz gut. Ich musste noch das LED-UI installieren, dann lief es. Danke :-)

Nun sind noch Anpassungen an die MQTT Variablen der OpenWB vorzunehmen...

Re: Beispiele: openWB Integration an Node-Red

Verfasst: Do Okt 14, 2021 8:58 pm
von hominidae
...cool,
freut mich, wenn es Dir weiterhilft.
Ich hatte es gebaut, bevor der manuelle SoC Modus überhaupt in der openWB vorhanden war..und der IONIQ vFL hat ja auch keine SoC-Modul Integration. Daher war der Ansatz, den Modus in NR selbst "zu implementieren".

...inzwischen sollte es möglich sein, das aus/mit mqtt der openWB und dem Zielladen-Modus zu verknüpfen.