[ { "id": "49762a14.53df54", "type": "tab", "label": "S0Meters", "disabled": false, "info": "" }, { "id": "231ba654.08ce1a", "type": "ui_text_input", "z": "49762a14.53df54", "name": "", "label": "set new reading", "group": "5cdd7758.149278", "order": 2, "width": 0, "height": 0, "passthru": false, "mode": "text", "delay": "300", "topic": "", "x": 540, "y": 140, "wires": [ [ "4a109952.f06e48" ] ] }, { "id": "1ca1176d.d5c471", "type": "ui_text", "z": "49762a14.53df54", "group": "5cdd7758.149278", "order": 1, "width": 0, "height": 0, "name": "", "label": "current reading", "format": "{{msg.payload}}", "layout": "row-spread", "x": 540, "y": 100, "wires": [] }, { "id": "74e1dc04.2d60a4", "type": "mqtt in", "z": "49762a14.53df54", "name": "", "topic": "T5/Zaehler/Strom/reading", "qos": "2", "datatype": "auto", "broker": "594053fb.ec274c", "x": 300, "y": 100, "wires": [ [ "1ca1176d.d5c471" ] ] }, { "id": "4a109952.f06e48", "type": "function", "z": "49762a14.53df54", "name": "", "func": "flow.set(\"stromz_newReading\", msg.payload, \"memoryOnly\");\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 760, "y": 140, "wires": [ [ "6aa2d3.79145d2c" ] ] }, { "id": "6aa2d3.79145d2c", "type": "debug", "z": "49762a14.53df54", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 970, "y": 140, "wires": [] }, { "id": "7e3160e.661e0a", "type": "ui_button", "z": "49762a14.53df54", "name": "", "group": "5cdd7758.149278", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "WRITE TO HARDWARE", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 570, "y": 180, "wires": [ [ "98434a49.bbb93", "7eff858e.4161b4" ] ] }, { "id": "98434a49.bbb93", "type": "function", "z": "49762a14.53df54", "name": "", "func": "newReading = flow.get(\"stromz_newReading\", \"memoryOnly\")||undefined;\nif (newReading !== undefined && !isNaN(newReading)) {\n newReading = parseFloat(newReading).toFixed(3);\n msg.payload = \"set reading c1 \" + newReading;\n return msg;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 760, "y": 180, "wires": [ [ "88f97e0e.83b77", "6a2c0078.8cc4e8" ] ] }, { "id": "88f97e0e.83b77", "type": "debug", "z": "49762a14.53df54", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 970, "y": 180, "wires": [] }, { "id": "1d4a3586.9f37f2", "type": "ui_text_input", "z": "49762a14.53df54", "name": "", "label": "set new reading", "tooltip": "", "group": "2edae4eb.ff06bc", "order": 2, "width": 0, "height": 0, "passthru": false, "mode": "text", "delay": "300", "topic": "", "x": 540, "y": 320, "wires": [ [ "b8760526.dcc028" ] ] }, { "id": "a298d89b.0734b", "type": "ui_text", "z": "49762a14.53df54", "group": "2edae4eb.ff06bc", "order": 1, "width": 0, "height": 0, "name": "", "label": "current reading", "format": "{{msg.payload}}", "layout": "row-spread", "x": 540, "y": 280, "wires": [] }, { "id": "49d5ee8f.e41a48", "type": "mqtt in", "z": "49762a14.53df54", "name": "", "topic": "T5/Zaehler/Gas/reading", "qos": "2", "datatype": "auto", "broker": "594053fb.ec274c", "x": 290, "y": 280, "wires": [ [ "a298d89b.0734b" ] ] }, { "id": "b8760526.dcc028", "type": "function", "z": "49762a14.53df54", "name": "", "func": "flow.set(\"gasz_newReading\", msg.payload, \"memoryOnly\");\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 760, "y": 320, "wires": [ [ "9733c14a.9ce9e8" ] ] }, { "id": "9733c14a.9ce9e8", "type": "debug", "z": "49762a14.53df54", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 970, "y": 320, "wires": [] }, { "id": "8e6da1ad.d04a3", "type": "ui_button", "z": "49762a14.53df54", "name": "", "group": "2edae4eb.ff06bc", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "WRITE TO HARDWARE", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 570, "y": 360, "wires": [ [ "4da8d6f3.5d40c", "a8906b04.8cd618" ] ] }, { "id": "4da8d6f3.5d40c", "type": "function", "z": "49762a14.53df54", "name": "", "func": "newReading = flow.get(\"gasz_newReading\", \"memoryOnly\")||undefined;\nif (newReading !== undefined && !isNaN(newReading)) {\n newReading = parseFloat(newReading).toFixed(2);\n msg.payload = \"set reading c2 \" + newReading;\n return msg;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 760, "y": 360, "wires": [ [ "88add0c1.5051a", "6a2c0078.8cc4e8" ] ] }, { "id": "88add0c1.5051a", "type": "debug", "z": "49762a14.53df54", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 970, "y": 360, "wires": [] }, { "id": "87a202e7.90692", "type": "ui_button", "z": "49762a14.53df54", "name": "", "group": "934e6f58.6bd9e8", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "get readings", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 530, "y": 460, "wires": [ [ "ef18d5b.2d45ea8" ] ] }, { "id": "ef18d5b.2d45ea8", "type": "function", "z": "49762a14.53df54", "name": "", "func": "msg.payload = \"get readings\";\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 760, "y": 460, "wires": [ [ "6a2c0078.8cc4e8" ] ] }, { "id": "6a2c0078.8cc4e8", "type": "mqtt out", "z": "49762a14.53df54", "name": "", "topic": "Top5/ImpCount/cmd", "qos": "", "retain": "", "broker": "594053fb.ec274c", "x": 1170, "y": 440, "wires": [] }, { "id": "a8906b04.8cd618", "type": "function", "z": "49762a14.53df54", "name": "clear", "func": "msg.payload=\"\";\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 610, "y": 400, "wires": [ [ "1d4a3586.9f37f2" ] ] }, { "id": "7eff858e.4161b4", "type": "function", "z": "49762a14.53df54", "name": "clear", "func": "msg.payload=\"\";\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 610, "y": 220, "wires": [ [ "231ba654.08ce1a" ] ] }, { "id": "c3d72895.bfc2", "type": "ui_button", "z": "49762a14.53df54", "name": "", "group": "2edae4eb.ff06bc", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "CANCEL", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 460, "y": 400, "wires": [ [ "a8906b04.8cd618" ] ] }, { "id": "a366ae9a.534ec8", "type": "ui_button", "z": "49762a14.53df54", "name": "", "group": "5cdd7758.149278", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "CANCEL", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 460, "y": 220, "wires": [ [ "7eff858e.4161b4" ] ] }, { "id": "caee5194.1dd538", "type": "ui_button", "z": "49762a14.53df54", "name": "", "group": "934e6f58.6bd9e8", "order": 3, "width": 0, "height": 0, "passthru": false, "label": "get counters config", "tooltip": "", "color": "", "bgcolor": "", "icon": "", "payload": "", "payloadType": "str", "topic": "", "x": 550, "y": 520, "wires": [ [ "d89d0bb6.ac3428" ] ] }, { "id": "d89d0bb6.ac3428", "type": "function", "z": "49762a14.53df54", "name": "", "func": "msg.payload = \"get conf\";\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 760, "y": 520, "wires": [ [ "6a2c0078.8cc4e8" ] ] }, { "id": "c8dafb7.0a5c988", "type": "mqtt in", "z": "49762a14.53df54", "name": "", "topic": "Top5/ImpCount/stat", "qos": "2", "datatype": "auto", "broker": "594053fb.ec274c", "x": 290, "y": 600, "wires": [ [ "badc2da1.db2fc8" ] ] }, { "id": "badc2da1.db2fc8", "type": "function", "z": "49762a14.53df54", "name": "", "func": "var tmpstr;\nvar hasData = false;\n\nvar paramsarray;\nvar params;\nvar nameValue;\n\nvar data = {};\n\nif(msg.payload.startsWith('CONF GLOB: ')) {\n //CONF GLOB: debuglevel=0, debounce=10, debRecov=70, pwrGood=500\n tmpstr = msg.payload.replace('CONF GLOB: ', '');\n data.glob = params;\n hasData = true;\n}\nelse if(msg.payload.startsWith('CONF C1: ')) {\n //CONF C1: impPerUnit=1000, noImpTout=60, saveInt=30\n tmpstr = msg.payload.replace('CONF C1: ', '');\n data.c1 = params;\n hasData = true;\n}\nelse if(msg.payload.startsWith('CONF C2: ')) {\n //CONF C2: impPerUnit=100, noImpTout=900, saveInt=60\n tmpstr = msg.payload.replace('CONF C2: ', '');\n data.c2 = params;\n hasData = true;\n}\n\nif (hasData) {\n tmpstr = tmpstr.replace(/ /g, '');\n paramsarray = tmpstr.split(',');\n params = {};\n for(i=0; i < paramsarray.length; i++) {\n nameValue = paramsarray[i].split('=');\n params[nameValue[0]] = nameValue[1];\n }\n msg.payload = params;\n return msg;\n}", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "x": 520, "y": 600, "wires": [ [ "50095636.7885c8" ] ] }, { "id": "50095636.7885c8", "type": "debug", "z": "49762a14.53df54", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 780, "y": 620, "wires": [] }, { "id": "5cdd7758.149278", "type": "ui_group", "name": "Stromzähler", "tab": "635047a7.d277a8", "order": 2, "disp": true, "width": "6", "collapse": false }, { "id": "594053fb.ec274c", "type": "mqtt-broker", "name": "", "broker": "127.0.0.1", "port": "1883", "clientid": "", "usetls": false, "compatmode": true, "keepalive": "15", "cleansession": true, "birthTopic": "NodeRED/LWT", "birthQos": "1", "birthRetain": "true", "birthPayload": "Online", "closeTopic": "NodeRED/LWT", "closeQos": "1", "closeRetain": "true", "closePayload": "Offline", "willTopic": "NodeRED/LWT", "willQos": "0", "willRetain": "true", "willPayload": "Offline" }, { "id": "2edae4eb.ff06bc", "type": "ui_group", "name": "Gaszähler", "tab": "635047a7.d277a8", "order": 3, "disp": true, "width": "6", "collapse": false }, { "id": "934e6f58.6bd9e8", "type": "ui_group", "name": "Default", "tab": "635047a7.d277a8", "order": 1, "disp": true, "width": "6", "collapse": false }, { "id": "635047a7.d277a8", "type": "ui_tab", "name": "StromGasZähler", "icon": "dashboard" } ]