From 4389be36cf8bc7e3f0ebaf0c34eb501956b9eb31 Mon Sep 17 00:00:00 2001 From: Carsten Schmiemann Date: Wed, 10 Aug 2022 02:37:08 +0200 Subject: [PATCH] added Node Red flows --- node-red-flows/meters.json | 1071 ++++++++++++++++++++++++++++++ node-red-flows/temperatures.json | 264 ++++++++ 2 files changed, 1335 insertions(+) create mode 100644 node-red-flows/meters.json create mode 100644 node-red-flows/temperatures.json diff --git a/node-red-flows/meters.json b/node-red-flows/meters.json new file mode 100644 index 0000000..a76d897 --- /dev/null +++ b/node-red-flows/meters.json @@ -0,0 +1,1071 @@ +[ + { + "id": "f96eea4d4a3a345d", + "type": "tab", + "label": "Meters", + "disabled": false, + "info": "", + "env": [] + }, + { + "id": "b6fc74e8.4967b", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Total kWh", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R114,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 80, + "wires": [ + [ + "3677ad6e.d245a2" + ] + ] + }, + { + "id": "3677ad6e.d245a2", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_total_kwh\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 80, + "wires": [ + [] + ] + }, + { + "id": "79ff2bd4c3604f42", + "type": "inject", + "z": "f96eea4d4a3a345d", + "name": "Poll every 3 sec", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "3", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 130, + "y": 400, + "wires": [ + [ + "b6fc74e8.4967b", + "45b9899aabe3cb69", + "67857677464e4bce", + "5c5702e7ebd71a77", + "ccf9f0980f83375d", + "e2571df80f480199", + "165c27082bf35d11", + "71afb139032cfee2", + "972360a051abdf88", + "21e06b0168fdee41", + "e107fc40d203f46a", + "7586c0c0ec778dad", + "ef783dcc259e1398", + "f748fa2266fa4302", + "ece76e52d325bd6e", + "a5f8ee01c537330b", + "1e1823db7c7b4edd", + "7857cce5b19d21ea" + ] + ] + }, + { + "id": "63e9e27d8597ced3", + "type": "http in", + "z": "f96eea4d4a3a345d", + "name": "", + "url": "/meters", + "method": "get", + "upload": false, + "swaggerDoc": "", + "x": 90, + "y": 1260, + "wires": [ + [ + "c61fcb67b3a33b47" + ] + ] + }, + { + "id": "fbe8cca3419d8161", + "type": "change", + "z": "f96eea4d4a3a345d", + "name": "Set Headers", + "rules": [ + { + "t": "set", + "p": "headers", + "pt": "msg", + "to": "{}", + "tot": "json" + }, + { + "t": "set", + "p": "headers.content-type", + "pt": "msg", + "to": "application/json", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 830, + "y": 1260, + "wires": [ + [ + "83f39f5649b78b86" + ] + ] + }, + { + "id": "83f39f5649b78b86", + "type": "http response", + "z": "f96eea4d4a3a345d", + "name": "", + "statusCode": "", + "headers": {}, + "x": 1070, + "y": 1260, + "wires": [] + }, + { + "id": "c61fcb67b3a33b47", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "Build Object", + "func": "var einspeisung_total_power = global.get(\"einspeisung_total_power\")\nvar einspeisung_total_kwh = global.get(\"einspeisung_total_kwh\")\nvar einspeisung_total_import = global.get(\"einspeisung_total_import\")\nvar einspeisung_total_export = global.get(\"einspeisung_total_export\")\n\nvar einspeisung_l1_voltage = global.get(\"einspeisung_l1_voltage\")\nvar einspeisung_l2_voltage = global.get(\"einspeisung_l2_voltage\")\nvar einspeisung_l3_voltage = global.get(\"einspeisung_l3_voltage\")\n\nvar einspeisung_l1_current = global.get(\"einspeisung_l1_current\")\nvar einspeisung_l2_current = global.get(\"einspeisung_l2_current\")\nvar einspeisung_l3_current = global.get(\"einspeisung_l3_current\")\nvar einspeisung_total_current = parseFloat(parseFloat(einspeisung_l1_current) + parseFloat(einspeisung_l2_current) + parseFloat(einspeisung_l3_current)).toFixed(1)\n\nvar einspeisung_l1_power = global.get(\"einspeisung_l1_power\")\nvar einspeisung_l2_power = global.get(\"einspeisung_l2_power\")\nvar einspeisung_l3_power = global.get(\"einspeisung_l3_power\")\n\nvar einspeisung_l1_import = global.get(\"einspeisung_l1_import\")\nvar einspeisung_l2_import = global.get(\"einspeisung_l2_import\")\nvar einspeisung_l3_import = global.get(\"einspeisung_l3_import\")\n\nvar einspeisung_l1_export = global.get(\"einspeisung_l1_export\")\nvar einspeisung_l2_export = global.get(\"einspeisung_l2_export\")\nvar einspeisung_l3_export = global.get(\"einspeisung_l3_export\")\n\nmsg.payload.einspeisung = {total_power:einspeisung_total_power, total_current:einspeisung_total_current, total_kwh:einspeisung_total_kwh, total_import:einspeisung_total_import, total_export:einspeisung_total_export, l1_voltage:einspeisung_l1_voltage, l2_voltage:einspeisung_l2_voltage, l3_voltage:einspeisung_l3_voltage, l1_current:einspeisung_l1_current, l2_current:einspeisung_l2_current, l3_current:einspeisung_l3_current, l1_power:einspeisung_l1_power, l2_power:einspeisung_l2_power, l3_power:einspeisung_l3_power, l1_import:einspeisung_l1_import, l2_import:einspeisung_l2_import, l3_import:einspeisung_l3_import, l1_export:einspeisung_l1_export, l2_export:einspeisung_l2_export, l3_export:einspeisung_l3_export};\n\nvar keller_total_kwh = global.get(\"keller_total_kwh\")\n//var keller_l1_voltage = global.get(\"keller_l1_voltage\")\nvar keller_l1_current = global.get(\"keller_l1_current\")\nvar keller_l1_power = global.get(\"keller_l1_power\")\n\nmsg.payload.keller = {total_kwh:keller_total_kwh, l1_current:keller_l1_current, l1_power:keller_l1_power};\nreturn msg;\n", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 450, + "y": 1260, + "wires": [ + [ + "307db2619dcf6228" + ] + ] + }, + { + "id": "307db2619dcf6228", + "type": "json", + "z": "f96eea4d4a3a345d", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 650, + "y": 1260, + "wires": [ + [ + "fbe8cca3419d8161" + ] + ] + }, + { + "id": "45b9899aabe3cb69", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Total Import", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R115,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 120, + "wires": [ + [ + "dda7b62c4fed3474" + ] + ] + }, + { + "id": "dda7b62c4fed3474", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_total_import\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 120, + "wires": [ + [] + ] + }, + { + "id": "67857677464e4bce", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Total Export", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R116,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 160, + "wires": [ + [ + "b6730232cea51e3f" + ] + ] + }, + { + "id": "b6730232cea51e3f", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_total_export\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "5c5702e7ebd71a77", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Voltage L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R100,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 200, + "wires": [ + [ + "f5853a536891d509" + ] + ] + }, + { + "id": "f5853a536891d509", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_l1_voltage\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 200, + "wires": [ + [] + ] + }, + { + "id": "ccf9f0980f83375d", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Voltage L2", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R101,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 240, + "wires": [ + [ + "a3b33ef1225b85e7" + ] + ] + }, + { + "id": "a3b33ef1225b85e7", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_l2_voltage\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 240, + "wires": [ + [] + ] + }, + { + "id": "e2571df80f480199", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Voltage L3", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R102,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 280, + "wires": [ + [ + "b284d02cb539994f" + ] + ] + }, + { + "id": "b284d02cb539994f", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_l3_voltage\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 280, + "wires": [ + [] + ] + }, + { + "id": "165c27082bf35d11", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Current L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R103,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 320, + "wires": [ + [ + "1da7740caa290264" + ] + ] + }, + { + "id": "1da7740caa290264", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l1_current\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 320, + "wires": [ + [] + ] + }, + { + "id": "71afb139032cfee2", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Current L2", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R104,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 360, + "wires": [ + [ + "6c9ebd253a3c3b0d" + ] + ] + }, + { + "id": "6c9ebd253a3c3b0d", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l2_current\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 360, + "wires": [ + [] + ] + }, + { + "id": "972360a051abdf88", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Current L3", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R105,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 400, + "wires": [ + [ + "d848102461062b3f" + ] + ] + }, + { + "id": "d848102461062b3f", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l3_current\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 400, + "wires": [ + [] + ] + }, + { + "id": "21e06b0168fdee41", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Power L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R106,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 440, + "wires": [ + [ + "3e88cef8b8b508ac" + ] + ] + }, + { + "id": "3e88cef8b8b508ac", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_l1_power\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 440, + "wires": [ + [] + ] + }, + { + "id": "e107fc40d203f46a", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Power L2", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R107,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 480, + "wires": [ + [ + "466e66a05eddb62f" + ] + ] + }, + { + "id": "466e66a05eddb62f", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_l2_power\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 480, + "wires": [ + [] + ] + }, + { + "id": "7586c0c0ec778dad", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Power L3", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R108,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 520, + "wires": [ + [ + "a0e6a154bfb85c09" + ] + ] + }, + { + "id": "a0e6a154bfb85c09", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_l3_power\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 520, + "wires": [ + [] + ] + }, + { + "id": "baf1934f370ed4fd", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Total Power", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R112,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 40, + "wires": [ + [ + "c86839ef84dcc35d" + ] + ] + }, + { + "id": "c86839ef84dcc35d", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"einspeisung_total_power\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 40, + "wires": [ + [] + ] + }, + { + "id": "ef783dcc259e1398", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Import L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R117,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 560, + "wires": [ + [ + "22bdca2522a4b3c9" + ] + ] + }, + { + "id": "22bdca2522a4b3c9", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l1_import\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 560, + "wires": [ + [] + ] + }, + { + "id": "f748fa2266fa4302", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Import L2", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R118,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 600, + "wires": [ + [ + "51dc86ef4b4e31fd" + ] + ] + }, + { + "id": "51dc86ef4b4e31fd", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l2_import\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 600, + "wires": [ + [] + ] + }, + { + "id": "ece76e52d325bd6e", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Import L3", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R119,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 640, + "wires": [ + [ + "804899fa9686be16" + ] + ] + }, + { + "id": "804899fa9686be16", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l3_import\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 640, + "wires": [ + [] + ] + }, + { + "id": "a5f8ee01c537330b", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Export L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R150,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 680, + "wires": [ + [ + "ba0021b15f94fc41" + ] + ] + }, + { + "id": "ba0021b15f94fc41", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l1_export\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 680, + "wires": [ + [] + ] + }, + { + "id": "1e1823db7c7b4edd", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Export L2", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R151,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 720, + "wires": [ + [ + "68157d83b4f176f5" + ] + ] + }, + { + "id": "68157d83b4f176f5", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l2_export\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 720, + "wires": [ + [] + ] + }, + { + "id": "7857cce5b19d21ea", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Export L3", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R152,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 760, + "wires": [ + [ + "4d12b6c71b023fc8" + ] + ] + }, + { + "id": "4d12b6c71b023fc8", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"einspeisung_l3_export\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 760, + "wires": [ + [] + ] + }, + { + "id": "58942376d9fbdd07", + "type": "inject", + "z": "f96eea4d4a3a345d", + "name": "Poll every sec", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "1", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 120, + "y": 40, + "wires": [ + [ + "baf1934f370ed4fd" + ] + ] + }, + { + "id": "c4dc8affa9729e08", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Total kWh", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R140,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 860, + "wires": [ + [ + "c232ca118a4fe14b" + ] + ] + }, + { + "id": "c232ca118a4fe14b", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"keller_total_kwh\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 860, + "wires": [ + [] + ] + }, + { + "id": "426bcd77cd358a43", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Current L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R141,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 330, + "y": 900, + "wires": [ + [ + "731a40c90fb45ee6" + ] + ] + }, + { + "id": "731a40c90fb45ee6", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.001).toFixed(1);\nglobal.set(\"keller_l1_current\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 900, + "wires": [ + [] + ] + }, + { + "id": "2daafcdfb6ee11cf", + "type": "http request", + "z": "f96eea4d4a3a345d", + "name": "Power L1", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "http://10.1.0.5/cgi-bin/readVal.exe?PDP,%20R142,d", + "tls": "", + "persist": false, + "proxy": "", + "authType": "", + "senderr": false, + "x": 320, + "y": 940, + "wires": [ + [ + "c9a03dfa1847f20e" + ] + ] + }, + { + "id": "c9a03dfa1847f20e", + "type": "function", + "z": "f96eea4d4a3a345d", + "name": "format and save to global var", + "func": "temp = parseFloat(msg.payload * 0.1).toFixed(1);\nglobal.set(\"keller_l1_power\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 710, + "y": 940, + "wires": [ + [] + ] + }, + { + "id": "7298f7b74b3bb8df", + "type": "inject", + "z": "f96eea4d4a3a345d", + "name": "Poll every 5 sec", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 100, + "y": 900, + "wires": [ + [ + "c4dc8affa9729e08", + "426bcd77cd358a43", + "2daafcdfb6ee11cf" + ] + ] + } +] \ No newline at end of file diff --git a/node-red-flows/temperatures.json b/node-red-flows/temperatures.json new file mode 100644 index 0000000..8eab7ce --- /dev/null +++ b/node-red-flows/temperatures.json @@ -0,0 +1,264 @@ +[ + { + "id": "54b453f8b1822086", + "type": "tab", + "label": "Temperatures", + "disabled": false, + "info": "", + "env": [] + }, + { + "id": "42787d14c99c43ed", + "type": "modbus-flex-getter", + "z": "54b453f8b1822086", + "name": "Heating PLC", + "showStatusActivities": false, + "showErrors": false, + "logIOActivities": false, + "server": "32c359504aeff938", + "useIOFile": false, + "ioFile": "", + "useIOForPayload": false, + "emptyMsgOnFail": false, + "keepMsgProperties": false, + "x": 630, + "y": 160, + "wires": [ + [], + [ + "c882614f5223fdb8" + ] + ] + }, + { + "id": "741032aef6173311", + "type": "inject", + "z": "54b453f8b1822086", + "name": "Poll every 5 sec", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "5", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "", + "payloadType": "date", + "x": 190, + "y": 160, + "wires": [ + [ + "a34af57b10993218" + ] + ] + }, + { + "id": "a34af57b10993218", + "type": "function", + "z": "54b453f8b1822086", + "name": "Modbus temp outside", + "func": "msg.payload = { value: msg.payload, 'fc': 3, 'unitid': 1, 'address': 16 , 'quantity': 2 } \nreturn msg", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 420, + "y": 160, + "wires": [ + [ + "42787d14c99c43ed" + ] + ] + }, + { + "id": "c882614f5223fdb8", + "type": "buffer-parser", + "z": "54b453f8b1822086", + "name": "2x16bit to 32bit int", + "data": "payload.buffer", + "dataType": "msg", + "specification": "spec", + "specificationType": "ui", + "items": [ + { + "type": "int32be", + "name": "temp_outside", + "offset": 0, + "length": 1, + "offsetbit": 0, + "scale": "0.1", + "mask": "" + } + ], + "swap1": "", + "swap2": "", + "swap3": "", + "swap1Type": "swap", + "swap2Type": "swap", + "swap3Type": "swap", + "msgProperty": "payload", + "msgPropertyType": "str", + "resultType": "keyvalue", + "resultTypeType": "return", + "multipleResult": false, + "fanOutMultipleResult": false, + "setTopic": true, + "outputs": 1, + "x": 870, + "y": 160, + "wires": [ + [ + "28b5a302c6acaa9c" + ] + ] + }, + { + "id": "c8107088.37ef9", + "type": "http in", + "z": "54b453f8b1822086", + "name": "", + "url": "/temps", + "method": "get", + "upload": false, + "swaggerDoc": "", + "x": 150, + "y": 720, + "wires": [ + [ + "46de4c0e35edab04" + ] + ] + }, + { + "id": "65401623.9abfe8", + "type": "change", + "z": "54b453f8b1822086", + "name": "Set Headers", + "rules": [ + { + "t": "set", + "p": "headers", + "pt": "msg", + "to": "{}", + "tot": "json" + }, + { + "t": "set", + "p": "headers.content-type", + "pt": "msg", + "to": "application/json", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 890, + "y": 720, + "wires": [ + [ + "f7d3e35a.082c2" + ] + ] + }, + { + "id": "f7d3e35a.082c2", + "type": "http response", + "z": "54b453f8b1822086", + "name": "", + "statusCode": "", + "headers": {}, + "x": 1130, + "y": 720, + "wires": [] + }, + { + "id": "46de4c0e35edab04", + "type": "function", + "z": "54b453f8b1822086", + "name": "Build Object", + "func": "var temp_outside = global.get(\"temp_outside\")\n\nmsg.payload = {outside:temp_outside};\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 510, + "y": 720, + "wires": [ + [ + "e23dfd0f76ea6261" + ] + ] + }, + { + "id": "e23dfd0f76ea6261", + "type": "json", + "z": "54b453f8b1822086", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 710, + "y": 720, + "wires": [ + [ + "65401623.9abfe8" + ] + ] + }, + { + "id": "28b5a302c6acaa9c", + "type": "function", + "z": "54b453f8b1822086", + "name": "save to global var", + "func": "temp = parseFloat(msg.payload.temp_outside).toFixed(1);\nglobal.set(\"temp_outside\", temp)\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1110, + "y": 160, + "wires": [ + [] + ] + }, + { + "id": "32c359504aeff938", + "type": "modbus-client", + "name": "Heating PLC", + "clienttype": "tcp", + "bufferCommands": true, + "stateLogEnabled": false, + "queueLogEnabled": false, + "failureLogEnabled": true, + "tcpHost": "10.1.0.7", + "tcpPort": "502", + "tcpType": "DEFAULT", + "serialPort": "/dev/ttyUSB", + "serialType": "RTU-BUFFERD", + "serialBaudrate": "9600", + "serialDatabits": "8", + "serialStopbits": "1", + "serialParity": "none", + "serialConnectionDelay": "100", + "serialAsciiResponseStartDelimiter": "0x3A", + "unit_id": "1", + "commandDelay": "1", + "clientTimeout": "1000", + "reconnectOnTimeout": true, + "reconnectTimeout": "2000", + "parallelUnitIdsAllowed": true + } +] \ No newline at end of file