diff --git a/flow.json b/flow.json index 0637a08..89756e7 100644 --- a/flow.json +++ b/flow.json @@ -1 +1,1037 @@ -[] \ No newline at end of file +[ + { + "id": "7814434760ede84f", + "type": "tab", + "label": "Flow 1", + "disabled": false, + "info": "" + }, + { + "id": "f2fa6dd5ecc6fee9", + "type": "tab", + "label": "Input", + "disabled": false, + "info": "" + }, + { + "id": "c5f6844437dd47a5", + "type": "tab", + "label": "UI Elements", + "disabled": false, + "info": "" + }, + { + "id": "d354ea3adc51a23c", + "type": "tab", + "label": "Output", + "disabled": false, + "info": "" + }, + { + "id": "750cc01832709457", + "type": "ui_base", + "theme": { + "name": "theme-dark", + "lightTheme": { + "default": "#0094CE", + "baseColor": "#0094CE", + "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", + "edited": false + }, + "darkTheme": { + "default": "#097479", + "baseColor": "#097479", + "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", + "edited": true, + "reset": false + }, + "customTheme": { + "name": "Untitled Theme 1", + "default": "#4B7930", + "baseColor": "#4B7930", + "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif", + "reset": false + }, + "themeState": { + "base-color": { + "default": "#097479", + "value": "#097479", + "edited": false + }, + "page-titlebar-backgroundColor": { + "value": "#097479", + "edited": false + }, + "page-backgroundColor": { + "value": "#111111", + "edited": false + }, + "page-sidebar-backgroundColor": { + "value": "#333333", + "edited": false + }, + "group-textColor": { + "value": "#0eb8c0", + "edited": false + }, + "group-borderColor": { + "value": "#555555", + "edited": false + }, + "group-backgroundColor": { + "value": "#333333", + "edited": false + }, + "widget-textColor": { + "value": "#eeeeee", + "edited": false + }, + "widget-backgroundColor": { + "value": "#097479", + "edited": false + }, + "widget-borderColor": { + "value": "#333333", + "edited": false + }, + "base-font": { + "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif" + } + }, + "angularTheme": { + "primary": "indigo", + "accents": "blue", + "warn": "red", + "background": "grey", + "palette": "light" + } + }, + "site": { + "name": "Siegfried Dorn", + "hideToolbar": "false", + "allowSwipe": "false", + "lockMenu": "true", + "allowTempTheme": "none", + "dateFormat": "DD.MM.YYYY", + "sizes": { + "sx": 48, + "sy": 48, + "gx": 6, + "gy": 6, + "cx": 6, + "cy": 6, + "px": 0, + "py": 0 + } + } + }, + { + "id": "124aa983647c8074", + "type": "ui_tab", + "name": "Tab 1", + "icon": "dashboard", + "order": 1 + }, + { + "id": "a756759c113266b5", + "type": "ui_group", + "name": "Group 1", + "tab": "124aa983647c8074", + "order": 1, + "disp": true, + "width": "4", + "collapse": true, + "className": "" + }, + { + "id": "8dba3ccfebb75b33", + "type": "ui_group", + "name": "Windrichtung", + "tab": "124aa983647c8074", + "order": 3, + "disp": true, + "width": "5", + "collapse": false, + "className": "" + }, + { + "id": "738d12f3ae8a61a3", + "type": "mqtt-broker", + "name": "MQ Broker SDOIT", + "broker": "mqtt.sdoit.de", + "port": "8883", + "tls": "182ecf262e314f5c", + "clientid": "", + "usetls": true, + "protocolVersion": "4", + "keepalive": "60", + "cleansession": true, + "birthTopic": "", + "birthQos": "0", + "birthPayload": "", + "birthMsg": {}, + "closeTopic": "", + "closeQos": "0", + "closePayload": "", + "closeMsg": {}, + "willTopic": "", + "willQos": "0", + "willPayload": "", + "willMsg": {}, + "sessionExpiry": "" + }, + { + "id": "182ecf262e314f5c", + "type": "tls-config", + "name": "sdoit", + "cert": "", + "key": "", + "ca": "", + "certname": "", + "keyname": "", + "caname": "", + "servername": "mqtt.sdoit.de", + "verifyservercert": true, + "alpnprotocol": "" + }, + { + "id": "ba6fd973118b950c", + "type": "ui_tab", + "name": "Tab 3", + "icon": "dashboard", + "order": 3 + }, + { + "id": "3710f59d209e7cc2", + "type": "ui_group", + "name": "Barometer", + "tab": "124aa983647c8074", + "order": 2, + "disp": true, + "width": "5", + "collapse": false, + "className": "" + }, + { + "id": "b7d12b8d.651c8", + "type": "ui_group", + "name": "Default", + "tab": "fe5d396a.0d6d4", + "order": 1, + "disp": true, + "width": "20", + "collapse": false + }, + { + "id": "fe5d396a.0d6d4", + "type": "ui_tab", + "name": "Home", + "icon": "dashboard", + "disabled": false, + "hidden": false + }, + { + "id": "1db5a64de6fc2d9e", + "type": "MySQLdatabase", + "name": "Weather DB", + "host": "db", + "port": "3306", + "db": "node-red", + "tz": "", + "charset": "UTF8" + }, + { + "id": "6cb911a340dd0ff5", + "type": "inject", + "z": "f2fa6dd5ecc6fee9", + "name": "", + "props": [ + { + "p": "payload" + }, + { + "p": "topic", + "vt": "str" + } + ], + "repeat": "300", + "crontab": "", + "once": true, + "onceDelay": 0.1, + "topic": "test", + "payloadType": "date", + "x": 140, + "y": 300, + "wires": [ + [ + "dceaa64cdf99920b", + "e7fa67bc4dae509c" + ] + ] + }, + { + "id": "f770a584f4cb34b3", + "type": "debug", + "z": "f2fa6dd5ecc6fee9", + "name": "Openweather", + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 740, + "y": 220, + "wires": [] + }, + { + "id": "220fb7d74b77d77c", + "type": "json", + "z": "f2fa6dd5ecc6fee9", + "name": "", + "property": "payload", + "action": "obj", + "pretty": false, + "x": 620, + "y": 300, + "wires": [ + [ + "f770a584f4cb34b3", + "e41d26526985556b" + ] + ] + }, + { + "id": "dceaa64cdf99920b", + "type": "openweathermap", + "z": "f2fa6dd5ecc6fee9", + "name": "Openweathermap", + "wtype": "current", + "lon": "", + "lat": "", + "city": "Frankfurt", + "country": "Germany", + "language": "de", + "x": 350, + "y": 300, + "wires": [ + [ + "220fb7d74b77d77c" + ] + ] + }, + { + "id": "e41d26526985556b", + "type": "link out", + "z": "f2fa6dd5ecc6fee9", + "name": "weather", + "links": [ + "baeb6a5a161373bf", + "7fbd6896a5bc5ed3", + "73f47758e35544c8", + "97822532c623d138", + "5cc92a265ea6197c" + ], + "x": 1315, + "y": 300, + "wires": [] + }, + { + "id": "73f47758e35544c8", + "type": "link in", + "z": "d354ea3adc51a23c", + "name": "", + "links": [ + "e41d26526985556b" + ], + "x": 195, + "y": 100, + "wires": [ + [ + "0d1d3701ba08c47f", + "4ee5519b4ee22fbf" + ] + ] + }, + { + "id": "0d1d3701ba08c47f", + "type": "mqtt out", + "z": "d354ea3adc51a23c", + "name": "raspi/weather", + "topic": "raspi/weather", + "qos": "0", + "retain": "", + "respTopic": "", + "contentType": "", + "userProps": "", + "correl": "", + "expiry": "", + "broker": "738d12f3ae8a61a3", + "x": 430, + "y": 100, + "wires": [] + }, + { + "id": "4ee5519b4ee22fbf", + "type": "debug", + "z": "d354ea3adc51a23c", + "name": "To weather", + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 430, + "y": 160, + "wires": [] + }, + { + "id": "ec902514be1514bb", + "type": "status", + "z": "f2fa6dd5ecc6fee9", + "name": "Status", + "scope": [ + "f770a584f4cb34b3", + "e7fa67bc4dae509c", + "50100e920347df93" + ], + "x": 170, + "y": 60, + "wires": [ + [ + "58bf8caa2d948bba" + ] + ] + }, + { + "id": "58bf8caa2d948bba", + "type": "debug", + "z": "f2fa6dd5ecc6fee9", + "name": "dbg Status", + "active": false, + "tosidebar": true, + "console": false, + "tostatus": false, + "complete": "payload", + "targetType": "msg", + "statusVal": "", + "statusType": "auto", + "x": 370, + "y": 60, + "wires": [] + }, + { + "id": "b6c4bf611cacfb7e", + "type": "catch", + "z": "f2fa6dd5ecc6fee9", + "name": "", + "scope": [ + "41295103e3127e87", + "5889653a74b5faef" + ], + "uncaught": false, + "x": 180, + "y": 680, + "wires": [ + [ + "50100e920347df93" + ] + ] + }, + { + "id": "50100e920347df93", + "type": "debug", + "z": "f2fa6dd5ecc6fee9", + "name": "", + "active": false, + "tosidebar": true, + "console": true, + "tostatus": true, + "complete": "true", + "targetType": "full", + "statusVal": "payload", + "statusType": "auto", + "x": 410, + "y": 680, + "wires": [] + }, + { + "id": "9f0d5da7b921bfc4", + "type": "ui_template", + "z": "c5f6844437dd47a5", + "group": "3710f59d209e7cc2", + "name": "Barometer", + "order": 1, + "width": "5", + "height": "5", + "format": "\n\n\n\n\n\n", + "storeOutMessages": true, + "fwdInMessages": true, + "resendOnRefresh": true, + "templateScope": "local", + "className": "", + "x": 550, + "y": 220, + "wires": [ + [] + ] + }, + { + "id": "97822532c623d138", + "type": "link in", + "z": "c5f6844437dd47a5", + "name": "", + "links": [ + "e41d26526985556b" + ], + "x": 155, + "y": 240, + "wires": [ + [ + "9f0d5da7b921bfc4", + "108158c72ae58d7d", + "4eb9904b0bad1dd4", + "b8b31f2d3c802145", + "e178ebc7cdfb3341", + "e7818ae4907668b2" + ] + ] + }, + { + "id": "108158c72ae58d7d", + "type": "ui_text", + "z": "c5f6844437dd47a5", + "group": "a756759c113266b5", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "Aktuelle Temperatur [°C] :", + "format": "{{msg.payload.tempc}}", + "layout": "col-center", + "className": "", + "x": 590, + "y": 180, + "wires": [] + }, + { + "id": "4eb9904b0bad1dd4", + "type": "ui_template", + "z": "c5f6844437dd47a5", + "group": "8dba3ccfebb75b33", + "name": "Winddir", + "order": 1, + "width": "5", + "height": "7", + "format": "\n\n\n\n\n\n", + "storeOutMessages": true, + "fwdInMessages": true, + "resendOnRefresh": true, + "templateScope": "local", + "className": "", + "x": 540, + "y": 300, + "wires": [ + [] + ] + }, + { + "id": "b8b31f2d3c802145", + "type": "ui_template", + "z": "c5f6844437dd47a5", + "group": "a756759c113266b5", + "name": "Temperatur", + "order": 2, + "width": "0", + "height": "0", + "format": "\n\n\n\n\n", + "storeOutMessages": true, + "fwdInMessages": true, + "resendOnRefresh": true, + "templateScope": "local", + "className": "", + "x": 550, + "y": 260, + "wires": [ + [] + ] + }, + { + "id": "fe102a7155a33faa", + "type": "link out", + "z": "f2fa6dd5ecc6fee9", + "name": "DateTime", + "links": [ + "ae331f1eb19e7b81", + "b68a9a843348e1bf" + ], + "x": 555, + "y": 460, + "wires": [] + }, + { + "id": "df19e2819075fb1a", + "type": "ui_text", + "z": "c5f6844437dd47a5", + "group": "a756759c113266b5", + "order": 1, + "width": 0, + "height": 0, + "name": "", + "label": "", + "format": "
{{msg.payload.date}}
{{msg.payload.time}}
", + "layout": "col-center", + "className": "", + "x": 530, + "y": 140, + "wires": [] + }, + { + "id": "ae331f1eb19e7b81", + "type": "link in", + "z": "c5f6844437dd47a5", + "name": "", + "links": [ + "fe102a7155a33faa" + ], + "x": 155, + "y": 140, + "wires": [ + [ + "df19e2819075fb1a" + ] + ] + }, + { + "id": "396b940d734ab05a", + "type": "inject", + "z": "f2fa6dd5ecc6fee9", + "name": "", + "props": [ + { + "p": "payload" + } + ], + "repeat": "", + "crontab": "", + "once": false, + "onceDelay": 0.1, + "topic": "", + "payload": "{\"id\":803,\"weather\":\"Clouds\",\"detail\":\"Überwiegend bewölkt\",\"icon\":\"04d\",\"tempk\":283.76,\"tempc\":25,\"temp_maxc\":11.8,\"temp_minc\":9.6,\"humidity\":87,\"pressure\":1020,\"maxtemp\":285.03,\"mintemp\":282.77,\"windspeed\":7.2,\"winddirection\":270,\"location\":\"Frankfurt am Main\",\"sunrise\":1676615606,\"sunset\":1676652328,\"clouds\":75,\"description\":\"The weather in Frankfurt am Main at coordinates: 50.1167, 8.6833 is Clouds (Überwiegend bewölkt).\"}", + "payloadType": "json", + "x": 910, + "y": 60, + "wires": [ + [ + "e41d26526985556b" + ] + ] + }, + { + "id": "ebdc01b5a4bcfa93", + "type": "ui_button", + "z": "f2fa6dd5ecc6fee9", + "name": "", + "group": "a756759c113266b5", + "order": 3, + "width": 0, + "height": 0, + "passthru": false, + "label": "Test", + "tooltip": "", + "color": "", + "bgcolor": "", + "className": "", + "icon": "", + "payload": "{\"id\":803,\"weather\":\"Clouds\",\"detail\":\"Überwiegend bewölkt\",\"icon\":\"04d\",\"tempk\":283.76,\"tempc\":35,\"temp_maxc\":11.8,\"temp_minc\":9.6,\"humidity\":87,\"pressure\":1020,\"maxtemp\":285.03,\"mintemp\":282.77,\"windspeed\":7.2,\"winddirection\":270,\"location\":\"Frankfurt am Main\",\"sunrise\":1676615606,\"sunset\":1676652328,\"clouds\":75,\"description\":\"The weather in Frankfurt am Main at coordinates: 50.1167, 8.6833 is Clouds (Überwiegend bewölkt).\"}", + "payloadType": "json", + "topic": "topic", + "topicType": "msg", + "x": 910, + "y": 100, + "wires": [ + [ + "e41d26526985556b" + ] + ] + }, + { + "id": "e178ebc7cdfb3341", + "type": "function", + "z": "c5f6844437dd47a5", + "name": "", + "func": "var wind=global.get('wind') || {};\nvar wind_avg = global.get ('wind_avg') || 0;\n\nvar payload=msg.payload.winddirection;\nnode.log(payload);\n\n\nif (wind.message==undefined)\n {\n wind.message=[];\n }\nwind.message.push(payload);\n\nif (wind.message.length>20)\n{\n wind.message.shift();\n}\n\nglobal.set('wind',wind);\nvar s=\"\";\nfor (i=(wind.message.length-1);i>=0;i--)\n s=s+wind.message[i];\nvar c = 0;\nfor (i=(wind.message.length-1);i>=0;i--)\n{\n c=c+wind.message[i];\n}\n\nwind_avg = c/(wind.message.length);\nglobal.set('wind_avg', wind_avg)\nglobal.set('wind', wind)\nnode.log(msg);\nmsg.payload.wind_avg=wind_avg;\n\nreturn msg;", + "outputs": 1, + "noerr": 0, + "initialize": "", + "finalize": "", + "libs": [], + "x": 300, + "y": 320, + "wires": [ + [ + "722c05d553b5a3e0", + "4eb9904b0bad1dd4" + ] + ] + }, + { + "id": "722c05d553b5a3e0", + "type": "ui_template", + "z": "c5f6844437dd47a5", + "group": "b7d12b8d.651c8", + "name": "", + "order": 1, + "width": 0, + "height": 0, + "format": "\n
\n\n| {{p.message}} | \n