[ { "id": "bee6144f3eb2e755", "type": "tab", "label": "Sıcaklık", "disabled": false, "info": "" }, { "id": "f7e256e0e401f3b6", "type": "tab", "label": "Analizör", "disabled": false, "info": "", "env": [] }, { "id": "3983c8fce2618a7b", "type": "tab", "label": "Titreşim", "disabled": false, "info": "", "env": [] }, { "id": "c81534f79d41e062", "type": "tab", "label": "Kalite Kontrol", "disabled": false, "info": "", "env": [] }, { "id": "7c6d438d0c20d84c", "type": "tab", "label": "DB İşlemleri", "disabled": false, "info": "", "env": [] }, { "id": "e3db34ec9f2e03e9", "type": "modbus-client", "name": "", "clienttype": "serial", "bufferCommands": true, "stateLogEnabled": false, "queueLogEnabled": false, "failureLogEnabled": true, "tcpHost": "127.0.0.1", "tcpPort": "502", "tcpType": "DEFAULT", "serialPort": "/dev/ttySTM1", "serialType": "RTU-BUFFERD", "serialBaudrate": "9600", "serialDatabits": "8", "serialStopbits": "1", "serialParity": "none", "serialConnectionDelay": "100", "serialAsciiResponseStartDelimiter": "0x3A", "unit_id": "2", "commandDelay": "1", "clientTimeout": "1000", "reconnectOnTimeout": true, "reconnectTimeout": "2000", "parallelUnitIdsAllowed": true, "showWarnings": true, "showLogs": true }, { "id": "91eff8e41c573018", "type": "postgreSQLConfig", "name": "", "host": "10.2.37.200", "hostFieldType": "str", "port": "5432", "portFieldType": "num", "database": "ddm", "databaseFieldType": "str", "ssl": "false", "sslFieldType": "bool", "applicationName": "", "applicationNameType": "str", "max": "10", "maxFieldType": "num", "idle": "1000", "idleFieldType": "num", "connectionTimeout": "10000", "connectionTimeoutFieldType": "num", "user": "postgres", "userFieldType": "str", "password": "password", "passwordFieldType": "str" }, { "id": "8e97ac687fb2e8a5", "type": "inject", "z": "bee6144f3eb2e755", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "30", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 120, "wires": [ [ "8b57e6eed0312d33" ] ] }, { "id": "b89b3d6c3b663580", "type": "function", "z": "bee6144f3eb2e755", "name": "Sıcaklık & Nem İşlemleri", "func": "const Humidity = msg.payload[0] / 100;\nconst Temperature = msg.payload[1] / 100;\n\n\nmsg.payload = {\n Humidity : Humidity || 0 ,\n Temperature: Temperature || 0,\n\n}\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 570, "y": 120, "wires": [ [ "2357e75fba073339", "034f7fb50b7315d6" ] ] }, { "id": "034f7fb50b7315d6", "type": "postgresql", "z": "bee6144f3eb2e755", "name": "INSERT", "query": "insert into ortam(humidity, temperature )\nvalues({{{msg.payload.Humidity}}}, {{{msg.payload.Temperature}}})", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 720, "y": 220, "wires": [ [ "d8f8c7f7667ce949" ] ] }, { "id": "d8f8c7f7667ce949", "type": "debug", "z": "bee6144f3eb2e755", "name": "debug 21", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 900, "y": 220, "wires": [] }, { "id": "9fae9eb5c0757fda", "type": "inject", "z": "bee6144f3eb2e755", "name": "Get Last Values ", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 140, "y": 300, "wires": [ [ "27fb0c678c4bcb2c" ] ] }, { "id": "27fb0c678c4bcb2c", "type": "postgresql", "z": "bee6144f3eb2e755", "name": "SELECT", "query": "Select * from ortam\n", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 340, "y": 300, "wires": [ [ "49e951f28903f7ad" ] ] }, { "id": "49e951f28903f7ad", "type": "debug", "z": "bee6144f3eb2e755", "name": "debug 22", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 510, "y": 300, "wires": [] }, { "id": "2357e75fba073339", "type": "debug", "z": "bee6144f3eb2e755", "name": "debug 24", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 840, "y": 80, "wires": [] }, { "id": "8b57e6eed0312d33", "type": "modbus-getter", "z": "bee6144f3eb2e755", "name": "Sıcaklık ve Nem", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "logIOActivities": false, "unitid": "1", "dataType": "HoldingRegister", "adr": "0", "quantity": "6", "server": "e3db34ec9f2e03e9", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 330, "y": 120, "wires": [ [ "b89b3d6c3b663580" ], [] ] }, { "id": "cf1919d99cf06c12", "type": "postgresql", "z": "f7e256e0e401f3b6", "name": "INSERT", "query": "", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 560, "y": 500, "wires": [ [ "11b7703817374a83" ] ] }, { "id": "11b7703817374a83", "type": "debug", "z": "f7e256e0e401f3b6", "name": "debug 9", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 780, "y": 500, "wires": [] }, { "id": "675c86a1b8ed5dfe", "type": "function", "z": "f7e256e0e401f3b6", "name": "Enerji Analizörü İşlemleri", "func": "const Endeks = global.get('Endeks') // ((msg.payload[0] * 65536) + msg.payload[1]) / 1000; //KW saat\nconst Voltage = msg.payload[2] / 10;\nconst Current = msg.payload[15] / 1000;\nconst Current2 = msg.payload[17] / 1000;\nconst Current3 = msg.payload[19] / 1000;\n\n\nlet output = {\n Endeks: Endeks || 0,\n Voltage: Voltage || 0,\n Current: Current || 0,\n Current2: Current2 || 0,\n Current3 : Current2 ||0,\n logDate: new Date().getTime()\n}\n\nlet analizorHistory = flow.get('AnalizorHistory')\nanalizorHistory.push(output)\nflow.set('AnalizorHistory', analizorHistory);\n\n\nmsg.payload = output;\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 720, "y": 160, "wires": [ [ "8dee1aa2576a7de7" ] ] }, { "id": "cbc9c6cbee104afd", "type": "inject", "z": "f7e256e0e401f3b6", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "2", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 140, "wires": [ [ "de5863bf7f05c3ab", "b94a5a6972d8a5d3" ] ] }, { "id": "85d76cf0475cbef0", "type": "inject", "z": "f7e256e0e401f3b6", "name": "Get Last Values ", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 200, "y": 660, "wires": [ [ "303bf1a2ac405ae3" ] ] }, { "id": "303bf1a2ac405ae3", "type": "postgresql", "z": "f7e256e0e401f3b6", "name": "SELECT", "query": "Select * from energy_history\norder by log_date\nlimit 10", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 400, "y": 660, "wires": [ [ "b676594e85d93910" ] ] }, { "id": "b676594e85d93910", "type": "debug", "z": "f7e256e0e401f3b6", "name": "debug 23", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 570, "y": 660, "wires": [] }, { "id": "3ee8624c04479d29", "type": "inject", "z": "f7e256e0e401f3b6", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 60, "wires": [ [ "1e1de0cbd147772d" ] ] }, { "id": "1e1de0cbd147772d", "type": "function", "z": "f7e256e0e401f3b6", "name": "AnalizorHistory", "func": "flow.set('AnalizorHistory', [])\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 300, "y": 60, "wires": [ [] ] }, { "id": "9d5308a9b757828f", "type": "inject", "z": "f7e256e0e401f3b6", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "20", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "AnalizorHistory", "payloadType": "flow", "x": 200, "y": 400, "wires": [ [ "2a807e3abc79ea74" ] ] }, { "id": "2a807e3abc79ea74", "type": "function", "z": "f7e256e0e401f3b6", "name": "Analizör Toplu Insert", "func": "const data = flow.get('AnalizorHistory');\n\nlet base = \"INSERT INTO energy_history (log_date, index, voltage, current, current2, current3) VALUES\"\nlet sql ='';\nfor (let x = 0; x < data.length; x++) {\n let row = data[x];\n\n // Convert the Unix timestamp in milliseconds to seconds\n\n sql += `(to_timestamp(${row.logDate / 1000}), ${row.Endeks}, ${row.Voltage}, ${row.Current}, ${row.Current2}, ${row.Current3})`;\n if (x < data.length - 1) {\n sql += ',';\n } else {\n sql += ';';\n }\n}\n\nif( sql != ''){\n msg.payload = base + sql;\n msg.query = base + sql;\n\n}\n\n\n\nflow.set('AnalizorHistory', []);\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 320, "y": 520, "wires": [ [ "cf1919d99cf06c12", "4c186aaec196d4eb" ] ] }, { "id": "4c186aaec196d4eb", "type": "debug", "z": "f7e256e0e401f3b6", "name": "debug 35", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 480, "y": 420, "wires": [] }, { "id": "de5863bf7f05c3ab", "type": "modbus-getter", "z": "f7e256e0e401f3b6", "name": "Analizör", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "logIOActivities": false, "unitid": "2", "dataType": "HoldingRegister", "adr": "236", "quantity": "4", "server": "e3db34ec9f2e03e9", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 360, "y": 240, "wires": [ [ "6c620ed2feb759f0" ], [] ] }, { "id": "6c620ed2feb759f0", "type": "function", "z": "f7e256e0e401f3b6", "name": "endeks(kWh)", "func": "var data0 = msg.payload[0];\nvar data1 = msg.payload[1];\nvar data2 = msg.payload[2];\nvar data3 = msg.payload[3];\nvar toplam = (data0 * 4294967296+data1*65536+data2* 1 + data3);\n//toplam = toplam / 1000 //kw/sa \nglobal.set(\"Endeks\", toplam);\nmsg.payload = toplam;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 580, "y": 300, "wires": [ [ "8dee1aa2576a7de7" ] ] }, { "id": "720be6129335ba1c", "type": "modbus-getter", "z": "f7e256e0e401f3b6", "name": "Analizör", "showStatusActivities": false, "showErrors": false, "showWarnings": true, "logIOActivities": false, "unitid": "2", "dataType": "HoldingRegister", "adr": "0", "quantity": "20", "server": "e3db34ec9f2e03e9", "useIOFile": false, "ioFile": "", "useIOForPayload": false, "emptyMsgOnFail": false, "keepMsgProperties": false, "delayOnStart": false, "startDelayTime": "", "x": 480, "y": 140, "wires": [ [ "675c86a1b8ed5dfe" ], [] ] }, { "id": "8dee1aa2576a7de7", "type": "debug", "z": "f7e256e0e401f3b6", "name": "debug 36", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 920, "y": 280, "wires": [] }, { "id": "6ef501becb588d12", "type": "debug", "z": "f7e256e0e401f3b6", "name": "debug 37", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 740, "y": 100, "wires": [] }, { "id": "b94a5a6972d8a5d3", "type": "delay", "z": "f7e256e0e401f3b6", "name": "", "pauseType": "delay", "timeout": "1", "timeoutUnits": "seconds", "rate": "1", "nbRateUnits": "1", "rateUnits": "second", "randomFirst": "1", "randomLast": "5", "randomUnits": "seconds", "drop": false, "allowrate": false, "outputs": 1, "x": 320, "y": 140, "wires": [ [ "720be6129335ba1c" ] ] }, { "id": "a7934b043703bbc5", "type": "inject", "z": "3983c8fce2618a7b", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 60, "wires": [ [ "1e3488c459939e45" ] ] }, { "id": "1e3488c459939e45", "type": "function", "z": "3983c8fce2618a7b", "name": "RMS History", "func": "flow.set('RMSHistory', [])\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 300, "y": 60, "wires": [ [] ] }, { "id": "e0d43c036217a4ec", "type": "range", "z": "3983c8fce2618a7b", "minin": "1.9", "maxin": "9.4", "minout": "0", "maxout": "25", "action": "scale", "round": false, "property": "payload", "name": "", "x": 470, "y": 160, "wires": [ [ "3ba83fab3fcabcb0" ] ] }, { "id": "2fd80c24944b47e5", "type": "function", "z": "3983c8fce2618a7b", "name": "RMS (mm/s)", "func": "const data = msg.payload\nconst RMS = Number(data.toFixed(2)) || 0;\n\n//Log To History\n\nlet RMSHistory = flow.get('RMSHistory');\nRMSHistory.push( [ RMS, new Date().getTime() ] )\nflow.set('RMSHistory', RMSHistory);\n\nmsg.payload = RMS;\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 880, "y": 160, "wires": [ [] ] }, { "id": "1ff5be2e1583e75c", "type": "inject", "z": "3983c8fce2618a7b", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "0.1", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 110, "y": 160, "wires": [ [ "2d6db9d5e50086bf" ] ] }, { "id": "4bdb4243635d011f", "type": "postgresql", "z": "3983c8fce2618a7b", "name": "INSERT", "query": "", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 580, "y": 260, "wires": [ [ "59ee50a570cb37f7" ] ] }, { "id": "59ee50a570cb37f7", "type": "debug", "z": "3983c8fce2618a7b", "name": "debug 19", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 740, "y": 260, "wires": [] }, { "id": "ce24bc799ce751c2", "type": "function", "z": "3983c8fce2618a7b", "name": "RMS Toplu Insert", "func": "const data = flow.get('RMSHistory');\n\nlet base = \"INSERT INTO rms_history (value, log_date) VALUES\"\nlet sql ='';\nfor (let x = 0; x < data.length; x++) {\n let row = data[x];\n\n // Convert the Unix timestamp in milliseconds to seconds\n let timestamp = row[1] / 1000;\n\n sql += `(${row[0]}, to_timestamp(${timestamp}))`;\n if (x < data.length - 1) {\n sql += ',';\n } else {\n sql += ';';\n }\n}\n\nif( sql != ''){\n msg.payload = base + sql;\n msg.query = base + sql;\n\n}\n\n\n\nflow.set('RMSHistory', []);\nreturn msg;\n", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 350, "y": 260, "wires": [ [ "4bdb4243635d011f", "3a2a2318438f89c0" ] ] }, { "id": "a6a730aa90acc79f", "type": "inject", "z": "3983c8fce2618a7b", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "30", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 260, "wires": [ [ "ce24bc799ce751c2" ] ] }, { "id": "2d6db9d5e50086bf", "type": "Read-AI1", "z": "3983c8fce2618a7b", "name": "", "x": 320, "y": 160, "wires": [ [ "e0d43c036217a4ec", "b3d7af30a41d5d44" ] ] }, { "id": "3a2a2318438f89c0", "type": "debug", "z": "3983c8fce2618a7b", "name": "debug 28", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 460, "y": 340, "wires": [] }, { "id": "3ba83fab3fcabcb0", "type": "switch", "z": "3983c8fce2618a7b", "name": "", "property": "payload", "propertyType": "msg", "rules": [ { "t": "neq", "v": "0", "vt": "num" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 630, "y": 160, "wires": [ [ "2fd80c24944b47e5", "055bd2052674d610" ] ] }, { "id": "055bd2052674d610", "type": "debug", "z": "3983c8fce2618a7b", "name": "debug 29", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 800, "y": 100, "wires": [] }, { "id": "b3d7af30a41d5d44", "type": "debug", "z": "3983c8fce2618a7b", "name": "debug 38", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 520, "y": 100, "wires": [] }, { "id": "29f7dcb05acff5d7", "type": "postgresql", "z": "c81534f79d41e062", "name": "LEKE", "query": "insert into quality_check(type)\nvalues('LEKE')", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 930, "y": 240, "wires": [ [] ] }, { "id": "4178224c60b4c959", "type": "postgresql", "z": "c81534f79d41e062", "name": "TAMİR", "query": "insert into quality_check(type)\nvalues('TAMIR')", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 920, "y": 320, "wires": [ [] ] }, { "id": "2ff3dc75529474d4", "type": "postgresql", "z": "c81534f79d41e062", "name": "IKINCI KALITE", "query": "insert into quality_check(type)\nvalues('IKINCI KALITE')", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 920, "y": 400, "wires": [ [] ] }, { "id": "78c4890cb7cde801", "type": "inject", "z": "c81534f79d41e062", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "0.1", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 130, "y": 260, "wires": [ [ "4bd331a507d05335" ] ] }, { "id": "4bd331a507d05335", "type": "Read-DI", "z": "c81534f79d41e062", "name": "", "x": 320, "y": 300, "wires": [ [ "7ceeced661051e40" ], [ "e8cdb9857fc6eb14" ], [ "b4cf5ee7e2a47225" ], [], [], [], [], [], [] ] }, { "id": "7ceeced661051e40", "type": "rbe", "z": "c81534f79d41e062", "name": "1", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 490, "y": 260, "wires": [ [ "5dc2b2f4b9c8fb3b" ] ] }, { "id": "e8cdb9857fc6eb14", "type": "rbe", "z": "c81534f79d41e062", "name": "2", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 490, "y": 300, "wires": [ [ "4bd39c93dc0509d8" ] ] }, { "id": "b4cf5ee7e2a47225", "type": "rbe", "z": "c81534f79d41e062", "name": "3", "func": "rbe", "gap": "", "start": "", "inout": "out", "septopics": true, "property": "payload", "topi": "topic", "x": 490, "y": 340, "wires": [ [ "d8181efba9921b70" ] ] }, { "id": "8bd19b40b2011db2", "type": "function", "z": "c81534f79d41e062", "name": "function 23", "func": "flow.set('counter',{\"LEKE\":0,\"TAMIR\":0,\"KALITE\":0})\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 350, "y": 100, "wires": [ [] ] }, { "id": "ebd071295553d338", "type": "function", "z": "c81534f79d41e062", "name": "LEKE", "func": "let counter = flow.get('counter')\ncounter[\"LEKE\"] = counter[\"LEKE\"] +1\nflow.set('counter',counter)\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 730, "y": 140, "wires": [ [] ] }, { "id": "19d3f2efdeb913df", "type": "inject", "z": "c81534f79d41e062", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": true, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 170, "y": 100, "wires": [ [ "8bd19b40b2011db2" ] ] }, { "id": "039b8a8221d126c6", "type": "function", "z": "c81534f79d41e062", "name": "TAMIR", "func": "let counter = flow.get('counter')\ncounter[\"TAMIR\"] = counter[\"TAMIR\"] +1\nflow.set('counter',counter)\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 760, "y": 180, "wires": [ [] ] }, { "id": "4919339d22571bf9", "type": "function", "z": "c81534f79d41e062", "name": "KALITE", "func": "let counter = flow.get('counter')\ncounter[\"KALITE\"] = counter[\"KALITE\"] +1\nflow.set('counter',counter)\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 780, "y": 220, "wires": [ [] ] }, { "id": "5dc2b2f4b9c8fb3b", "type": "switch", "z": "c81534f79d41e062", "name": "TRUE", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "true", "vt": "jsonata" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 630, "y": 260, "wires": [ [ "ebd071295553d338", "29f7dcb05acff5d7" ] ] }, { "id": "4bd39c93dc0509d8", "type": "switch", "z": "c81534f79d41e062", "name": "TRUE", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "true", "vt": "jsonata" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 630, "y": 300, "wires": [ [ "039b8a8221d126c6", "4178224c60b4c959" ] ] }, { "id": "d8181efba9921b70", "type": "switch", "z": "c81534f79d41e062", "name": "TRUE", "property": "payload", "propertyType": "msg", "rules": [ { "t": "eq", "v": "true", "vt": "jsonata" } ], "checkall": "true", "repair": false, "outputs": 1, "x": 630, "y": 340, "wires": [ [ "2ff3dc75529474d4", "4919339d22571bf9" ] ] }, { "id": "467996ccd3210136", "type": "comment", "z": "7c6d438d0c20d84c", "name": "Ortam Tablosu", "info": "", "x": 180, "y": 60, "wires": [] }, { "id": "bbc0f2971cf923ce", "type": "comment", "z": "7c6d438d0c20d84c", "name": "rms_history Tablosu", "info": "", "x": 180, "y": 300, "wires": [] }, { "id": "5a0deb80ac2744a2", "type": "inject", "z": "7c6d438d0c20d84c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 200, "y": 140, "wires": [ [ "c40fe32c0faf6453" ] ] }, { "id": "f7a490968d50f480", "type": "inject", "z": "7c6d438d0c20d84c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 200, "y": 380, "wires": [ [ "b943677419ed77dc" ] ] }, { "id": "6781964262e14552", "type": "inject", "z": "7c6d438d0c20d84c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 200, "y": 440, "wires": [ [ "1064c84c33467e99" ] ] }, { "id": "c40fe32c0faf6453", "type": "postgresql", "z": "7c6d438d0c20d84c", "name": "Create Table ", "query": "create table ortam(\n humidity numeric,\n temperature numeric,\n log_date timestamp default now()\n);\n\nSELECT create_hypertable('ortam', by_range('log_date', INTERVAL '1 day'));\n", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 420, "y": 140, "wires": [ [ "aea119ba6de3d833" ] ] }, { "id": "aea119ba6de3d833", "type": "debug", "z": "7c6d438d0c20d84c", "name": "debug 24", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 660, "y": 140, "wires": [] }, { "id": "21d037a37fc642ae", "type": "inject", "z": "7c6d438d0c20d84c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 200, "y": 200, "wires": [ [ "d36701273a47d975" ] ] }, { "id": "d36701273a47d975", "type": "postgresql", "z": "7c6d438d0c20d84c", "name": "DROP ", "query": "drop table test;", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 350, "y": 200, "wires": [ [ "7dcc45805063d90f" ] ] }, { "id": "b943677419ed77dc", "type": "postgresql", "z": "7c6d438d0c20d84c", "name": "Create Table ", "query": "create table rms_history(\n value numeric,\n log_date timestamp default now()\n);\n\nSELECT create_hypertable('rms_history', by_range('log_date', INTERVAL '1 day'));\n\n", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 420, "y": 380, "wires": [ [ "05349cf00a82a2a4" ] ] }, { "id": "1064c84c33467e99", "type": "postgresql", "z": "7c6d438d0c20d84c", "name": "DROP ", "query": "drop table rms_history;", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 390, "y": 440, "wires": [ [ "0376840c6e38113c" ] ] }, { "id": "05349cf00a82a2a4", "type": "debug", "z": "7c6d438d0c20d84c", "name": "debug 25", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 590, "y": 380, "wires": [] }, { "id": "7dcc45805063d90f", "type": "debug", "z": "7c6d438d0c20d84c", "name": "debug 26", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 510, "y": 200, "wires": [] }, { "id": "0376840c6e38113c", "type": "debug", "z": "7c6d438d0c20d84c", "name": "debug 27", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 570, "y": 440, "wires": [] }, { "id": "c13bd214f353b28c", "type": "inject", "z": "7c6d438d0c20d84c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 600, "wires": [ [ "80cd7ce8c1d2421e" ] ] }, { "id": "d13fd2ad9b463051", "type": "inject", "z": "7c6d438d0c20d84c", "name": "", "props": [ { "p": "payload" }, { "p": "topic", "vt": "str" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "", "payloadType": "date", "x": 180, "y": 660, "wires": [ [ "6afc12e937e9c5ef" ] ] }, { "id": "80cd7ce8c1d2421e", "type": "postgresql", "z": "7c6d438d0c20d84c", "name": "Create Table ", "query": "create table energy_history(\n log_date timestamp default now(),\n index numeric,\n voltage numeric,\n current numeric,\n current2 numeric,\n current3 numeric\n);\n\nSELECT create_hypertable('energy_history', by_range('log_date', INTERVAL '1 day'));\n\n", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 460, "y": 600, "wires": [ [ "53efb257514c963d" ] ] }, { "id": "6afc12e937e9c5ef", "type": "postgresql", "z": "7c6d438d0c20d84c", "name": "DROP ", "query": "drop table energy_history;", "postgreSQLConfig": "91eff8e41c573018", "split": false, "rowsPerMsg": 1, "outputs": 1, "x": 390, "y": 660, "wires": [ [ "ec8382f455b27929" ] ] }, { "id": "53efb257514c963d", "type": "debug", "z": "7c6d438d0c20d84c", "name": "debug 33", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 630, "y": 600, "wires": [] }, { "id": "ec8382f455b27929", "type": "debug", "z": "7c6d438d0c20d84c", "name": "debug 34", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 610, "y": 660, "wires": [] }, { "id": "1b2030b4b3c2a66a", "type": "comment", "z": "7c6d438d0c20d84c", "name": "Enerji Analizörü", "info": "", "x": 180, "y": 520, "wires": [] } ]