Beispiele: openWB Integration an Node-Red
Verfasst: 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.
..der Flow für die EVU Werte im Node-Red Dashboard:
und als Export zum Import in Node-Red:
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.
..der Flow für die EVU Werte im Node-Red Dashboard:
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}]