NodeRED_flow.json 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  1. [
  2. {
  3. "id": "49762a14.53df54",
  4. "type": "tab",
  5. "label": "S0Meters",
  6. "disabled": false,
  7. "info": ""
  8. },
  9. {
  10. "id": "231ba654.08ce1a",
  11. "type": "ui_text_input",
  12. "z": "49762a14.53df54",
  13. "name": "",
  14. "label": "set new reading",
  15. "group": "5cdd7758.149278",
  16. "order": 2,
  17. "width": 0,
  18. "height": 0,
  19. "passthru": false,
  20. "mode": "text",
  21. "delay": "300",
  22. "topic": "",
  23. "x": 540,
  24. "y": 140,
  25. "wires": [
  26. [
  27. "4a109952.f06e48"
  28. ]
  29. ]
  30. },
  31. {
  32. "id": "1ca1176d.d5c471",
  33. "type": "ui_text",
  34. "z": "49762a14.53df54",
  35. "group": "5cdd7758.149278",
  36. "order": 1,
  37. "width": 0,
  38. "height": 0,
  39. "name": "",
  40. "label": "current reading",
  41. "format": "{{msg.payload}}",
  42. "layout": "row-spread",
  43. "x": 540,
  44. "y": 100,
  45. "wires": []
  46. },
  47. {
  48. "id": "74e1dc04.2d60a4",
  49. "type": "mqtt in",
  50. "z": "49762a14.53df54",
  51. "name": "",
  52. "topic": "T5/Zaehler/Strom/reading",
  53. "qos": "2",
  54. "datatype": "auto",
  55. "broker": "594053fb.ec274c",
  56. "x": 300,
  57. "y": 100,
  58. "wires": [
  59. [
  60. "1ca1176d.d5c471"
  61. ]
  62. ]
  63. },
  64. {
  65. "id": "4a109952.f06e48",
  66. "type": "function",
  67. "z": "49762a14.53df54",
  68. "name": "",
  69. "func": "flow.set(\"stromz_newReading\", msg.payload, \"memoryOnly\");\nreturn msg;",
  70. "outputs": 1,
  71. "noerr": 0,
  72. "initialize": "",
  73. "finalize": "",
  74. "x": 760,
  75. "y": 140,
  76. "wires": [
  77. [
  78. "6aa2d3.79145d2c"
  79. ]
  80. ]
  81. },
  82. {
  83. "id": "6aa2d3.79145d2c",
  84. "type": "debug",
  85. "z": "49762a14.53df54",
  86. "name": "",
  87. "active": false,
  88. "tosidebar": true,
  89. "console": false,
  90. "tostatus": false,
  91. "complete": "false",
  92. "statusVal": "",
  93. "statusType": "auto",
  94. "x": 970,
  95. "y": 140,
  96. "wires": []
  97. },
  98. {
  99. "id": "7e3160e.661e0a",
  100. "type": "ui_button",
  101. "z": "49762a14.53df54",
  102. "name": "",
  103. "group": "5cdd7758.149278",
  104. "order": 3,
  105. "width": 0,
  106. "height": 0,
  107. "passthru": false,
  108. "label": "WRITE TO HARDWARE",
  109. "tooltip": "",
  110. "color": "",
  111. "bgcolor": "",
  112. "icon": "",
  113. "payload": "",
  114. "payloadType": "str",
  115. "topic": "",
  116. "x": 570,
  117. "y": 180,
  118. "wires": [
  119. [
  120. "98434a49.bbb93",
  121. "7eff858e.4161b4"
  122. ]
  123. ]
  124. },
  125. {
  126. "id": "98434a49.bbb93",
  127. "type": "function",
  128. "z": "49762a14.53df54",
  129. "name": "",
  130. "func": "newReading = flow.get(\"stromz_newReading\", \"memoryOnly\")||undefined;\nif (newReading !== undefined && !isNaN(newReading)) {\n newReading = parseFloat(newReading).toFixed(3);\n msg.payload = \"set reading c1 \" + newReading;\n return msg;\n}",
  131. "outputs": 1,
  132. "noerr": 0,
  133. "initialize": "",
  134. "finalize": "",
  135. "x": 760,
  136. "y": 180,
  137. "wires": [
  138. [
  139. "88f97e0e.83b77",
  140. "6a2c0078.8cc4e8"
  141. ]
  142. ]
  143. },
  144. {
  145. "id": "88f97e0e.83b77",
  146. "type": "debug",
  147. "z": "49762a14.53df54",
  148. "name": "",
  149. "active": false,
  150. "tosidebar": true,
  151. "console": false,
  152. "tostatus": false,
  153. "complete": "false",
  154. "statusVal": "",
  155. "statusType": "auto",
  156. "x": 970,
  157. "y": 180,
  158. "wires": []
  159. },
  160. {
  161. "id": "1d4a3586.9f37f2",
  162. "type": "ui_text_input",
  163. "z": "49762a14.53df54",
  164. "name": "",
  165. "label": "set new reading",
  166. "tooltip": "",
  167. "group": "2edae4eb.ff06bc",
  168. "order": 2,
  169. "width": 0,
  170. "height": 0,
  171. "passthru": false,
  172. "mode": "text",
  173. "delay": "300",
  174. "topic": "",
  175. "x": 540,
  176. "y": 320,
  177. "wires": [
  178. [
  179. "b8760526.dcc028"
  180. ]
  181. ]
  182. },
  183. {
  184. "id": "a298d89b.0734b",
  185. "type": "ui_text",
  186. "z": "49762a14.53df54",
  187. "group": "2edae4eb.ff06bc",
  188. "order": 1,
  189. "width": 0,
  190. "height": 0,
  191. "name": "",
  192. "label": "current reading",
  193. "format": "{{msg.payload}}",
  194. "layout": "row-spread",
  195. "x": 540,
  196. "y": 280,
  197. "wires": []
  198. },
  199. {
  200. "id": "49d5ee8f.e41a48",
  201. "type": "mqtt in",
  202. "z": "49762a14.53df54",
  203. "name": "",
  204. "topic": "T5/Zaehler/Gas/reading",
  205. "qos": "2",
  206. "datatype": "auto",
  207. "broker": "594053fb.ec274c",
  208. "x": 290,
  209. "y": 280,
  210. "wires": [
  211. [
  212. "a298d89b.0734b"
  213. ]
  214. ]
  215. },
  216. {
  217. "id": "b8760526.dcc028",
  218. "type": "function",
  219. "z": "49762a14.53df54",
  220. "name": "",
  221. "func": "flow.set(\"gasz_newReading\", msg.payload, \"memoryOnly\");\nreturn msg;",
  222. "outputs": 1,
  223. "noerr": 0,
  224. "initialize": "",
  225. "finalize": "",
  226. "x": 760,
  227. "y": 320,
  228. "wires": [
  229. [
  230. "9733c14a.9ce9e8"
  231. ]
  232. ]
  233. },
  234. {
  235. "id": "9733c14a.9ce9e8",
  236. "type": "debug",
  237. "z": "49762a14.53df54",
  238. "name": "",
  239. "active": false,
  240. "tosidebar": true,
  241. "console": false,
  242. "tostatus": false,
  243. "complete": "false",
  244. "statusVal": "",
  245. "statusType": "auto",
  246. "x": 970,
  247. "y": 320,
  248. "wires": []
  249. },
  250. {
  251. "id": "8e6da1ad.d04a3",
  252. "type": "ui_button",
  253. "z": "49762a14.53df54",
  254. "name": "",
  255. "group": "2edae4eb.ff06bc",
  256. "order": 3,
  257. "width": 0,
  258. "height": 0,
  259. "passthru": false,
  260. "label": "WRITE TO HARDWARE",
  261. "tooltip": "",
  262. "color": "",
  263. "bgcolor": "",
  264. "icon": "",
  265. "payload": "",
  266. "payloadType": "str",
  267. "topic": "",
  268. "x": 570,
  269. "y": 360,
  270. "wires": [
  271. [
  272. "4da8d6f3.5d40c",
  273. "a8906b04.8cd618"
  274. ]
  275. ]
  276. },
  277. {
  278. "id": "4da8d6f3.5d40c",
  279. "type": "function",
  280. "z": "49762a14.53df54",
  281. "name": "",
  282. "func": "newReading = flow.get(\"gasz_newReading\", \"memoryOnly\")||undefined;\nif (newReading !== undefined && !isNaN(newReading)) {\n newReading = parseFloat(newReading).toFixed(2);\n msg.payload = \"set reading c2 \" + newReading;\n return msg;\n}",
  283. "outputs": 1,
  284. "noerr": 0,
  285. "initialize": "",
  286. "finalize": "",
  287. "x": 760,
  288. "y": 360,
  289. "wires": [
  290. [
  291. "88add0c1.5051a",
  292. "6a2c0078.8cc4e8"
  293. ]
  294. ]
  295. },
  296. {
  297. "id": "88add0c1.5051a",
  298. "type": "debug",
  299. "z": "49762a14.53df54",
  300. "name": "",
  301. "active": false,
  302. "tosidebar": true,
  303. "console": false,
  304. "tostatus": false,
  305. "complete": "false",
  306. "statusVal": "",
  307. "statusType": "auto",
  308. "x": 970,
  309. "y": 360,
  310. "wires": []
  311. },
  312. {
  313. "id": "87a202e7.90692",
  314. "type": "ui_button",
  315. "z": "49762a14.53df54",
  316. "name": "",
  317. "group": "934e6f58.6bd9e8",
  318. "order": 3,
  319. "width": 0,
  320. "height": 0,
  321. "passthru": false,
  322. "label": "get readings",
  323. "tooltip": "",
  324. "color": "",
  325. "bgcolor": "",
  326. "icon": "",
  327. "payload": "",
  328. "payloadType": "str",
  329. "topic": "",
  330. "x": 530,
  331. "y": 460,
  332. "wires": [
  333. [
  334. "ef18d5b.2d45ea8"
  335. ]
  336. ]
  337. },
  338. {
  339. "id": "ef18d5b.2d45ea8",
  340. "type": "function",
  341. "z": "49762a14.53df54",
  342. "name": "",
  343. "func": "msg.payload = \"get readings\";\nreturn msg;\n",
  344. "outputs": 1,
  345. "noerr": 0,
  346. "initialize": "",
  347. "finalize": "",
  348. "x": 760,
  349. "y": 460,
  350. "wires": [
  351. [
  352. "6a2c0078.8cc4e8"
  353. ]
  354. ]
  355. },
  356. {
  357. "id": "6a2c0078.8cc4e8",
  358. "type": "mqtt out",
  359. "z": "49762a14.53df54",
  360. "name": "",
  361. "topic": "Top5/ImpCount/cmd",
  362. "qos": "",
  363. "retain": "",
  364. "broker": "594053fb.ec274c",
  365. "x": 1170,
  366. "y": 440,
  367. "wires": []
  368. },
  369. {
  370. "id": "a8906b04.8cd618",
  371. "type": "function",
  372. "z": "49762a14.53df54",
  373. "name": "clear",
  374. "func": "msg.payload=\"\";\nreturn msg;",
  375. "outputs": 1,
  376. "noerr": 0,
  377. "initialize": "",
  378. "finalize": "",
  379. "x": 610,
  380. "y": 400,
  381. "wires": [
  382. [
  383. "1d4a3586.9f37f2"
  384. ]
  385. ]
  386. },
  387. {
  388. "id": "7eff858e.4161b4",
  389. "type": "function",
  390. "z": "49762a14.53df54",
  391. "name": "clear",
  392. "func": "msg.payload=\"\";\nreturn msg;",
  393. "outputs": 1,
  394. "noerr": 0,
  395. "initialize": "",
  396. "finalize": "",
  397. "x": 610,
  398. "y": 220,
  399. "wires": [
  400. [
  401. "231ba654.08ce1a"
  402. ]
  403. ]
  404. },
  405. {
  406. "id": "c3d72895.bfc2",
  407. "type": "ui_button",
  408. "z": "49762a14.53df54",
  409. "name": "",
  410. "group": "2edae4eb.ff06bc",
  411. "order": 3,
  412. "width": 0,
  413. "height": 0,
  414. "passthru": false,
  415. "label": "CANCEL",
  416. "tooltip": "",
  417. "color": "",
  418. "bgcolor": "",
  419. "icon": "",
  420. "payload": "",
  421. "payloadType": "str",
  422. "topic": "",
  423. "x": 460,
  424. "y": 400,
  425. "wires": [
  426. [
  427. "a8906b04.8cd618"
  428. ]
  429. ]
  430. },
  431. {
  432. "id": "a366ae9a.534ec8",
  433. "type": "ui_button",
  434. "z": "49762a14.53df54",
  435. "name": "",
  436. "group": "5cdd7758.149278",
  437. "order": 3,
  438. "width": 0,
  439. "height": 0,
  440. "passthru": false,
  441. "label": "CANCEL",
  442. "tooltip": "",
  443. "color": "",
  444. "bgcolor": "",
  445. "icon": "",
  446. "payload": "",
  447. "payloadType": "str",
  448. "topic": "",
  449. "x": 460,
  450. "y": 220,
  451. "wires": [
  452. [
  453. "7eff858e.4161b4"
  454. ]
  455. ]
  456. },
  457. {
  458. "id": "caee5194.1dd538",
  459. "type": "ui_button",
  460. "z": "49762a14.53df54",
  461. "name": "",
  462. "group": "934e6f58.6bd9e8",
  463. "order": 3,
  464. "width": 0,
  465. "height": 0,
  466. "passthru": false,
  467. "label": "get counters config",
  468. "tooltip": "",
  469. "color": "",
  470. "bgcolor": "",
  471. "icon": "",
  472. "payload": "",
  473. "payloadType": "str",
  474. "topic": "",
  475. "x": 550,
  476. "y": 520,
  477. "wires": [
  478. [
  479. "d89d0bb6.ac3428"
  480. ]
  481. ]
  482. },
  483. {
  484. "id": "d89d0bb6.ac3428",
  485. "type": "function",
  486. "z": "49762a14.53df54",
  487. "name": "",
  488. "func": "msg.payload = \"get conf\";\nreturn msg;\n",
  489. "outputs": 1,
  490. "noerr": 0,
  491. "initialize": "",
  492. "finalize": "",
  493. "x": 760,
  494. "y": 520,
  495. "wires": [
  496. [
  497. "6a2c0078.8cc4e8"
  498. ]
  499. ]
  500. },
  501. {
  502. "id": "c8dafb7.0a5c988",
  503. "type": "mqtt in",
  504. "z": "49762a14.53df54",
  505. "name": "",
  506. "topic": "Top5/ImpCount/stat",
  507. "qos": "2",
  508. "datatype": "auto",
  509. "broker": "594053fb.ec274c",
  510. "x": 290,
  511. "y": 600,
  512. "wires": [
  513. [
  514. "badc2da1.db2fc8"
  515. ]
  516. ]
  517. },
  518. {
  519. "id": "badc2da1.db2fc8",
  520. "type": "function",
  521. "z": "49762a14.53df54",
  522. "name": "",
  523. "func": "var tmpstr;\nvar hasData = false;\n\nvar paramsarray;\nvar params;\nvar nameValue;\n\nvar data = {};\n\nif(msg.payload.startsWith('CONF GLOB: ')) {\n //CONF GLOB: debuglevel=0, debounce=10, debRecov=70, pwrGood=500\n tmpstr = msg.payload.replace('CONF GLOB: ', '');\n data.glob = params;\n hasData = true;\n}\nelse if(msg.payload.startsWith('CONF C1: ')) {\n //CONF C1: impPerUnit=1000, noImpTout=60, saveInt=30\n tmpstr = msg.payload.replace('CONF C1: ', '');\n data.c1 = params;\n hasData = true;\n}\nelse if(msg.payload.startsWith('CONF C2: ')) {\n //CONF C2: impPerUnit=100, noImpTout=900, saveInt=60\n tmpstr = msg.payload.replace('CONF C2: ', '');\n data.c2 = params;\n hasData = true;\n}\n\nif (hasData) {\n tmpstr = tmpstr.replace(/ /g, '');\n paramsarray = tmpstr.split(',');\n params = {};\n for(i=0; i < paramsarray.length; i++) {\n nameValue = paramsarray[i].split('=');\n params[nameValue[0]] = nameValue[1];\n }\n msg.payload = params;\n return msg;\n}",
  524. "outputs": 1,
  525. "noerr": 0,
  526. "initialize": "",
  527. "finalize": "",
  528. "x": 520,
  529. "y": 600,
  530. "wires": [
  531. [
  532. "50095636.7885c8"
  533. ]
  534. ]
  535. },
  536. {
  537. "id": "50095636.7885c8",
  538. "type": "debug",
  539. "z": "49762a14.53df54",
  540. "name": "",
  541. "active": true,
  542. "tosidebar": true,
  543. "console": false,
  544. "tostatus": false,
  545. "complete": "false",
  546. "statusVal": "",
  547. "statusType": "auto",
  548. "x": 780,
  549. "y": 620,
  550. "wires": []
  551. },
  552. {
  553. "id": "5cdd7758.149278",
  554. "type": "ui_group",
  555. "name": "Stromzähler",
  556. "tab": "635047a7.d277a8",
  557. "order": 2,
  558. "disp": true,
  559. "width": "6",
  560. "collapse": false
  561. },
  562. {
  563. "id": "594053fb.ec274c",
  564. "type": "mqtt-broker",
  565. "name": "",
  566. "broker": "127.0.0.1",
  567. "port": "1883",
  568. "clientid": "",
  569. "usetls": false,
  570. "compatmode": true,
  571. "keepalive": "15",
  572. "cleansession": true,
  573. "birthTopic": "NodeRED/LWT",
  574. "birthQos": "1",
  575. "birthRetain": "true",
  576. "birthPayload": "Online",
  577. "closeTopic": "NodeRED/LWT",
  578. "closeQos": "1",
  579. "closeRetain": "true",
  580. "closePayload": "Offline",
  581. "willTopic": "NodeRED/LWT",
  582. "willQos": "0",
  583. "willRetain": "true",
  584. "willPayload": "Offline"
  585. },
  586. {
  587. "id": "2edae4eb.ff06bc",
  588. "type": "ui_group",
  589. "name": "Gaszähler",
  590. "tab": "635047a7.d277a8",
  591. "order": 3,
  592. "disp": true,
  593. "width": "6",
  594. "collapse": false
  595. },
  596. {
  597. "id": "934e6f58.6bd9e8",
  598. "type": "ui_group",
  599. "name": "Default",
  600. "tab": "635047a7.d277a8",
  601. "order": 1,
  602. "disp": true,
  603. "width": "6",
  604. "collapse": false
  605. },
  606. {
  607. "id": "635047a7.d277a8",
  608. "type": "ui_tab",
  609. "name": "StromGasZähler",
  610. "icon": "dashboard"
  611. }
  612. ]