diff --git a/examples/02-integrated-e2e.json b/examples/02-integrated-e2e.json new file mode 100644 index 0000000..a9e5f58 --- /dev/null +++ b/examples/02-integrated-e2e.json @@ -0,0 +1,1202 @@ +[ + { + "id": "b15a4cea7ac56c55", + "type": "tab", + "label": "Monster", + "disabled": false, + "info": "", + "env": [] + }, + { + "id": "68b0a4e351c8f350", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "dc1fcbb3d3151c4c", + "d7fe4bd43a8aaa63", + "99388cdab3ea65b0", + "d6210865e335f8d3", + "c23610ea8f42cd34", + "0b2649b4a0a4da2a", + "2a0de4a48872bcc7", + "0aa4129f5a6f7fb6" + ], + "x": 1774, + "y": 499, + "w": 1112, + "h": 142 + }, + { + "id": "f842849752ff4f2a", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "0485566c59a8bcbf", + "6ba5443e3c986fc5", + "1c9191451b2d9597", + "1f252967abf0e66b", + "a33070d96b3324ac", + "fa7699e8b0a09d15" + ], + "x": 34, + "y": 559, + "w": 792, + "h": 122 + }, + { + "id": "50efff9bf5bc317a", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "01a25273dd4740a0", + "781a9b3c08f1e0f5", + "aa0645e799aacc8a", + "bdd1adc8ee724e80" + ], + "x": 34, + "y": 59, + "w": 662, + "h": 149.5 + }, + { + "id": "ce2325b38c313519", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "2c47af30ba847145", + "2876eeda02557f12", + "79a0111003ccc2a8", + "b15d4b03030dc659" + ], + "x": 1774, + "y": 119, + "w": 592, + "h": 142 + }, + { + "id": "f91b0fe370c14642", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "bfe0b3078a061c05", + "a7bf2225bf3cddc2", + "9140c1e8cd939daa", + "08fcc57626c5aa45", + "6fd9f36f5379fb0d" + ], + "x": 1774, + "y": 299, + "w": 712, + "h": 142 + }, + { + "id": "bce78af3de3db698", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "542cc420e1c64980", + "578fd447083c9929", + "60e2f5c2dc01909b", + "e06d690e14b77c75", + "2e7c0f1f094fecab", + "b28618425f1d2e13", + "bcbf8bcb763a227e" + ], + "x": 34, + "y": 379, + "w": 952, + "h": 122 + }, + { + "id": "bb07dac79fd5ba61", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "c741dbf9d6c3ce7a", + "4c19ded620529ce4", + "89535d0d545f6d1f", + "9a2381c60ed29395", + "17f1fb16d02df4f7", + "0b8466b798f8fb03", + "096fbb04430fe949", + "785cdd86f9876a73", + "91da53be14d74cc1", + "f4fa0bbef11be521", + "5519cfc4a6a9a231" + ], + "x": 1054, + "y": 59, + "w": 652, + "h": 402 + }, + { + "id": "5b6acbec346ae0ed", + "type": "group", + "z": "b15a4cea7ac56c55", + "style": { + "stroke": "#999999", + "stroke-opacity": "1", + "fill": "none", + "fill-opacity": "1", + "label": true, + "label-position": "nw", + "color": "#a4a4a4" + }, + "nodes": [ + "9f399e3dd372cf21", + "1001462118bcd1a8", + "1a4f72ab44579eee", + "487357b22beee5f9" + ], + "x": 1774, + "y": 679, + "w": 612, + "h": 142 + }, + { + "id": "2c47af30ba847145", + "type": "function", + "z": "b15a4cea7ac56c55", + "g": "ce2325b38c313519", + "name": "pulse", + "func": "if(msg.payload.pulse){\n msg.payload = 1;\n}\nelse{\n msg.payload = 0;\n}\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 1930, + "y": 220, + "wires": [ + [ + "b15d4b03030dc659" + ] + ] + }, + { + "id": "542cc420e1c64980", + "type": "file in", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "name": "monsternametijden", + "filename": "./.node-red/node_modules/typicals/monster/config/monsternametijden.csv", + "filenameType": "str", + "format": "utf8", + "chunk": false, + "sendError": false, + "encoding": "none", + "allProps": false, + "x": 590, + "y": 460, + "wires": [ + [ + "578fd447083c9929" + ] + ] + }, + { + "id": "578fd447083c9929", + "type": "csv", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "name": "monsternametijden", + "sep": ",", + "hdrin": true, + "hdrout": "all", + "multi": "mult", + "ret": "\\n", + "temp": "SAMPLE_NAME,DESCRIPTION,SAMPLED_DATE,START_DATE,END_DATE", + "skip": "0", + "strings": true, + "include_empty_strings": "", + "include_null_values": "", + "x": 810, + "y": 460, + "wires": [ + [ + "60e2f5c2dc01909b" + ] + ] + }, + { + "id": "6ba5443e3c986fc5", + "type": "inject", + "z": "b15a4cea7ac56c55", + "d": true, + "g": "f842849752ff4f2a", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "55 07 * * *", + "once": true, + "onceDelay": "1", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 640, + "wires": [ + [ + "1c9191451b2d9597" + ] + ] + }, + { + "id": "1c9191451b2d9597", + "type": "http request", + "z": "b15a4cea7ac56c55", + "g": "f842849752ff4f2a", + "name": "", + "method": "GET", + "ret": "txt", + "paytoqs": "ignore", + "url": "https://api.open-meteo.com/v1/forecast?latitude=51.7140004961472,51.714000496148444,51.71400049614957,51.71400049615058,51.7140004961515,51.7140004961523,51.714000496153,51.69100049707191,51.69100049707316,51.69100049707432,51.69100049707531,51.69100049707621,51.668000497995365,51.66800049799658,51.66800049799769,51.66800049799869,51.668000497999614,51.6680004980004,51.64500049891743,51.64500049891865,51.645000498919764,51.64500049892077,51.645000498921675,51.64500049892247,51.622000499839395,51.6220004998405,51.62200049984153,51.62200049984241,51.59900050076092,51.59900050076181&longitude=4.772999997019469,4.809999997301288,4.8469999975830875,4.883999997864905,4.920999998146714,4.95799999842853,4.994999998710344,4.772999997010078,4.80999999729239,4.8469999975747164,4.883999997857032,4.920999998139366,4.772999997000686,4.809999997283514,4.8469999975663445,4.883999997849185,4.920999998132014,4.957999998414859,4.772999996991296,4.80999999727464,4.84699999755798,4.88399999784133,4.920999998124684,4.957999998408024,4.809999997265776,4.846999997549634,4.88399999783348,4.920999998117339,4.883999997825649,4.920999998110016&hourly=precipitation,precipitation_probability&timezone=Europe%2FBerlin&past_days=2&forecast_days=2", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 310, + "y": 640, + "wires": [ + [ + "1f252967abf0e66b" + ] + ] + }, + { + "id": "1f252967abf0e66b", + "type": "json", + "z": "b15a4cea7ac56c55", + "g": "f842849752ff4f2a", + "name": "rain_data", + "property": "payload", + "action": "", + "pretty": false, + "x": 480, + "y": 640, + "wires": [ + [ + "a33070d96b3324ac" + ] + ] + }, + { + "id": "a33070d96b3324ac", + "type": "change", + "z": "b15a4cea7ac56c55", + "g": "f842849752ff4f2a", + "name": "", + "rules": [ + { + "t": "set", + "p": "topic", + "pt": "msg", + "to": "rain_data", + "tot": "str" + } + ], + "action": "", + "property": "", + "from": "", + "to": "", + "reg": false, + "x": 650, + "y": 640, + "wires": [ + [ + "fa7699e8b0a09d15" + ] + ] + }, + { + "id": "0485566c59a8bcbf", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "f842849752ff4f2a", + "name": "Weather API", + "info": "", + "x": 130, + "y": 600, + "wires": [] + }, + { + "id": "dc1fcbb3d3151c4c", + "type": "http request", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "", + "method": "POST", + "ret": "txt", + "paytoqs": "ignore", + "url": "https://webservice.z-info.nl/WSR/zi_wsr.svc/token", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 2110, + "y": 600, + "wires": [ + [ + "d7fe4bd43a8aaa63" + ] + ] + }, + { + "id": "d7fe4bd43a8aaa63", + "type": "json", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "", + "property": "payload", + "action": "", + "pretty": false, + "x": 2270, + "y": 600, + "wires": [ + [ + "d6210865e335f8d3" + ] + ] + }, + { + "id": "99388cdab3ea65b0", + "type": "http request", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "", + "method": "PUT", + "ret": "txt", + "paytoqs": "ignore", + "url": "https://webservice.z-info.nl/WSR/zi_wsr.svc/json/NL.25/importmwd/pa/?gebruiker=WSR_WBD", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 2610, + "y": 600, + "wires": [ + [ + "0aa4129f5a6f7fb6" + ] + ] + }, + { + "id": "d6210865e335f8d3", + "type": "function", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "function 28", + "func": "let token = msg.payload.access_token;\nlet zinfoData = msg.zinfoData;\nlet zinfoDateFrom = msg.zinfoDateFrom;\nlet zinfoDateUntil = msg.zinfoDateUntil;\nlet zinfoNameSpace = \"25.ZRW11tlTA.\";\nlet zinfoDebietName = \"F021.m3\";\nlet zinfoPulseName = \"Q000.PULS\"\n\nmsg.payload = {\n \"import\":\n {\n \"algemeen\": {\n \"AanleverendeOrganisatie\": \"NL.25\",\n \"Versie\": \"IMm2018\",\n \"Batchid\": `ZI_PA_NL.25_${Date.now()}.json`,\n \"Systeembron\": \"WBD/NEERSG\", //SysteemBron\n \"Systeemdoel\": \"HWH/Z-info\",\n \"Opmerking\": \"v1\"\n },\n \"data\":\n [\n {\n \"Meetwaarden\": [\n {\n \"mepid\": `${zinfoNameSpace + zinfoDebietName}`,\n \"dbmDtm\": `${zinfoDateFrom}`,\n \"dbmTijd\": \"06:00\",\n \"demDtm\": `${zinfoDateUntil}`,\n \"demTijd\": \"06:00\",\n \"mwdWaarde\": `${zinfoData.m3Total}`,\n \"mwdWaardeAN\": \"\",\n \"nMwd\": \"\",\n \"mwdOpmerk\": \"TestR&D\"\n },\n {\n \"mepid\": `${zinfoNameSpace + zinfoPulseName}`,\n \"dbmDtm\": `${zinfoDateFrom}`,\n \"dbmTijd\": \"06:00\",\n \"demDtm\": `${zinfoDateUntil}`,\n \"demTijd\": \"06:00\",\n \"mwdWaarde\": `${zinfoData.pulse}`,\n \"mwdWaardeAN\": \"\",\n \"nMwd\": \"\",\n \"mwdOpmerk\": \"TestR&D\"\n }\n\n ]\n }\n ]\n }\n}\n\nmsg.headers['authorization'] = 'Bearer ' + token;\n\nreturn msg;", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 2430, + "y": 600, + "wires": [ + [ + "99388cdab3ea65b0" + ] + ] + }, + { + "id": "c23610ea8f42cd34", + "type": "function", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "function 29", + "func": "let running = context.get(\"running\");\nlet payloadRunning = context.get(\"payloadRunning\");\n\n// when a payload is active catch it and store the value\nif (typeof msg.payload.running !== \"undefined\"){\n payloadRunning = msg.payload.running;\n context.set(\"payloadRunning\",payloadRunning);\n}\n\n//store m3perpuls (only gets set once before running)\nif (typeof msg.payload.m3PerPuls !== \"undefined\") {\n let pulse = Math.floor(msg.payload.m3PerPuls);\n if (pulse > 0) {\n context.set(\"pulse\", pulse);\n }\n\n}\n\n//only do store information if running is true\nif(running){\n\n if (typeof msg.payload.m3Total !== \"undefined\") {\n let m3Total = Math.round(msg.payload.m3Total);\n if(m3Total > 0){\n context.set(\"m3Total\", m3Total);\n }\n } \n}\n\n//execute code once when going from true to false\nif (payloadRunning == false && running == true){\n\n //request token data\n msg.payload = \"grant_type=password&username=WSR_WBD_PDATA&password=ziwsr24WBD!_Pdata&client_id=WSR_CID_WBD_PDATA&client_secret=ziwsr24WBD!_PdataCid\";\n\n let zinfoData = {};\n zinfoData.pulse = context.get(\"pulse\");\n zinfoData.m3Total = context.get(\"m3Total\");\n msg.zinfoData = zinfoData;\n\n //build date\n let today = new Date();\n let day = today.getDate();\n let yesterday = today.getDate()-1;\n let month = String(today.getMonth() + 1).padStart(2, '0');\n let year = today.getFullYear();\n\n let dateFrom = `${year}-${month}-${yesterday}`;\n let dateUntil = `${year}-${month}-${day}`;\n\n //temp overwrite\n /*\n dateFrom = \"2024-11-6\";\n dateUntil = \"2024-11-7\";\n zinfoData.pulse = 108;\n zinfoData.m3Total = 17761;\n */\n //-----------\n\n msg.zinfoDateFrom = dateFrom;\n msg.zinfoDateUntil = dateUntil;\n\n node.send(msg);\n}\n\nif(payloadRunning){\n running = true;\n\n}\n\nif (!payloadRunning){\n running = false;\n}\n\ncontext.set(\"running\",running);\n\nnode.done();", + "outputs": 1, + "timeout": 0, + "noerr": 0, + "initialize": "// Code added here will be run once\n// whenever the node is started.\ncontext.set(\"running\",false);\ncontext.set(\"payloadRunning\",false);\ncontext.set(\"pulse\", 0);\ncontext.set(\"m3Total\", 0);", + "finalize": "", + "libs": [], + "x": 1930, + "y": 600, + "wires": [ + [ + "dc1fcbb3d3151c4c" + ] + ] + }, + { + "id": "c741dbf9d6c3ce7a", + "type": "monster", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "Monsternamekast", + "samplingtime": 24, + "minvolume": 5, + "maxweight": 23, + "nominalFlowMin": 1000, + "flowMax": 6000, + "maxRainRef": 10, + "minSampleIntervalSec": 60, + "emptyWeightBucket": 8.3, + "aquon_sample_name": "112150", + "enableLog": false, + "logLevel": "info", + "positionVsParent": "atEquipment", + "positionIcon": "⊥", + "hasDistance": false, + "distance": "", + "x": 1320, + "y": 340, + "wires": [ + [ + "17f1fb16d02df4f7", + "5519cfc4a6a9a231" + ], + [ + "4c19ded620529ce4" + ], + [ + "9a2381c60ed29395" + ] + ] + }, + { + "id": "01a25273dd4740a0", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "50efff9bf5bc317a", + "name": "From PLC", + "info": "", + "x": 120, + "y": 100, + "wires": [] + }, + { + "id": "2876eeda02557f12", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "ce2325b38c313519", + "name": "To PLC", + "info": "", + "x": 1850, + "y": 160, + "wires": [] + }, + { + "id": "bfe0b3078a061c05", + "type": "dashboardapi", + "z": "b15a4cea7ac56c55", + "g": "f91b0fe370c14642", + "name": "dasbhoardTemplate", + "x": 1980, + "y": 400, + "wires": [ + [ + "a7bf2225bf3cddc2" + ] + ] + }, + { + "id": "a7bf2225bf3cddc2", + "type": "http request", + "z": "b15a4cea7ac56c55", + "g": "f91b0fe370c14642", + "name": "", + "method": "POST", + "ret": "txt", + "paytoqs": "ignore", + "url": "https://grafana.centraal.wbd-rd.nl/api/dashboards/db", + "tls": "", + "persist": false, + "proxy": "", + "insecureHTTPParser": false, + "authType": "", + "senderr": false, + "headers": [], + "x": 2210, + "y": 380, + "wires": [ + [ + "9140c1e8cd939daa" + ] + ] + }, + { + "id": "9140c1e8cd939daa", + "type": "debug", + "z": "b15a4cea7ac56c55", + "g": "f91b0fe370c14642", + "name": "debug 93", + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 2380, + "y": 380, + "wires": [] + }, + { + "id": "08fcc57626c5aa45", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "f91b0fe370c14642", + "name": "Dashboard API", + "info": "", + "x": 1880, + "y": 340, + "wires": [] + }, + { + "id": "4c19ded620529ce4", + "type": "link out", + "z": "b15a4cea7ac56c55", + "d": true, + "g": "bb07dac79fd5ba61", + "name": "link out 15", + "mode": "link", + "links": [ + "487357b22beee5f9" + ], + "x": 1505, + "y": 340, + "wires": [] + }, + { + "id": "89535d0d545f6d1f", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "To database", + "info": "", + "x": 1550, + "y": 300, + "wires": [] + }, + { + "id": "6fd9f36f5379fb0d", + "type": "link in", + "z": "b15a4cea7ac56c55", + "g": "f91b0fe370c14642", + "name": "DashboardIn", + "links": [ + "9a2381c60ed29395" + ], + "x": 1815, + "y": 400, + "wires": [ + [ + "bfe0b3078a061c05" + ] + ] + }, + { + "id": "9a2381c60ed29395", + "type": "link out", + "z": "b15a4cea7ac56c55", + "d": true, + "g": "bb07dac79fd5ba61", + "name": "link out 24", + "mode": "link", + "links": [ + "6fd9f36f5379fb0d" + ], + "x": 1505, + "y": 420, + "wires": [] + }, + { + "id": "79a0111003ccc2a8", + "type": "link in", + "z": "b15a4cea7ac56c55", + "g": "ce2325b38c313519", + "name": "PLCIn", + "links": [ + "17f1fb16d02df4f7" + ], + "x": 1815, + "y": 220, + "wires": [ + [ + "2c47af30ba847145" + ] + ] + }, + { + "id": "17f1fb16d02df4f7", + "type": "link out", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "link out 25", + "mode": "link", + "links": [ + "79a0111003ccc2a8", + "0b2649b4a0a4da2a" + ], + "x": 1505, + "y": 260, + "wires": [] + }, + { + "id": "781a9b3c08f1e0f5", + "type": "link out", + "z": "b15a4cea7ac56c55", + "g": "50efff9bf5bc317a", + "name": "PLCOut", + "mode": "link", + "links": [ + "0b8466b798f8fb03" + ], + "x": 655, + "y": 160, + "wires": [] + }, + { + "id": "0b8466b798f8fb03", + "type": "link in", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "MonsternamekastIn", + "links": [ + "781a9b3c08f1e0f5", + "60e2f5c2dc01909b", + "fa7699e8b0a09d15" + ], + "x": 1145, + "y": 340, + "wires": [ + [ + "c741dbf9d6c3ce7a" + ] + ] + }, + { + "id": "60e2f5c2dc01909b", + "type": "link out", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "name": "AquonOut", + "mode": "link", + "links": [ + "0b8466b798f8fb03" + ], + "x": 945, + "y": 460, + "wires": [] + }, + { + "id": "e06d690e14b77c75", + "type": "inject", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "15 07 * * *", + "once": false, + "onceDelay": "1", + "topic": "", + "payload": "", + "payloadType": "date", + "x": 150, + "y": 460, + "wires": [ + [ + "b28618425f1d2e13" + ] + ] + }, + { + "id": "2e7c0f1f094fecab", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "name": "Aquon API", + "info": "", + "x": 120, + "y": 420, + "wires": [] + }, + { + "id": "b28618425f1d2e13", + "type": "sftp in", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "sftp": "16115503af36b2f9", + "operation": "get", + "filename": "wsBD_MONSTERNAMETIJDEN.csv", + "localFilename": "./.node-red/node_modules/typicals/monster/config/monsternametijden.csv", + "name": "", + "x": 290, + "y": 460, + "wires": [ + [ + "bcbf8bcb763a227e" + ] + ] + }, + { + "id": "fa7699e8b0a09d15", + "type": "link out", + "z": "b15a4cea7ac56c55", + "g": "f842849752ff4f2a", + "name": "WeatherOut", + "mode": "link", + "links": [ + "0b8466b798f8fb03" + ], + "x": 785, + "y": 640, + "wires": [] + }, + { + "id": "0b2649b4a0a4da2a", + "type": "link in", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "Z-InfoIn", + "links": [ + "17f1fb16d02df4f7" + ], + "x": 1815, + "y": 600, + "wires": [ + [ + "c23610ea8f42cd34" + ] + ] + }, + { + "id": "2a0de4a48872bcc7", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "Z-Info API", + "info": "", + "x": 1860, + "y": 540, + "wires": [] + }, + { + "id": "096fbb04430fe949", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "Output process", + "info": "PLC Pulse\nZ-Info API\nDashboard API", + "x": 1560, + "y": 220, + "wires": [] + }, + { + "id": "785cdd86f9876a73", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "Parent communication", + "info": "", + "x": 1580, + "y": 380, + "wires": [] + }, + { + "id": "bcbf8bcb763a227e", + "type": "delay", + "z": "b15a4cea7ac56c55", + "g": "bce78af3de3db698", + "name": "", + "pauseType": "delay", + "timeout": "10", + "timeoutUnits": "seconds", + "rate": "1", + "nbRateUnits": "1", + "rateUnits": "second", + "randomFirst": "1", + "randomLast": "5", + "randomUnits": "seconds", + "drop": false, + "allowrate": false, + "outputs": 1, + "x": 420, + "y": 460, + "wires": [ + [ + "542cc420e1c64980" + ] + ] + }, + { + "id": "91da53be14d74cc1", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "Input", + "info": "Weather API\nAquon API\nPLC Q", + "x": 1130, + "y": 220, + "wires": [] + }, + { + "id": "9f399e3dd372cf21", + "type": "influxdb batch", + "z": "b15a4cea7ac56c55", + "g": "5b6acbec346ae0ed", + "influxdb": "f3944ab24c95b6b0", + "precision": "", + "retentionPolicy": "", + "name": "influxdb", + "database": "database", + "precisionV18FluxV20": "ms", + "retentionPolicyV18Flux": "", + "org": "39a30abacde10f6a", + "bucket": "monster", + "x": 2300, + "y": 780, + "wires": [] + }, + { + "id": "1001462118bcd1a8", + "type": "join", + "z": "b15a4cea7ac56c55", + "g": "5b6acbec346ae0ed", + "name": "", + "mode": "custom", + "build": "array", + "property": "payload", + "propertyType": "msg", + "key": "topic", + "joiner": "\\n", + "joinerType": "str", + "useparts": true, + "accumulate": false, + "timeout": "10", + "count": "10", + "reduceRight": false, + "reduceExp": "", + "reduceInit": "", + "reduceInitType": "", + "reduceFixup": "", + "x": 2130, + "y": 780, + "wires": [ + [ + "9f399e3dd372cf21" + ] + ] + }, + { + "id": "1a4f72ab44579eee", + "type": "comment", + "z": "b15a4cea7ac56c55", + "g": "5b6acbec346ae0ed", + "name": "Dbase API", + "info": "", + "x": 1860, + "y": 720, + "wires": [] + }, + { + "id": "487357b22beee5f9", + "type": "link in", + "z": "b15a4cea7ac56c55", + "g": "5b6acbec346ae0ed", + "name": "DatabaseIn", + "links": [ + "4c19ded620529ce4" + ], + "x": 1965, + "y": 780, + "wires": [ + [ + "1001462118bcd1a8" + ] + ] + }, + { + "id": "0aa4129f5a6f7fb6", + "type": "debug", + "z": "b15a4cea7ac56c55", + "g": "68b0a4e351c8f350", + "name": "debug 94", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 2780, + "y": 600, + "wires": [] + }, + { + "id": "aa0645e799aacc8a", + "type": "mqtt in", + "z": "b15a4cea7ac56c55", + "g": "50efff9bf5bc317a", + "name": "", + "topic": "ZRW11/influentQ", + "qos": "2", + "datatype": "auto-detect", + "broker": "7a443695a3237f30", + "nl": false, + "rap": true, + "rh": 0, + "inputs": 0, + "x": 140, + "y": 160, + "wires": [ + [ + "bdd1adc8ee724e80" + ] + ] + }, + { + "id": "b15d4b03030dc659", + "type": "mqtt out", + "z": "b15a4cea7ac56c55", + "g": "ce2325b38c313519", + "name": "", + "topic": "ZRW11/ontvangstwerk/monster/pulse", + "qos": "", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "7a443695a3237f30", + "x": 2190, + "y": 220, + "wires": [] + }, + { + "id": "bdd1adc8ee724e80", + "type": "measurement", + "z": "b15a4cea7ac56c55", + "g": "50efff9bf5bc317a", + "name": "", + "scaling": true, + "i_min": 4000, + "i_max": 20000, + "i_offset": 0, + "o_min": 0, + "o_max": 6000, + "simulator": true, + "smooth_method": "none", + "count": 10, + "uuid": "", + "supplier": "vega", + "category": "measurement", + "assetType": "flow", + "model": "vega-flow-10", + "unit": "m3/h", + "enableLog": false, + "logLevel": "error", + "positionVsParent": "atEquipment", + "positionIcon": "⊥", + "hasDistance": false, + "distance": "", + "x": 350, + "y": 160, + "wires": [ + [], + [], + [ + "781a9b3c08f1e0f5" + ] + ] + }, + { + "id": "f4fa0bbef11be521", + "type": "inject", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "Manual start", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": "1", + "topic": "i_start", + "payload": "true", + "payloadType": "bool", + "x": 1170, + "y": 260, + "wires": [ + [ + "c741dbf9d6c3ce7a" + ] + ] + }, + { + "id": "5519cfc4a6a9a231", + "type": "debug", + "z": "b15a4cea7ac56c55", + "g": "bb07dac79fd5ba61", + "name": "debug 95", + "active": true, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "false", + "statusVal": "", + "statusType": "auto", + "x": 1470, + "y": 100, + "wires": [] + }, + { + "id": "16115503af36b2f9", + "type": "sftp", + "host": "ftp1.aquon.nl", + "port": "22", + "username": "wsbd_renxr1", + "password": "h9qkPk.*9pj,4x]]", + "hmac": [], + "cipher": [] + }, + { + "id": "f3944ab24c95b6b0", + "type": "influxdb", + "hostname": "127.0.0.1", + "port": "8086", + "protocol": "http", + "database": "database", + "name": "monster", + "usetls": false, + "tls": "", + "influxdbVersion": "2.0", + "url": "http://influxdb.centraal.wbd-rd.nl", + "timeout": "10", + "rejectUnauthorized": true + }, + { + "id": "7a443695a3237f30", + "type": "mqtt-broker", + "name": "R&D Central Broker", + "broker": "mqtt.centraal.wbd-rd.nl", + "port": "1883", + "clientid": "", + "autoConnect": true, + "usetls": false, + "protocolVersion": "4", + "keepalive": "60", + "cleansession": true, + "autoUnsubscribe": true, + "birthTopic": "", + "birthQos": "0", + "birthRetain": "false", + "birthPayload": "", + "birthMsg": {}, + "closeTopic": "", + "closeQos": "0", + "closeRetain": "false", + "closePayload": "", + "closeMsg": {}, + "willTopic": "", + "willQos": "0", + "willRetain": "false", + "willPayload": "", + "willMsg": {}, + "userProps": "", + "sessionExpiry": "" + } +] \ No newline at end of file diff --git a/examples/edge.flow.json b/examples/edge.flow.json deleted file mode 100644 index 671aa3f..0000000 --- a/examples/edge.flow.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - {"id":"monster_edge_tab","type":"tab","label":"monster edge","disabled":false,"info":"monster edge example"}, - {"id":"monster_edge_node","type":"monster","z":"monster_edge_tab","name":"monster edge","x":420,"y":180,"wires":[["monster_edge_dbg"]]}, - {"id":"monster_edge_inj","type":"inject","z":"monster_edge_tab","name":"unknown topic","props":[{"p":"topic","vt":"str"},{"p":"payload","vt":"str"}],"topic":"doesNotExist","payload":"x","payloadType":"str","x":170,"y":180,"wires":[["monster_edge_node"]]}, - {"id":"monster_edge_dbg","type":"debug","z":"monster_edge_tab","name":"monster edge debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":660,"y":180,"wires":[]} -] diff --git a/examples/integration.flow.json b/examples/integration.flow.json deleted file mode 100644 index 270a573..0000000 --- a/examples/integration.flow.json +++ /dev/null @@ -1,6 +0,0 @@ -[ - {"id":"monster_int_tab","type":"tab","label":"monster integration","disabled":false,"info":"monster integration example"}, - {"id":"monster_int_node","type":"monster","z":"monster_int_tab","name":"monster integration","x":420,"y":180,"wires":[["monster_int_dbg"]]}, - {"id":"monster_int_inj","type":"inject","z":"monster_int_tab","name":"registerChild","props":[{"p":"topic","vt":"str"},{"p":"payload","vt":"str"}],"topic":"registerChild","payload":"example-child-id","payloadType":"str","x":170,"y":180,"wires":[["monster_int_node"]]}, - {"id":"monster_int_dbg","type":"debug","z":"monster_int_tab","name":"monster integration debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":680,"y":180,"wires":[]} -] diff --git a/examples/monster-api-dashboard.flow.json b/examples/monster-api-dashboard.flow.json deleted file mode 100644 index 3a3dfb0..0000000 --- a/examples/monster-api-dashboard.flow.json +++ /dev/null @@ -1,743 +0,0 @@ -[ - { - "id": "monster_api_tab", - "type": "tab", - "label": "Monster API + Dashboard", - "disabled": false, - "info": "Full monster orchestration example with API integrations. Credentials are placeholders." - }, - { - "id": "ui_base_monster_api", - "type": "ui-base", - "name": "EVOLV Demo", - "path": "/dashboard", - "appIcon": "", - "includeClientData": true, - "acceptsClientConfig": [ - "ui-notification", - "ui-control" - ], - "showPathInSidebar": false, - "headerContent": "page", - "navigationStyle": "default", - "titleBarStyle": "default" - }, - { - "id": "ui_theme_monster_api", - "type": "ui-theme", - "name": "Monster API Theme", - "colors": { - "surface": "#ffffff", - "primary": "#4f8582", - "bgPage": "#efefef", - "groupBg": "#ffffff", - "groupOutline": "#d8d8d8" - }, - "sizes": { - "density": "default", - "pagePadding": "14px", - "groupGap": "14px", - "groupBorderRadius": "6px", - "widgetGap": "12px" - } - }, - { - "id": "ui_page_monster_api", - "type": "ui-page", - "name": "Monster API", - "ui": "ui_base_monster_api", - "path": "/monster-api", - "icon": "science", - "layout": "grid", - "theme": "ui_theme_monster_api", - "breakpoints": [ - { - "name": "Default", - "px": "0", - "cols": "12" - } - ], - "order": 1, - "className": "" - }, - { - "id": "ui_group_monster_api_ctrl", - "type": "ui-group", - "name": "Input", - "page": "ui_page_monster_api", - "width": "6", - "height": "1", - "order": 1, - "showTitle": true, - "className": "" - }, - { - "id": "ui_group_monster_api_obs", - "type": "ui-group", - "name": "Output", - "page": "ui_page_monster_api", - "width": "12", - "height": "1", - "order": 2, - "showTitle": true, - "className": "" - }, - { - "id": "monster_api_node", - "type": "monster", - "z": "monster_api_tab", - "name": "Monster API", - "samplingtime": "24", - "minvolume": "5", - "maxweight": "23", - "nominalFlowMin": "1000", - "flowMax": "6000", - "maxRainRef": "10", - "minSampleIntervalSec": "60", - "emptyWeightBucket": "8.3", - "aquon_sample_name": "112150", - "enableLog": false, - "logLevel": "error", - "positionVsParent": "atEquipment", - "positionIcon": "⊥", - "hasDistance": false, - "distance": "", - "x": 980, - "y": 320, - "wires": [ - [ - "monster_api_parse_output", - "monster_api_zinfo_prepare" - ], - [ - "monster_api_dbg_influx" - ], - [ - "monster_api_dbg_parent" - ] - ] - }, - { - "id": "monster_api_info", - "type": "comment", - "z": "monster_api_tab", - "name": "Template only: set credentials/URLs before production", - "info": "All secrets in this flow are placeholders. Replace with env vars or credential nodes.", - "x": 260, - "y": 80, - "wires": [] - }, - { - "id": "monster_api_inj_flow", - "type": "inject", - "z": "monster_api_tab", - "group": "ui_group_monster_api_ctrl", - "name": "Flow 1800 m3/h", - "props": [ - { - "p": "payload" - } - ], - "repeat": "5", - "crontab": "", - "once": true, - "onceDelay": "1", - "topic": "", - "payload": "1800", - "payloadType": "num", - "x": 170, - "y": 180, - "wires": [ - [ - "monster_api_build_flow" - ] - ] - }, - { - "id": "monster_api_build_flow", - "type": "function", - "z": "monster_api_tab", - "name": "Build input_q", - "func": "msg.topic='input_q';\nmsg.payload={value:Number(msg.payload),unit:'m3/h'};\nreturn Number.isFinite(msg.payload.value)?msg:null;", - "outputs": 1, - "noerr": 0, - "x": 390, - "y": 180, - "wires": [ - [ - "monster_api_node" - ] - ] - }, - { - "id": "monster_api_inj_start", - "type": "inject", - "z": "monster_api_tab", - "group": "ui_group_monster_api_ctrl", - "name": "Manual Start", - "props": [ - { - "p": "topic", - "vt": "str" - }, - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": "0.1", - "topic": "i_start", - "payload": "true", - "payloadType": "bool", - "x": 160, - "y": 240, - "wires": [ - [ - "monster_api_node" - ] - ] - }, - { - "id": "monster_api_weather_trigger", - "type": "inject", - "z": "monster_api_tab", - "name": "Weather fetch (daily)", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "55 07 * * *", - "once": false, - "onceDelay": "", - "topic": "", - "payload": "", - "payloadType": "date", - "x": 190, - "y": 420, - "wires": [ - [ - "monster_api_weather_http" - ] - ] - }, - { - "id": "monster_api_weather_http", - "type": "http request", - "z": "monster_api_tab", - "name": "Open-Meteo", - "method": "GET", - "ret": "txt", - "paytoqs": "ignore", - "url": "https://api.open-meteo.com/v1/forecast?latitude=51.71&longitude=4.81&hourly=precipitation,precipitation_probability&timezone=Europe%2FBerlin&past_days=1&forecast_days=2", - "tls": "", - "persist": false, - "proxy": "", - "insecureHTTPParser": false, - "authType": "", - "senderr": false, - "headers": [], - "x": 380, - "y": 420, - "wires": [ - [ - "monster_api_weather_json" - ] - ] - }, - { - "id": "monster_api_weather_json", - "type": "json", - "z": "monster_api_tab", - "name": "rain_data", - "property": "payload", - "action": "", - "pretty": false, - "x": 550, - "y": 420, - "wires": [ - [ - "monster_api_weather_topic" - ] - ] - }, - { - "id": "monster_api_weather_topic", - "type": "change", - "z": "monster_api_tab", - "name": "topic rain_data", - "rules": [ - { - "t": "set", - "p": "topic", - "pt": "msg", - "to": "rain_data", - "tot": "str" - } - ], - "x": 720, - "y": 420, - "wires": [ - [ - "monster_api_node" - ] - ] - }, - { - "id": "monster_api_aquon_trigger", - "type": "inject", - "z": "monster_api_tab", - "name": "Aquon fetch (daily)", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "15 07 * * *", - "once": false, - "onceDelay": "", - "topic": "", - "payload": "", - "payloadType": "date", - "x": 180, - "y": 500, - "wires": [ - [ - "monster_api_sftp_get" - ] - ] - }, - { - "id": "monster_api_sftp_get", - "type": "sftp in", - "z": "monster_api_tab", - "sftp": "monster_api_sftp_cfg", - "operation": "get", - "filename": "wsBD_MONSTERNAMETIJDEN.csv", - "localFilename": "./.node-red/node_modules/typicals/monster/config/monsternametijden.csv", - "name": "Aquon schedule", - "x": 380, - "y": 500, - "wires": [ - [ - "monster_api_file_in" - ] - ] - }, - { - "id": "monster_api_file_in", - "type": "file in", - "z": "monster_api_tab", - "name": "read monsternametijden", - "filename": "./.node-red/node_modules/typicals/monster/config/monsternametijden.csv", - "filenameType": "str", - "format": "utf8", - "chunk": false, - "sendError": false, - "encoding": "none", - "allProps": false, - "x": 590, - "y": 500, - "wires": [ - [ - "monster_api_csv" - ] - ] - }, - { - "id": "monster_api_csv", - "type": "csv", - "z": "monster_api_tab", - "name": "monsternametijden", - "sep": ",", - "hdrin": true, - "hdrout": "all", - "multi": "mult", - "ret": "\\n", - "temp": "SAMPLE_NAME,DESCRIPTION,SAMPLED_DATE,START_DATE,END_DATE", - "skip": "0", - "strings": true, - "include_empty_strings": "", - "include_null_values": "", - "x": 780, - "y": 500, - "wires": [ - [ - "monster_api_schedule_topic" - ] - ] - }, - { - "id": "monster_api_schedule_topic", - "type": "change", - "z": "monster_api_tab", - "name": "topic monsternametijden", - "rules": [ - { - "t": "set", - "p": "topic", - "pt": "msg", - "to": "monsternametijden", - "tot": "str" - } - ], - "x": 990, - "y": 500, - "wires": [ - [ - "monster_api_node" - ] - ] - }, - { - "id": "monster_api_zinfo_prepare", - "type": "function", - "z": "monster_api_tab", - "name": "Z-Info prepare on run stop", - "func": "const p=(msg&&msg.payload&&typeof msg.payload==='object')?msg.payload:{};\nconst runningNow=Boolean(p.running);\nconst runningPrev=Boolean(context.get('runningPrev'));\ncontext.set('runningPrev',runningNow);\nif(!(runningPrev && !runningNow)){\n return null;\n}\nconst today=new Date();\nconst day=String(today.getDate()).padStart(2,'0');\nconst month=String(today.getMonth()+1).padStart(2,'0');\nconst year=today.getFullYear();\nconst yesterdayDate=new Date(today.getTime()-24*3600*1000);\nconst yDay=String(yesterdayDate.getDate()).padStart(2,'0');\nconst yMonth=String(yesterdayDate.getMonth()+1).padStart(2,'0');\nconst yYear=yesterdayDate.getFullYear();\nmsg.zinfoDateFrom=`${yYear}-${yMonth}-${yDay}`;\nmsg.zinfoDateUntil=`${year}-${month}-${day}`;\nmsg.zinfoData={\n m3Total:Number(p.m3Total||0),\n pulse:Math.max(0,Math.floor(Number(p.m3PerPuls||p.m3PerPulse||0)))\n};\nmsg.payload='grant_type=password&username=__SET_ZINFO_USERNAME__&password=__SET_ZINFO_PASSWORD__&client_id=__SET_ZINFO_CLIENT_ID__&client_secret=__SET_ZINFO_CLIENT_SECRET__';\nmsg.headers=msg.headers||{};\nmsg.headers['content-type']='application/x-www-form-urlencoded';\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1260, - "y": 320, - "wires": [ - [ - "monster_api_zinfo_token" - ] - ] - }, - { - "id": "monster_api_zinfo_token", - "type": "http request", - "z": "monster_api_tab", - "name": "Z-Info token", - "method": "POST", - "ret": "txt", - "paytoqs": "ignore", - "url": "https://__SET_ZINFO_HOST__/WSR/zi_wsr.svc/token", - "tls": "", - "persist": false, - "proxy": "", - "insecureHTTPParser": false, - "authType": "", - "senderr": false, - "headers": [], - "x": 1450, - "y": 320, - "wires": [ - [ - "monster_api_zinfo_token_json" - ] - ] - }, - { - "id": "monster_api_zinfo_token_json", - "type": "json", - "z": "monster_api_tab", - "name": "token json", - "property": "payload", - "action": "", - "pretty": false, - "x": 1630, - "y": 320, - "wires": [ - [ - "monster_api_zinfo_import_builder" - ] - ] - }, - { - "id": "monster_api_zinfo_import_builder", - "type": "function", - "z": "monster_api_tab", - "name": "Build Z-Info import", - "func": "const token=msg.payload&&msg.payload.access_token;\nconst z=msg.zinfoData||{};\nconst from=msg.zinfoDateFrom;\nconst until=msg.zinfoDateUntil;\nconst ns='__SET_ZINFO_NAMESPACE__';\nmsg.payload={\n import:{\n algemeen:{\n AanleverendeOrganisatie:'NL.25',\n Versie:'IMm2018',\n Batchid:`ZI_PA_NL.25_${Date.now()}.json`,\n Systeembron:'WBD/NEERSG',\n Systeemdoel:'HWH/Z-info',\n Opmerking:'template'\n },\n data:[{\n Meetwaarden:[\n {mepid:`${ns}.F021.m3`,dbmDtm:from,dbmTijd:'06:00',demDtm:until,demTijd:'06:00',mwdWaarde:`${Number(z.m3Total||0)}`,mwdWaardeAN:'',nMwd:'',mwdOpmerk:'template'},\n {mepid:`${ns}.Q000.PULS`,dbmDtm:from,dbmTijd:'06:00',demDtm:until,demTijd:'06:00',mwdWaarde:`${Number(z.pulse||0)}`,mwdWaardeAN:'',nMwd:'',mwdOpmerk:'template'}\n ]\n }]\n }\n};\nmsg.headers=msg.headers||{};\nif(token){msg.headers.authorization='Bearer '+token;}\nmsg.headers['content-type']='application/json';\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 1830, - "y": 320, - "wires": [ - [ - "monster_api_zinfo_import_put" - ] - ] - }, - { - "id": "monster_api_zinfo_import_put", - "type": "http request", - "z": "monster_api_tab", - "name": "Z-Info import PUT", - "method": "PUT", - "ret": "txt", - "paytoqs": "ignore", - "url": "https://__SET_ZINFO_HOST__/WSR/zi_wsr.svc/json/NL.25/importmwd/pa/?gebruiker=__SET_ZINFO_USER__", - "tls": "", - "persist": false, - "proxy": "", - "insecureHTTPParser": false, - "authType": "", - "senderr": false, - "headers": [], - "x": 2040, - "y": 320, - "wires": [ - [ - "monster_api_dbg_zinfo" - ] - ] - }, - { - "id": "monster_api_dbg_zinfo", - "type": "debug", - "z": "monster_api_tab", - "name": "Z-Info response", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "targetType": "full", - "x": 2250, - "y": 320, - "wires": [] - }, - { - "id": "monster_api_parse_output", - "type": "function", - "z": "monster_api_tab", - "name": "Parse output for dashboard", - "func": "const p=(msg&&msg.payload&&typeof msg.payload==='object')?msg.payload:{};\nconst now=Date.now();\nconst m3PerPuls=Number(p.m3PerPuls||p.m3PerPulse);\nreturn [\n Number.isFinite(Number(p.q))?{topic:'q_m3h',payload:Number(p.q),timestamp:now}:null,\n Number.isFinite(Number(p.m3Total))?{topic:'m3_total',payload:Number(p.m3Total),timestamp:now}:null,\n Number.isFinite(Number(p.bucketVol))?{topic:'bucket_l',payload:Number(p.bucketVol),timestamp:now}:null,\n Number.isFinite(m3PerPuls)?{topic:'m3_per_pulse',payload:m3PerPuls,timestamp:now}:null,\n {topic:'status',payload:`running=${Boolean(p.running)} | pulse=${Boolean(p.pulse)} | m3PerPuls=${Number.isFinite(m3PerPuls)?m3PerPuls:'n/a'} | missed=${Number(p.missedSamples||0)}`}\n];", - "outputs": 5, - "noerr": 0, - "x": 1240, - "y": 220, - "wires": [ - [ - "monster_api_chart_q" - ], - [ - "monster_api_chart_total" - ], - [ - "monster_api_chart_bucket" - ], - [ - "monster_api_chart_pulse" - ], - [ - "monster_api_text_status" - ] - ] - }, - { - "id": "monster_api_chart_q", - "type": "ui-chart", - "z": "monster_api_tab", - "group": "ui_group_monster_api_obs", - "name": "q", - "label": "Flow q (m3/h)", - "order": 1, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisProperty": "payload", - "yAxisPropertyType": "msg", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1470, - "y": 120, - "wires": [] - }, - { - "id": "monster_api_chart_total", - "type": "ui-chart", - "z": "monster_api_tab", - "group": "ui_group_monster_api_obs", - "name": "m3Total", - "label": "m3Total", - "order": 2, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisProperty": "payload", - "yAxisPropertyType": "msg", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1480, - "y": 180, - "wires": [] - }, - { - "id": "monster_api_chart_bucket", - "type": "ui-chart", - "z": "monster_api_tab", - "group": "ui_group_monster_api_obs", - "name": "bucket", - "label": "Bucket (L)", - "order": 3, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisProperty": "payload", - "yAxisPropertyType": "msg", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1480, - "y": 240, - "wires": [] - }, - { - "id": "monster_api_chart_pulse", - "type": "ui-chart", - "z": "monster_api_tab", - "group": "ui_group_monster_api_obs", - "name": "m3PerPuls", - "label": "m3PerPuls", - "order": 4, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisProperty": "payload", - "yAxisPropertyType": "msg", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1490, - "y": 300, - "wires": [] - }, - { - "id": "monster_api_text_status", - "type": "ui-text", - "z": "monster_api_tab", - "group": "ui_group_monster_api_obs", - "name": "status", - "label": "Status", - "order": 5, - "width": 12, - "height": 1, - "format": "{{msg.payload}}", - "layout": "row-spread", - "x": 1460, - "y": 360, - "wires": [] - }, - { - "id": "monster_api_dashboardapi", - "type": "dashboardapi", - "z": "monster_api_tab", - "name": "dashboard template", - "x": 1430, - "y": 420, - "wires": [ - [ - "monster_api_grafana_post" - ] - ] - }, - { - "id": "monster_api_grafana_post", - "type": "http request", - "z": "monster_api_tab", - "name": "Grafana dashboard API", - "method": "POST", - "ret": "txt", - "paytoqs": "ignore", - "url": "https://__SET_GRAFANA_HOST__/api/dashboards/db", - "tls": "", - "persist": false, - "proxy": "", - "insecureHTTPParser": false, - "authType": "", - "senderr": false, - "headers": [], - "x": 1650, - "y": 420, - "wires": [ - [ - "monster_api_dbg_dashboard" - ] - ] - }, - { - "id": "monster_api_dbg_dashboard", - "type": "debug", - "z": "monster_api_tab", - "name": "dashboard API response", - "active": false, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "false", - "targetType": "full", - "x": 1870, - "y": 420, - "wires": [] - }, - { - "id": "monster_api_dbg_influx", - "type": "debug", - "z": "monster_api_tab", - "name": "influx output", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 1240, - "y": 460, - "wires": [] - }, - { - "id": "monster_api_dbg_parent", - "type": "debug", - "z": "monster_api_tab", - "name": "parent output", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 1230, - "y": 500, - "wires": [] - }, - { - "id": "monster_api_sftp_cfg", - "type": "sftp", - "host": "__SET_AQUON_SFTP_HOST__", - "port": "22", - "username": "__SET_AQUON_SFTP_USERNAME__", - "password": "__SET_AQUON_SFTP_PASSWORD__", - "hmac": [], - "cipher": [] - } -] diff --git a/examples/monster-dashboard.flow.json b/examples/monster-dashboard.flow.json deleted file mode 100644 index 1843d97..0000000 --- a/examples/monster-dashboard.flow.json +++ /dev/null @@ -1,483 +0,0 @@ -[ - { - "id": "monster_tab_demo", - "type": "tab", - "label": "Monster Dashboard Demo", - "disabled": false, - "info": "Dashboard-focused example for monster output visualization" - }, - { - "id": "ui_base_monster_demo", - "type": "ui-base", - "name": "EVOLV Demo", - "path": "/dashboard", - "appIcon": "", - "includeClientData": true, - "acceptsClientConfig": [ - "ui-notification", - "ui-control" - ], - "showPathInSidebar": false, - "headerContent": "page", - "navigationStyle": "default", - "titleBarStyle": "default" - }, - { - "id": "ui_theme_monster_demo", - "type": "ui-theme", - "name": "EVOLV Monster Theme", - "colors": { - "surface": "#ffffff", - "primary": "#4f8582", - "bgPage": "#efefef", - "groupBg": "#ffffff", - "groupOutline": "#d8d8d8" - }, - "sizes": { - "density": "default", - "pagePadding": "14px", - "groupGap": "14px", - "groupBorderRadius": "6px", - "widgetGap": "12px" - } - }, - { - "id": "ui_page_monster_demo", - "type": "ui-page", - "name": "Monster Demo", - "ui": "ui_base_monster_demo", - "path": "/monster-demo", - "icon": "science", - "layout": "grid", - "theme": "ui_theme_monster_demo", - "breakpoints": [ - { - "name": "Default", - "px": "0", - "cols": "12" - } - ], - "order": 1, - "className": "" - }, - { - "id": "ui_group_monster_ctrl", - "type": "ui-group", - "name": "Monster Inputs", - "page": "ui_page_monster_demo", - "width": "6", - "height": "1", - "order": 1, - "showTitle": true, - "className": "" - }, - { - "id": "ui_group_monster_obs", - "type": "ui-group", - "name": "Monster Output", - "page": "ui_page_monster_demo", - "width": "12", - "height": "1", - "order": 2, - "showTitle": true, - "className": "" - }, - { - "id": "monster_node_demo", - "type": "monster", - "z": "monster_tab_demo", - "name": "Monster Demo", - "samplingtime": "24", - "minvolume": "5", - "maxweight": "23", - "nominalFlowMin": "1000", - "flowMax": "6000", - "maxRainRef": "10", - "minSampleIntervalSec": "60", - "emptyWeightBucket": "8.3", - "aquon_sample_name": "112150", - "uuid": "", - "supplier": "monster", - "category": "monster", - "assetType": "sampling-cabinet", - "model": "monster-standard", - "unit": "m3/h", - "enableLog": false, - "logLevel": "error", - "positionVsParent": "atEquipment", - "positionIcon": "⊥", - "hasDistance": false, - "distance": "", - "x": 900, - "y": 260, - "wires": [ - [ - "monster_parse_output" - ], - [ - "monster_debug_influx" - ], - [ - "monster_debug_parent" - ] - ] - }, - { - "id": "monster_flow_inject", - "type": "inject", - "z": "monster_tab_demo", - "group": "ui_group_monster_ctrl", - "name": "Flow 1800 m3/h", - "props": [ - { - "p": "payload" - } - ], - "repeat": "5", - "crontab": "", - "once": true, - "onceDelay": "1", - "topic": "", - "payload": "1800", - "payloadType": "num", - "x": 170, - "y": 180, - "wires": [ - [ - "monster_build_flow" - ] - ] - }, - { - "id": "monster_build_flow", - "type": "function", - "z": "monster_tab_demo", - "name": "Build input_q", - "func": "msg.topic = 'input_q';\nmsg.payload = { value: Number(msg.payload), unit: 'm3/h' };\nreturn Number.isFinite(msg.payload.value) ? msg : null;", - "outputs": 1, - "noerr": 0, - "x": 380, - "y": 180, - "wires": [ - [ - "monster_node_demo" - ] - ] - }, - { - "id": "monster_start_inject", - "type": "inject", - "z": "monster_tab_demo", - "group": "ui_group_monster_ctrl", - "name": "Manual Start", - "props": [ - { - "p": "topic", - "vt": "str" - }, - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": false, - "onceDelay": "0.1", - "topic": "i_start", - "payload": "true", - "payloadType": "bool", - "x": 160, - "y": 240, - "wires": [ - [ - "monster_node_demo" - ] - ] - }, - { - "id": "monster_rain_inject", - "type": "inject", - "z": "monster_tab_demo", - "group": "ui_group_monster_ctrl", - "name": "Seed rain_data", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "2", - "topic": "", - "payload": "", - "payloadType": "date", - "x": 160, - "y": 300, - "wires": [ - [ - "monster_build_rain" - ] - ] - }, - { - "id": "monster_build_rain", - "type": "function", - "z": "monster_tab_demo", - "name": "Build rain_data", - "func": "const now = new Date();\nconst mk = (offset, rain, prob) => {\n const d = new Date(now.getTime() + offset * 3600 * 1000);\n return { t: d.toISOString().slice(0, 13) + ':00', rain, prob };\n};\nconst rows = [mk(-1, 0.2, 20), mk(0, 0.8, 40), mk(1, 1.1, 60), mk(2, 0.5, 30)];\nmsg.topic = 'rain_data';\nmsg.payload = [\n {\n latitude: 51.71,\n longitude: 4.81,\n hourly: {\n time: rows.map(r => r.t),\n precipitation: rows.map(r => r.rain),\n precipitation_probability: rows.map(r => r.prob)\n }\n }\n];\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 380, - "y": 300, - "wires": [ - [ - "monster_node_demo" - ] - ] - }, - { - "id": "monster_schedule_inject", - "type": "inject", - "z": "monster_tab_demo", - "group": "ui_group_monster_ctrl", - "name": "Seed monsternametijden", - "props": [ - { - "p": "payload" - } - ], - "repeat": "", - "crontab": "", - "once": true, - "onceDelay": "3", - "topic": "", - "payload": "", - "payloadType": "date", - "x": 190, - "y": 360, - "wires": [ - [ - "monster_build_schedule" - ] - ] - }, - { - "id": "monster_build_schedule", - "type": "function", - "z": "monster_tab_demo", - "name": "Build monsternametijden", - "func": "const now = new Date();\nconst next = new Date(now.getTime() + 24 * 3600 * 1000);\nconst end = new Date(next.getTime() + 24 * 3600 * 1000);\nmsg.topic = 'monsternametijden';\nmsg.payload = [\n {\n SAMPLE_NAME: '112150',\n DESCRIPTION: 'demo schedule',\n SAMPLED_DATE: next.toISOString().slice(0, 19).replace('T', ' '),\n START_DATE: next.toISOString().slice(0, 19).replace('T', ' '),\n END_DATE: end.toISOString().slice(0, 19).replace('T', ' ')\n }\n];\nreturn msg;", - "outputs": 1, - "noerr": 0, - "x": 410, - "y": 360, - "wires": [ - [ - "monster_node_demo" - ] - ] - }, - { - "id": "monster_parse_output", - "type": "function", - "z": "monster_tab_demo", - "name": "Parse monster output", - "func": "const p = (msg && msg.payload && typeof msg.payload === 'object') ? msg.payload : {};\nconst now = Date.now();\nconst q = Number(p.q);\nconst total = Number(p.m3Total);\nconst bucket = Number(p.bucketVol);\nconst rem = Number(p.pulsesRemaining);\nconst m3PerPulse = Number(p.m3PerPuls || p.m3PerPulse);\nconst status = `running=${Boolean(p.running)} | pulse=${Boolean(p.pulse)} | m3PerPuls=${Number.isFinite(m3PerPulse) ? m3PerPulse : 'n/a'} | missed=${Number(p.missedSamples || 0)}`;\nreturn [\n Number.isFinite(q) ? { topic: 'q_m3h', payload: q, timestamp: now } : null,\n Number.isFinite(total) ? { topic: 'm3_total', payload: total, timestamp: now } : null,\n Number.isFinite(bucket) ? { topic: 'bucket_l', payload: bucket, timestamp: now } : null,\n Number.isFinite(rem) ? { topic: 'pulses_remaining', payload: rem, timestamp: now } : null,\n Number.isFinite(m3PerPulse) ? { topic: 'm3_per_pulse', payload: m3PerPulse, timestamp: now } : null,\n { topic: 'status', payload: status }\n];", - "outputs": 6, - "noerr": 0, - "x": 1130, - "y": 260, - "wires": [ - [ - "monster_chart_q" - ], - [ - "monster_chart_m3total" - ], - [ - "monster_chart_bucket" - ], - [ - "monster_chart_remaining" - ], - [ - "monster_chart_m3pulse" - ], - [ - "monster_text_status" - ] - ] - }, - { - "id": "monster_chart_q", - "type": "ui-chart", - "z": "monster_tab_demo", - "group": "ui_group_monster_obs", - "name": "Flow q", - "label": "Flow q (m3/h)", - "order": 1, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisPropertyType": "msg", - "yAxisProperty": "payload", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1370, - "y": 120, - "wires": [] - }, - { - "id": "monster_chart_m3total", - "type": "ui-chart", - "z": "monster_tab_demo", - "group": "ui_group_monster_obs", - "name": "m3 Total", - "label": "m3Total (m3)", - "order": 2, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisPropertyType": "msg", - "yAxisProperty": "payload", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1380, - "y": 180, - "wires": [] - }, - { - "id": "monster_chart_bucket", - "type": "ui-chart", - "z": "monster_tab_demo", - "group": "ui_group_monster_obs", - "name": "Bucket Volume", - "label": "Bucket (L)", - "order": 3, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisPropertyType": "msg", - "yAxisProperty": "payload", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1380, - "y": 240, - "wires": [] - }, - { - "id": "monster_chart_remaining", - "type": "ui-chart", - "z": "monster_tab_demo", - "group": "ui_group_monster_obs", - "name": "Pulses Remaining", - "label": "Pulses Remaining", - "order": 4, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisPropertyType": "msg", - "yAxisProperty": "payload", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1400, - "y": 300, - "wires": [] - }, - { - "id": "monster_chart_m3pulse", - "type": "ui-chart", - "z": "monster_tab_demo", - "group": "ui_group_monster_obs", - "name": "m3 per pulse", - "label": "m3PerPuls", - "order": 5, - "width": 6, - "height": 4, - "chartType": "line", - "category": "topic", - "categoryType": "msg", - "xAxisType": "time", - "xAxisPropertyType": "timestamp", - "yAxisPropertyType": "msg", - "yAxisProperty": "payload", - "removeOlder": "30", - "removeOlderUnit": "60", - "showLegend": false, - "action": "append", - "x": 1390, - "y": 360, - "wires": [] - }, - { - "id": "monster_text_status", - "type": "ui-text", - "z": "monster_tab_demo", - "group": "ui_group_monster_obs", - "name": "Sampling status", - "label": "Status", - "order": 6, - "width": 12, - "height": 1, - "format": "{{msg.payload}}", - "layout": "row-spread", - "x": 1380, - "y": 420, - "wires": [] - }, - { - "id": "monster_debug_influx", - "type": "debug", - "z": "monster_tab_demo", - "name": "Influx output", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 1130, - "y": 320, - "wires": [] - }, - { - "id": "monster_debug_parent", - "type": "debug", - "z": "monster_tab_demo", - "name": "Parent output", - "active": true, - "tosidebar": true, - "console": false, - "tostatus": false, - "complete": "true", - "targetType": "full", - "x": 1130, - "y": 360, - "wires": [] - } -]