You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1037 lines
32 KiB

  1. [
  2. {
  3. "id": "7814434760ede84f",
  4. "type": "tab",
  5. "label": "Flow 1",
  6. "disabled": false,
  7. "info": ""
  8. },
  9. {
  10. "id": "f2fa6dd5ecc6fee9",
  11. "type": "tab",
  12. "label": "Input",
  13. "disabled": false,
  14. "info": ""
  15. },
  16. {
  17. "id": "c5f6844437dd47a5",
  18. "type": "tab",
  19. "label": "UI Elements",
  20. "disabled": false,
  21. "info": ""
  22. },
  23. {
  24. "id": "d354ea3adc51a23c",
  25. "type": "tab",
  26. "label": "Output",
  27. "disabled": false,
  28. "info": ""
  29. },
  30. {
  31. "id": "750cc01832709457",
  32. "type": "ui_base",
  33. "theme": {
  34. "name": "theme-dark",
  35. "lightTheme": {
  36. "default": "#0094CE",
  37. "baseColor": "#0094CE",
  38. "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
  39. "edited": false
  40. },
  41. "darkTheme": {
  42. "default": "#097479",
  43. "baseColor": "#097479",
  44. "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
  45. "edited": true,
  46. "reset": false
  47. },
  48. "customTheme": {
  49. "name": "Untitled Theme 1",
  50. "default": "#4B7930",
  51. "baseColor": "#4B7930",
  52. "baseFont": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif",
  53. "reset": false
  54. },
  55. "themeState": {
  56. "base-color": {
  57. "default": "#097479",
  58. "value": "#097479",
  59. "edited": false
  60. },
  61. "page-titlebar-backgroundColor": {
  62. "value": "#097479",
  63. "edited": false
  64. },
  65. "page-backgroundColor": {
  66. "value": "#111111",
  67. "edited": false
  68. },
  69. "page-sidebar-backgroundColor": {
  70. "value": "#333333",
  71. "edited": false
  72. },
  73. "group-textColor": {
  74. "value": "#0eb8c0",
  75. "edited": false
  76. },
  77. "group-borderColor": {
  78. "value": "#555555",
  79. "edited": false
  80. },
  81. "group-backgroundColor": {
  82. "value": "#333333",
  83. "edited": false
  84. },
  85. "widget-textColor": {
  86. "value": "#eeeeee",
  87. "edited": false
  88. },
  89. "widget-backgroundColor": {
  90. "value": "#097479",
  91. "edited": false
  92. },
  93. "widget-borderColor": {
  94. "value": "#333333",
  95. "edited": false
  96. },
  97. "base-font": {
  98. "value": "-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Oxygen-Sans,Ubuntu,Cantarell,Helvetica Neue,sans-serif"
  99. }
  100. },
  101. "angularTheme": {
  102. "primary": "indigo",
  103. "accents": "blue",
  104. "warn": "red",
  105. "background": "grey",
  106. "palette": "light"
  107. }
  108. },
  109. "site": {
  110. "name": "Siegfried Dorn",
  111. "hideToolbar": "false",
  112. "allowSwipe": "false",
  113. "lockMenu": "true",
  114. "allowTempTheme": "none",
  115. "dateFormat": "DD.MM.YYYY",
  116. "sizes": {
  117. "sx": 48,
  118. "sy": 48,
  119. "gx": 6,
  120. "gy": 6,
  121. "cx": 6,
  122. "cy": 6,
  123. "px": 0,
  124. "py": 0
  125. }
  126. }
  127. },
  128. {
  129. "id": "124aa983647c8074",
  130. "type": "ui_tab",
  131. "name": "Tab 1",
  132. "icon": "dashboard",
  133. "order": 1
  134. },
  135. {
  136. "id": "a756759c113266b5",
  137. "type": "ui_group",
  138. "name": "Group 1",
  139. "tab": "124aa983647c8074",
  140. "order": 1,
  141. "disp": true,
  142. "width": "4",
  143. "collapse": true,
  144. "className": ""
  145. },
  146. {
  147. "id": "8dba3ccfebb75b33",
  148. "type": "ui_group",
  149. "name": "Windrichtung",
  150. "tab": "124aa983647c8074",
  151. "order": 3,
  152. "disp": true,
  153. "width": "5",
  154. "collapse": false,
  155. "className": ""
  156. },
  157. {
  158. "id": "738d12f3ae8a61a3",
  159. "type": "mqtt-broker",
  160. "name": "MQ Broker SDOIT",
  161. "broker": "mqtt.sdoit.de",
  162. "port": "8883",
  163. "tls": "182ecf262e314f5c",
  164. "clientid": "",
  165. "usetls": true,
  166. "protocolVersion": "4",
  167. "keepalive": "60",
  168. "cleansession": true,
  169. "birthTopic": "",
  170. "birthQos": "0",
  171. "birthPayload": "",
  172. "birthMsg": {},
  173. "closeTopic": "",
  174. "closeQos": "0",
  175. "closePayload": "",
  176. "closeMsg": {},
  177. "willTopic": "",
  178. "willQos": "0",
  179. "willPayload": "",
  180. "willMsg": {},
  181. "sessionExpiry": ""
  182. },
  183. {
  184. "id": "182ecf262e314f5c",
  185. "type": "tls-config",
  186. "name": "sdoit",
  187. "cert": "",
  188. "key": "",
  189. "ca": "",
  190. "certname": "",
  191. "keyname": "",
  192. "caname": "",
  193. "servername": "mqtt.sdoit.de",
  194. "verifyservercert": true,
  195. "alpnprotocol": ""
  196. },
  197. {
  198. "id": "ba6fd973118b950c",
  199. "type": "ui_tab",
  200. "name": "Tab 3",
  201. "icon": "dashboard",
  202. "order": 3
  203. },
  204. {
  205. "id": "3710f59d209e7cc2",
  206. "type": "ui_group",
  207. "name": "Barometer",
  208. "tab": "124aa983647c8074",
  209. "order": 2,
  210. "disp": true,
  211. "width": "5",
  212. "collapse": false,
  213. "className": ""
  214. },
  215. {
  216. "id": "b7d12b8d.651c8",
  217. "type": "ui_group",
  218. "name": "Default",
  219. "tab": "fe5d396a.0d6d4",
  220. "order": 1,
  221. "disp": true,
  222. "width": "20",
  223. "collapse": false
  224. },
  225. {
  226. "id": "fe5d396a.0d6d4",
  227. "type": "ui_tab",
  228. "name": "Home",
  229. "icon": "dashboard",
  230. "disabled": false,
  231. "hidden": false
  232. },
  233. {
  234. "id": "1db5a64de6fc2d9e",
  235. "type": "MySQLdatabase",
  236. "name": "Weather DB",
  237. "host": "db",
  238. "port": "3306",
  239. "db": "node-red",
  240. "tz": "",
  241. "charset": "UTF8"
  242. },
  243. {
  244. "id": "6cb911a340dd0ff5",
  245. "type": "inject",
  246. "z": "f2fa6dd5ecc6fee9",
  247. "name": "",
  248. "props": [
  249. {
  250. "p": "payload"
  251. },
  252. {
  253. "p": "topic",
  254. "vt": "str"
  255. }
  256. ],
  257. "repeat": "300",
  258. "crontab": "",
  259. "once": true,
  260. "onceDelay": 0.1,
  261. "topic": "test",
  262. "payloadType": "date",
  263. "x": 140,
  264. "y": 300,
  265. "wires": [
  266. [
  267. "dceaa64cdf99920b",
  268. "e7fa67bc4dae509c"
  269. ]
  270. ]
  271. },
  272. {
  273. "id": "f770a584f4cb34b3",
  274. "type": "debug",
  275. "z": "f2fa6dd5ecc6fee9",
  276. "name": "Openweather",
  277. "active": false,
  278. "tosidebar": true,
  279. "console": false,
  280. "tostatus": false,
  281. "complete": "payload",
  282. "targetType": "msg",
  283. "statusVal": "",
  284. "statusType": "auto",
  285. "x": 740,
  286. "y": 220,
  287. "wires": []
  288. },
  289. {
  290. "id": "220fb7d74b77d77c",
  291. "type": "json",
  292. "z": "f2fa6dd5ecc6fee9",
  293. "name": "",
  294. "property": "payload",
  295. "action": "obj",
  296. "pretty": false,
  297. "x": 620,
  298. "y": 300,
  299. "wires": [
  300. [
  301. "f770a584f4cb34b3",
  302. "e41d26526985556b"
  303. ]
  304. ]
  305. },
  306. {
  307. "id": "dceaa64cdf99920b",
  308. "type": "openweathermap",
  309. "z": "f2fa6dd5ecc6fee9",
  310. "name": "Openweathermap",
  311. "wtype": "current",
  312. "lon": "",
  313. "lat": "",
  314. "city": "Frankfurt",
  315. "country": "Germany",
  316. "language": "de",
  317. "x": 350,
  318. "y": 300,
  319. "wires": [
  320. [
  321. "220fb7d74b77d77c"
  322. ]
  323. ]
  324. },
  325. {
  326. "id": "e41d26526985556b",
  327. "type": "link out",
  328. "z": "f2fa6dd5ecc6fee9",
  329. "name": "weather",
  330. "links": [
  331. "baeb6a5a161373bf",
  332. "7fbd6896a5bc5ed3",
  333. "73f47758e35544c8",
  334. "97822532c623d138",
  335. "5cc92a265ea6197c"
  336. ],
  337. "x": 1315,
  338. "y": 300,
  339. "wires": []
  340. },
  341. {
  342. "id": "73f47758e35544c8",
  343. "type": "link in",
  344. "z": "d354ea3adc51a23c",
  345. "name": "",
  346. "links": [
  347. "e41d26526985556b"
  348. ],
  349. "x": 195,
  350. "y": 100,
  351. "wires": [
  352. [
  353. "0d1d3701ba08c47f",
  354. "4ee5519b4ee22fbf"
  355. ]
  356. ]
  357. },
  358. {
  359. "id": "0d1d3701ba08c47f",
  360. "type": "mqtt out",
  361. "z": "d354ea3adc51a23c",
  362. "name": "raspi/weather",
  363. "topic": "raspi/weather",
  364. "qos": "0",
  365. "retain": "",
  366. "respTopic": "",
  367. "contentType": "",
  368. "userProps": "",
  369. "correl": "",
  370. "expiry": "",
  371. "broker": "738d12f3ae8a61a3",
  372. "x": 430,
  373. "y": 100,
  374. "wires": []
  375. },
  376. {
  377. "id": "4ee5519b4ee22fbf",
  378. "type": "debug",
  379. "z": "d354ea3adc51a23c",
  380. "name": "To weather",
  381. "active": false,
  382. "tosidebar": true,
  383. "console": false,
  384. "tostatus": false,
  385. "complete": "payload",
  386. "targetType": "msg",
  387. "statusVal": "",
  388. "statusType": "auto",
  389. "x": 430,
  390. "y": 160,
  391. "wires": []
  392. },
  393. {
  394. "id": "ec902514be1514bb",
  395. "type": "status",
  396. "z": "f2fa6dd5ecc6fee9",
  397. "name": "Status",
  398. "scope": [
  399. "f770a584f4cb34b3",
  400. "e7fa67bc4dae509c",
  401. "50100e920347df93"
  402. ],
  403. "x": 170,
  404. "y": 60,
  405. "wires": [
  406. [
  407. "58bf8caa2d948bba"
  408. ]
  409. ]
  410. },
  411. {
  412. "id": "58bf8caa2d948bba",
  413. "type": "debug",
  414. "z": "f2fa6dd5ecc6fee9",
  415. "name": "dbg Status",
  416. "active": false,
  417. "tosidebar": true,
  418. "console": false,
  419. "tostatus": false,
  420. "complete": "payload",
  421. "targetType": "msg",
  422. "statusVal": "",
  423. "statusType": "auto",
  424. "x": 370,
  425. "y": 60,
  426. "wires": []
  427. },
  428. {
  429. "id": "b6c4bf611cacfb7e",
  430. "type": "catch",
  431. "z": "f2fa6dd5ecc6fee9",
  432. "name": "",
  433. "scope": [
  434. "41295103e3127e87",
  435. "5889653a74b5faef"
  436. ],
  437. "uncaught": false,
  438. "x": 180,
  439. "y": 680,
  440. "wires": [
  441. [
  442. "50100e920347df93"
  443. ]
  444. ]
  445. },
  446. {
  447. "id": "50100e920347df93",
  448. "type": "debug",
  449. "z": "f2fa6dd5ecc6fee9",
  450. "name": "",
  451. "active": false,
  452. "tosidebar": true,
  453. "console": true,
  454. "tostatus": true,
  455. "complete": "true",
  456. "targetType": "full",
  457. "statusVal": "payload",
  458. "statusType": "auto",
  459. "x": 410,
  460. "y": 680,
  461. "wires": []
  462. },
  463. {
  464. "id": "9f0d5da7b921bfc4",
  465. "type": "ui_template",
  466. "z": "c5f6844437dd47a5",
  467. "group": "3710f59d209e7cc2",
  468. "name": "Barometer",
  469. "order": 1,
  470. "width": "5",
  471. "height": "5",
  472. "format": "<script src=\"/tween-min.js\"></script>\n<script src=\"/steelseries-min.js\"></script>\n<script>\nvar radial4;\n\n\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.payload.pressure) != \"undefined\") radial4.setValueAnimated(msg.payload.pressure);\n //if (typeof(msg.payload.temp_maxc) != \"undefined\") radial4.setMaxMeasuredValue(msg.payload.temp_maxc);\n //if (typeof(msg.payload.temp_minc) != \"undefined\") radial4.setMinMeasuredValue(msg.payload.temp_minc);\n //if (typeof(msg.threshold) != \"undefined\") radial4.setThreshold(msg.threshold);\n //if (typeof(msg.odo) != \"undefined\")radial4.setOdoValue(msg.odo); \n //if (typeof(msg.userLed) != \"undefined\") radial4.setUserLedOnOff(msg.userLed); \n //if (typeof(msg.trend) != \"undefined\")\n //{\n // if (msg.trend==1) radial4.setTrend(steelseries.TrendState.UP);\n // if (msg.trend==0) radial4.setTrend(steelseries.TrendState.STEADY);\n // if (msg.trend==-1) radial4.setTrend(steelseries.TrendState.DOWN);\n // if (msg.trend==-2) radial4.setTrend(steelseries.TrendState.OFF);\n //}\n });\n })(scope);\n\n var sections = [steelseries.Section(960, 990, 'rgba(0, 0, 220, 0.3)'),\n steelseries.Section(990, 1030, 'rgba(0, 220, 0, 0.3)'),\n steelseries.Section(1030, 1060, 'rgba(220, 220, 0, 0.3)') ],\n\n // Define one area\n //areas = [steelseries.Section(25, 50, 'rgba(220, 0, 0, 0.3)')],\n\n radial4 = new steelseries.Radial('canvasRadial4', {\n gaugeType: steelseries.GaugeType.TYPE4,\n minValue: 960,\n maxValue: 1060,\n size: 200,\n section: sections,\n // area: areas,\n titleString: \"Barometer\",\n unitString: \"h Pa\",\n //threshold: 25,\n //thresholdRising: false,\n //userLedVisible: false,\n useOdometer: false,\n lcdVisible: true,\n trendVisible: false,\n minMeasuredValueVisible: false,\n maxMeasuredValueVisible: false\n });\n \n radial4.setFrameDesign(steelseries.FrameDesign.BLACK_METAL);\n radial4.setValueAnimated(0);\n //radial4.setThreshold(50);\n //radial4.blinkUserLed(0);\n //radial4.setOdoValue(0);\n \n\n</script>\n\n<canvas id=\"canvasRadial4\" width=\"300\" height=\"300\"></canvas>\n\n",
  473. "storeOutMessages": true,
  474. "fwdInMessages": true,
  475. "resendOnRefresh": true,
  476. "templateScope": "local",
  477. "className": "",
  478. "x": 550,
  479. "y": 220,
  480. "wires": [
  481. []
  482. ]
  483. },
  484. {
  485. "id": "97822532c623d138",
  486. "type": "link in",
  487. "z": "c5f6844437dd47a5",
  488. "name": "",
  489. "links": [
  490. "e41d26526985556b"
  491. ],
  492. "x": 155,
  493. "y": 240,
  494. "wires": [
  495. [
  496. "9f0d5da7b921bfc4",
  497. "108158c72ae58d7d",
  498. "4eb9904b0bad1dd4",
  499. "b8b31f2d3c802145",
  500. "e178ebc7cdfb3341",
  501. "e7818ae4907668b2"
  502. ]
  503. ]
  504. },
  505. {
  506. "id": "108158c72ae58d7d",
  507. "type": "ui_text",
  508. "z": "c5f6844437dd47a5",
  509. "group": "a756759c113266b5",
  510. "order": 1,
  511. "width": 0,
  512. "height": 0,
  513. "name": "",
  514. "label": "Aktuelle Temperatur [°C] :",
  515. "format": "{{msg.payload.tempc}}",
  516. "layout": "col-center",
  517. "className": "",
  518. "x": 590,
  519. "y": 180,
  520. "wires": []
  521. },
  522. {
  523. "id": "4eb9904b0bad1dd4",
  524. "type": "ui_template",
  525. "z": "c5f6844437dd47a5",
  526. "group": "8dba3ccfebb75b33",
  527. "name": "Winddir",
  528. "order": 1,
  529. "width": "5",
  530. "height": "7",
  531. "format": "<script src=\"/tween-min.js\"></script>\n<script src=\"/steelseries-min.js\"></script>\n<script src=\"/steeldefaults.js\"></script>\n<script>\nvar windir;\nvar display;\n\n (function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.payload.winddirection) != \"undefined\") windir.setValueAnimatedLatest(msg.payload.winddirection);\n if (typeof(msg.payload.wind_avg) != \"undefined\") windir.setValueAnimatedAverage(msg.payload.wind_avg);\n if (typeof(msg.payload.windspeed) != \"undefined\") display.setValue(msg.payload.windspeed);\n });\n })(scope);\n\n windir = new steelseries.WindDirection('windir', {\n size: 200,\n //fractionalScaleDecimals : 2,\n\t //minValue: 1,\n //maxValue: 359,\n\t\tlcdVisible: true,\n\t\tgaugeType: steelseries.GaugeType.TYPE4,\n\t\tframeDesign: def_frame_design,\n\t\tpointerTypeLatest: steelseries.PointerType.TYPE3,\n\t\tpointerTypeAvarage: steelseries.PointerType.TYPE3\n });\n \n display = new steelseries.DisplaySingle('display', {\n width: 200,\n height: 50,\n unitString: \"m/s\",\n unitStringVisibe: true,\n headerString: \"Speed [m/s]\",\n headerStringVisible: true\n });\n \n \n</script>\n<canvas id=\"windir\" width=\"200\" height=\"200\"></canvas>\n<canvas id=\"display\" width=\"200\" height=\"100\"></canvas>\n",
  532. "storeOutMessages": true,
  533. "fwdInMessages": true,
  534. "resendOnRefresh": true,
  535. "templateScope": "local",
  536. "className": "",
  537. "x": 540,
  538. "y": 300,
  539. "wires": [
  540. []
  541. ]
  542. },
  543. {
  544. "id": "b8b31f2d3c802145",
  545. "type": "ui_template",
  546. "z": "c5f6844437dd47a5",
  547. "group": "a756759c113266b5",
  548. "name": "Temperatur",
  549. "order": 2,
  550. "width": "0",
  551. "height": "0",
  552. "format": "<script src=\"/tween-min.js\"></script>\n<script src=\"/steelseries-min.js\"></script>\n<script src=\"/steeldefaults.js\"></script>\n<script>\nvar linear;\n\n(function(scope){ \n scope.$watch('msg', function(msg) {\n if (typeof(msg.payload.tempc) != \"undefined\") linear.setValueAnimated(msg.payload.tempc);\n });\n })(scope);\n\nlinear = new steelseries.LinearBargraph('linear',{\n frameDesign: def_frame_design,\n valueGradient: valGrad,\n useValueGradient: true,\n minValue: -30,\n maxValue: 50,\n unitString: \"°C\"\n });\n\n</script>\n<canvas id=\"linear\" width=\"200\" height=\"500\"></canvas>\n",
  553. "storeOutMessages": true,
  554. "fwdInMessages": true,
  555. "resendOnRefresh": true,
  556. "templateScope": "local",
  557. "className": "",
  558. "x": 550,
  559. "y": 260,
  560. "wires": [
  561. []
  562. ]
  563. },
  564. {
  565. "id": "fe102a7155a33faa",
  566. "type": "link out",
  567. "z": "f2fa6dd5ecc6fee9",
  568. "name": "DateTime",
  569. "links": [
  570. "ae331f1eb19e7b81",
  571. "b68a9a843348e1bf"
  572. ],
  573. "x": 555,
  574. "y": 460,
  575. "wires": []
  576. },
  577. {
  578. "id": "df19e2819075fb1a",
  579. "type": "ui_text",
  580. "z": "c5f6844437dd47a5",
  581. "group": "a756759c113266b5",
  582. "order": 1,
  583. "width": 0,
  584. "height": 0,
  585. "name": "",
  586. "label": "",
  587. "format": "<p align=center> {{msg.payload.date}} <br> {{msg.payload.time}} <p>",
  588. "layout": "col-center",
  589. "className": "",
  590. "x": 530,
  591. "y": 140,
  592. "wires": []
  593. },
  594. {
  595. "id": "ae331f1eb19e7b81",
  596. "type": "link in",
  597. "z": "c5f6844437dd47a5",
  598. "name": "",
  599. "links": [
  600. "fe102a7155a33faa"
  601. ],
  602. "x": 155,
  603. "y": 140,
  604. "wires": [
  605. [
  606. "df19e2819075fb1a"
  607. ]
  608. ]
  609. },
  610. {
  611. "id": "396b940d734ab05a",
  612. "type": "inject",
  613. "z": "f2fa6dd5ecc6fee9",
  614. "name": "",
  615. "props": [
  616. {
  617. "p": "payload"
  618. }
  619. ],
  620. "repeat": "",
  621. "crontab": "",
  622. "once": false,
  623. "onceDelay": 0.1,
  624. "topic": "",
  625. "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).\"}",
  626. "payloadType": "json",
  627. "x": 910,
  628. "y": 60,
  629. "wires": [
  630. [
  631. "e41d26526985556b"
  632. ]
  633. ]
  634. },
  635. {
  636. "id": "ebdc01b5a4bcfa93",
  637. "type": "ui_button",
  638. "z": "f2fa6dd5ecc6fee9",
  639. "name": "",
  640. "group": "a756759c113266b5",
  641. "order": 3,
  642. "width": 0,
  643. "height": 0,
  644. "passthru": false,
  645. "label": "Test",
  646. "tooltip": "",
  647. "color": "",
  648. "bgcolor": "",
  649. "className": "",
  650. "icon": "",
  651. "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).\"}",
  652. "payloadType": "json",
  653. "topic": "topic",
  654. "topicType": "msg",
  655. "x": 910,
  656. "y": 100,
  657. "wires": [
  658. [
  659. "e41d26526985556b"
  660. ]
  661. ]
  662. },
  663. {
  664. "id": "e178ebc7cdfb3341",
  665. "type": "function",
  666. "z": "c5f6844437dd47a5",
  667. "name": "",
  668. "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;",
  669. "outputs": 1,
  670. "noerr": 0,
  671. "initialize": "",
  672. "finalize": "",
  673. "libs": [],
  674. "x": 300,
  675. "y": 320,
  676. "wires": [
  677. [
  678. "722c05d553b5a3e0",
  679. "4eb9904b0bad1dd4"
  680. ]
  681. ]
  682. },
  683. {
  684. "id": "722c05d553b5a3e0",
  685. "type": "ui_template",
  686. "z": "c5f6844437dd47a5",
  687. "group": "b7d12b8d.651c8",
  688. "name": "",
  689. "order": 1,
  690. "width": 0,
  691. "height": 0,
  692. "format": "<style>\n.main\n{\nheight:500px;\n//background-color:lightblue;\n}\n</style>\n<div class=main ng-bind-html=\"msg.payload.wind_avg\"></div> \n<script>\n var msg = global.get(\"wind\");\n</script>\n <table>\n <tbody>\n <tr *ngFor=\"let p of msg\">\n <td>{{p.message}}</td>\n </tr>\n </tbody>\n </table>",
  693. "storeOutMessages": true,
  694. "fwdInMessages": true,
  695. "resendOnRefresh": true,
  696. "templateScope": "local",
  697. "className": "",
  698. "x": 540,
  699. "y": 340,
  700. "wires": [
  701. []
  702. ]
  703. },
  704. {
  705. "id": "5fc826242df12119",
  706. "type": "mysql",
  707. "z": "d354ea3adc51a23c",
  708. "mydb": "1db5a64de6fc2d9e",
  709. "name": "Database",
  710. "x": 420,
  711. "y": 240,
  712. "wires": [
  713. [
  714. "6f5ec86de53be60c"
  715. ]
  716. ]
  717. },
  718. {
  719. "id": "e7fa67bc4dae509c",
  720. "type": "function",
  721. "z": "f2fa6dd5ecc6fee9",
  722. "name": "F_Test",
  723. "func": "function formatDate(date) {\n var d = new Date(date),\n month = '' + (d.getMonth() + 1),\n day = '' + d.getDate(),\n year = d.getFullYear();\n\n if (month.length < 2) \n month = '0' + month;\n if (day.length < 2) \n day = '0' + day;\n\n return [year, month, day].join('-');\n}\n\nvar mymsg = msg.payload;\n\nvar time = new Date(mymsg).toLocaleTimeString(\"de-DE\");\n\nvar date = new Date(mymsg);\nvar f_date = formatDate(date);\n\nnode.status({fill:\"green\",shape:\"ring\",text:f_date + \" \" + time});\nnode.log(f_date+\" \"+time);\nmsg.payload = {date:f_date,time:time};\nmsg.topic = \"DateTime\";\nreturn msg;",
  724. "outputs": 1,
  725. "noerr": 0,
  726. "initialize": "",
  727. "finalize": "",
  728. "libs": [],
  729. "x": 370,
  730. "y": 400,
  731. "wires": [
  732. [
  733. "0a80d66a213a9bd0",
  734. "fe102a7155a33faa"
  735. ]
  736. ]
  737. },
  738. {
  739. "id": "0a80d66a213a9bd0",
  740. "type": "debug",
  741. "z": "f2fa6dd5ecc6fee9",
  742. "name": "",
  743. "active": false,
  744. "tosidebar": true,
  745. "console": false,
  746. "tostatus": true,
  747. "complete": "payload",
  748. "targetType": "msg",
  749. "statusVal": "payload",
  750. "statusType": "auto",
  751. "x": 610,
  752. "y": 380,
  753. "wires": []
  754. },
  755. {
  756. "id": "d03c76cf92669797",
  757. "type": "join",
  758. "z": "f2fa6dd5ecc6fee9",
  759. "name": "",
  760. "mode": "custom",
  761. "build": "merged",
  762. "property": "payload",
  763. "propertyType": "msg",
  764. "key": "topic",
  765. "joiner": "\\n",
  766. "joinerType": "str",
  767. "accumulate": true,
  768. "timeout": "",
  769. "count": "2",
  770. "reduceRight": false,
  771. "reduceExp": "",
  772. "reduceInit": "",
  773. "reduceInitType": "",
  774. "reduceFixup": "",
  775. "x": 870,
  776. "y": 460,
  777. "wires": [
  778. [
  779. "143a633ae8d40b1e"
  780. ]
  781. ]
  782. },
  783. {
  784. "id": "b68a9a843348e1bf",
  785. "type": "link in",
  786. "z": "f2fa6dd5ecc6fee9",
  787. "name": "",
  788. "links": [
  789. "fe102a7155a33faa"
  790. ],
  791. "x": 715,
  792. "y": 500,
  793. "wires": [
  794. [
  795. "d03c76cf92669797"
  796. ]
  797. ]
  798. },
  799. {
  800. "id": "5cc92a265ea6197c",
  801. "type": "link in",
  802. "z": "f2fa6dd5ecc6fee9",
  803. "name": "",
  804. "links": [
  805. "e41d26526985556b"
  806. ],
  807. "x": 715,
  808. "y": 440,
  809. "wires": [
  810. [
  811. "d03c76cf92669797"
  812. ]
  813. ]
  814. },
  815. {
  816. "id": "143a633ae8d40b1e",
  817. "type": "function",
  818. "z": "f2fa6dd5ecc6fee9",
  819. "name": "Create Insert SQL",
  820. "func": "var topic = \"INSERT INTO `node-red`.`Weather` ( \\\n`date` \\\n,`time` \\\n,`weather` \\\n,`detail` \\\n,`icon` \\\n,`tempk` \\\n,`tempc` \\\n,`temp_maxc` \\\n,`temp_minc` \\\n,`humidity` \\\n,`pressure` \\\n,`maxtemp` \\\n,`mintemp` \\\n,`windspeed` \\\n,`winddirection` \\\n,`location` \\\n,`sunrise` \\\n,`sunset` \\\n,`clouds` \\\n,`description`) \\\nVALUES ( \\\n:date \\\n,:time \\\n,:weather \\\n,:detail \\\n,:icon \\\n,:tempk \\\n,:tempc \\\n,:temp_maxc \\\n,:temp_minc \\\n,:humidity \\\n,:pressure \\\n,:maxtemp \\\n,:mintemp \\\n,:windspeed \\\n,:winddirection \\\n,:location \\\n,:sunrise \\\n,:sunset \\\n,:clouds \\\n,:description);\"\nmsg.topic = topic\nreturn msg;",
  821. "outputs": 1,
  822. "noerr": 0,
  823. "initialize": "",
  824. "finalize": "",
  825. "libs": [],
  826. "x": 1080,
  827. "y": 460,
  828. "wires": [
  829. [
  830. "18ce04e729380a08",
  831. "d153c5b44a8efd0f"
  832. ]
  833. ]
  834. },
  835. {
  836. "id": "18ce04e729380a08",
  837. "type": "debug",
  838. "z": "f2fa6dd5ecc6fee9",
  839. "name": "",
  840. "active": false,
  841. "tosidebar": true,
  842. "console": false,
  843. "tostatus": false,
  844. "complete": "true",
  845. "targetType": "full",
  846. "statusVal": "",
  847. "statusType": "auto",
  848. "x": 1250,
  849. "y": 380,
  850. "wires": []
  851. },
  852. {
  853. "id": "d153c5b44a8efd0f",
  854. "type": "link out",
  855. "z": "f2fa6dd5ecc6fee9",
  856. "name": "Insert SQL",
  857. "links": [
  858. "3bb68b7aeccf8f51"
  859. ],
  860. "x": 1315,
  861. "y": 460,
  862. "wires": []
  863. },
  864. {
  865. "id": "3bb68b7aeccf8f51",
  866. "type": "link in",
  867. "z": "d354ea3adc51a23c",
  868. "name": "",
  869. "links": [
  870. "d153c5b44a8efd0f",
  871. "d2cda8c31ac9faa4"
  872. ],
  873. "x": 185,
  874. "y": 240,
  875. "wires": [
  876. [
  877. "5fc826242df12119",
  878. "b8cb5c9b2d285f45"
  879. ]
  880. ]
  881. },
  882. {
  883. "id": "6f5ec86de53be60c",
  884. "type": "debug",
  885. "z": "d354ea3adc51a23c",
  886. "name": "",
  887. "active": true,
  888. "tosidebar": true,
  889. "console": false,
  890. "tostatus": false,
  891. "complete": "false",
  892. "statusVal": "",
  893. "statusType": "auto",
  894. "x": 700,
  895. "y": 240,
  896. "wires": []
  897. },
  898. {
  899. "id": "934584fe81169855",
  900. "type": "function",
  901. "z": "f2fa6dd5ecc6fee9",
  902. "name": "Select From DB",
  903. "func": "/*var topic = \"SELECT JSON_UNQUOTE (JSON_OBJECT ('id',id, 'date',date,'time',time,'tempc',tempc,'humidity',humidity,'pressure',pressure,'maxtemp',maxtemp,'mintemp',mintemp,'windspeed',windspeed,'winddirection',winddirection )) \\\n FROM Weather ORDER BY id DESC LIMIT 50;\"\n*/\nvar topic = \"SELECT * from Weather ORDER BY id DESC LIMIT 50;\"\nmsg.topic=topic;\nreturn msg;",
  904. "outputs": 1,
  905. "noerr": 0,
  906. "initialize": "",
  907. "finalize": "",
  908. "libs": [],
  909. "x": 900,
  910. "y": 580,
  911. "wires": [
  912. [
  913. "d2cda8c31ac9faa4"
  914. ]
  915. ]
  916. },
  917. {
  918. "id": "3b0f0afc5c00b5eb",
  919. "type": "inject",
  920. "z": "f2fa6dd5ecc6fee9",
  921. "name": "",
  922. "props": [
  923. {
  924. "p": "payload"
  925. },
  926. {
  927. "p": "topic",
  928. "vt": "str"
  929. }
  930. ],
  931. "repeat": "",
  932. "crontab": "",
  933. "once": true,
  934. "onceDelay": "10",
  935. "topic": "",
  936. "payloadType": "date",
  937. "x": 680,
  938. "y": 580,
  939. "wires": [
  940. [
  941. "934584fe81169855"
  942. ]
  943. ]
  944. },
  945. {
  946. "id": "d2cda8c31ac9faa4",
  947. "type": "link out",
  948. "z": "f2fa6dd5ecc6fee9",
  949. "name": "SELECT",
  950. "links": [
  951. "3bb68b7aeccf8f51"
  952. ],
  953. "x": 1245,
  954. "y": 580,
  955. "wires": []
  956. },
  957. {
  958. "id": "b8cb5c9b2d285f45",
  959. "type": "debug",
  960. "z": "d354ea3adc51a23c",
  961. "name": "Select Request",
  962. "active": true,
  963. "tosidebar": true,
  964. "console": false,
  965. "tostatus": false,
  966. "complete": "true",
  967. "targetType": "full",
  968. "statusVal": "",
  969. "statusType": "auto",
  970. "x": 490,
  971. "y": 360,
  972. "wires": []
  973. },
  974. {
  975. "id": "491fa31d350138cd",
  976. "type": "ui_chart",
  977. "z": "c5f6844437dd47a5",
  978. "name": "",
  979. "group": "b7d12b8d.651c8",
  980. "order": 1,
  981. "width": "20",
  982. "height": "7",
  983. "label": "chart",
  984. "chartType": "line",
  985. "legend": "true",
  986. "xformat": "HH:mm:ss",
  987. "interpolate": "linear",
  988. "nodata": "",
  989. "dot": false,
  990. "ymin": "",
  991. "ymax": "",
  992. "removeOlder": 1,
  993. "removeOlderPoints": "",
  994. "removeOlderUnit": "86400",
  995. "cutout": 0,
  996. "useOneColor": false,
  997. "useUTC": false,
  998. "colors": [
  999. "#1f77b4",
  1000. "#aec7e8",
  1001. "#ff7f0e",
  1002. "#2ca02c",
  1003. "#98df8a",
  1004. "#d62728",
  1005. "#ff9896",
  1006. "#9467bd",
  1007. "#c5b0d5"
  1008. ],
  1009. "outputs": 1,
  1010. "useDifferentColor": false,
  1011. "className": "",
  1012. "x": 530,
  1013. "y": 380,
  1014. "wires": [
  1015. []
  1016. ]
  1017. },
  1018. {
  1019. "id": "e7818ae4907668b2",
  1020. "type": "function",
  1021. "z": "c5f6844437dd47a5",
  1022. "name": "",
  1023. "func": "var payload = msg.payload.tempc;\nmsg.payload = payload;\nreturn msg;",
  1024. "outputs": 1,
  1025. "noerr": 0,
  1026. "initialize": "",
  1027. "finalize": "",
  1028. "libs": [],
  1029. "x": 300,
  1030. "y": 380,
  1031. "wires": [
  1032. [
  1033. "491fa31d350138cd"
  1034. ]
  1035. ]
  1036. }
  1037. ]