Advertisement
smort

BCnode

May 23rd, 2019
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.53 KB | None | 0 0
  1. [
  2. {
  3. "id": "368c6b12.3ae6f4",
  4. "type": "tab",
  5. "label": "Brucontrol interface",
  6. "disabled": false,
  7. "info": ""
  8. },
  9. {
  10. "id": "c55602d6.eaeb",
  11. "type": "tcp out",
  12. "z": "368c6b12.3ae6f4",
  13. "host": "",
  14. "port": "",
  15. "beserver": "reply",
  16. "base64": false,
  17. "end": false,
  18. "name": "To BC",
  19. "x": 850,
  20. "y": 960,
  21. "wires": []
  22. },
  23. {
  24. "id": "184f78d8.bc7917",
  25. "type": "tcp in",
  26. "z": "368c6b12.3ae6f4",
  27. "name": "From BC",
  28. "server": "server",
  29. "host": "",
  30. "port": "5000",
  31. "datamode": "stream",
  32. "datatype": "utf8",
  33. "newline": "",
  34. "topic": "",
  35. "base64": false,
  36. "x": 60,
  37. "y": 980,
  38. "wires": [
  39. [
  40. "30344b49.8fc444",
  41. "bf63d504.758de8",
  42. "12fa773.1516589",
  43. "3d95c515.4187ba"
  44. ]
  45. ]
  46. },
  47. {
  48. "id": "5af4337b.ff644c",
  49. "type": "function",
  50. "z": "368c6b12.3ae6f4",
  51. "name": "Splitin5",
  52. "func": "\nvar str = msg.payload;\nvar firstslash = str.indexOf(\"/\");\nvar firstw = str.indexOf(\"?\"); //finds the first ?\nvar firstx = str.indexOf(\"!\"); //finds the first !\nvar nextx = str.indexOf(\"!\", firstw); //finds the first ! after ?\nvar end = str.lastIndexOf(\";\"); // finds the end\nvar slashpart;\nvar firstpart;\nvar middlepart;\nvar lastpart;\nvar msg1={};\nvar msg2 = {};\nvar msg3 = {};\nvar msg4 = {};\nvar msg5 = {};\nmsg1.topic = \"first\"\nmsg2.topic = \"middle\"\nmsg3.topic = \"last\"\nmsg4.topic = \"slash\"\nmsg5.topic = \"keepalive\"\n\nif (firstslash > -1 && firstx < 0 && firstw < 0 && nextx < 0) { // /;\n slashpart = str.slice(firstslash, end);\n msg1.payload = \"\";\n msg2.payload = \"\";\n msg3.payload = \"\";\n msg4.payload = String(slashpart);\n}\nif (firstslash > -1 && firstx > -1 && firstw < 0) { // /,!;\n slashpart = str.slice(firstslash, firstx);\n msg4.payload = String(slashpart);\n firstpart = str.slice(firstx, end);\n msg1.payload = String(firstpart);\n msg2.payload = \"\";\n msg3.payload = \"\";\n \n}\nif (firstslash > -1 && firstx < 0 && firstw > -1 && nextx < 0) { // /,?;\n slashpart = str.slice(firstslash, firstw);\n msg4.payload = String(slashpart);\n middlepart = str.slice(firstw, end);\n msg2.payload = String(middlepart);\n msg1.payload = \"\";\n msg3.payload = \"\";\n}\nif (firstslash > -1 && firstx > -1 && firstw > -1 && nextx < 0) { // /,!,?;\n slashpart = str.slice(firstslash, firstx);\n msg4.payload = String(slashpart);\n firstpart = str.slice(firstx, firstw);\n msg1.payload = String(firstpart);\n middlepart = str.slice(firstw, end);\n msg2.payload = String(middlepart);\n msg3.payload = \"\";\n}\nif (firstslash > -1 && firstx > -1 && firstw > -1 && nextx > -1) { // /,!,?,!;\n slashpart = str.slice(firstslash, firstx);\n msg4.payload = String(slashpart);\n firstpart = str.slice(firstx, firstw);\n msg1.payload = String(firstpart);\n middlepart = str.slice(firstw, nextx);\n msg2.payload = String(middlepart);\n lastpart = str.slice(nextx, end);\n msg3.payload = String(lastpart);\n}\nif (firstslash < 0 && firstx > -1 && firstw > -1 && nextx > -1) { // !,?,!;\n firstpart = str.slice(firstx, firstw);\n msg1.payload = String(firstpart);\n middlepart = str.slice(firstw, nextx);\n msg2.payload = String(middlepart);\n lastpart = str.slice(nextx, end);\n msg3.payload = String(lastpart);\n msg4.payload = \"\";\n}\nif (firstslash < 0 && firstx < 0 && firstw > -1 && nextx > -1) { // ?,!;\n middlepart = str.slice(firstw, nextx);\n msg2.payload = String(middlepart);\n lastpart = str.slice(nextx, end);\n msg3.payload = String(lastpart);\n msg1.payload = \"\";\n msg4.payload = \"\";\n}\nif (firstslash < 0 && firstx > -1 && firstw > -1 && nextx < 0) { // !,?;\n firstpart = str.slice(firstx, firstw);\n msg1.payload = String(firstpart);\n middlepart = str.slice(firstw, end);\n msg2.payload = String(middlepart);\n msg3.payload = \"\";\n msg4.payload = \"\";\n}\nif (firstslash < 0 && firstx > -1 && firstw < 0) { // !;\n firstpart = str.slice(firstx, end);\n msg1.payload = String(firstpart);\n msg2.payload = null;\n msg3.payload = \"\";\n msg4.payload = \"\";\n}\nif (firstslash < 0 && firstx < 0 && firstw > -1 && nextx < 0) { // ?;\n middlepart = str.slice(firstw, end);\n msg1.payload = \"\";\n msg4.payload = \"\";\n msg3.payload = \"\";\n msg2.payload = String(middlepart);\n}\nif (msg.payload == \"*;\") { //if keepalive communication\n msg5.payload = \"*\"; }\n else {\n msg5.payload = \"\";\n }\n \nreturn [msg1, msg2, msg3, msg4, msg5];\n\n\n\n\n\n",
  53. "outputs": 5,
  54. "noerr": 0,
  55. "x": 60,
  56. "y": 740,
  57. "wires": [
  58. [],
  59. [],
  60. [],
  61. [],
  62. []
  63. ]
  64. },
  65. {
  66. "id": "58408118.db1018",
  67. "type": "change",
  68. "z": "368c6b12.3ae6f4",
  69. "name": "200",
  70. "rules": [
  71. {
  72. "t": "set",
  73. "p": "payload",
  74. "pt": "msg",
  75. "to": "$floor(msg.payload.DS18B20.Temperature*100)",
  76. "tot": "jsonata"
  77. },
  78. {
  79. "t": "set",
  80. "p": "200",
  81. "pt": "flow",
  82. "to": "payload",
  83. "tot": "msg"
  84. },
  85. {
  86. "t": "set",
  87. "p": "topic",
  88. "pt": "msg",
  89. "to": "200",
  90. "tot": "num"
  91. }
  92. ],
  93. "action": "",
  94. "property": "",
  95. "from": "",
  96. "to": "",
  97. "reg": false,
  98. "x": 990,
  99. "y": 300,
  100. "wires": [
  101. [
  102. "bd38150b.8dce8"
  103. ]
  104. ]
  105. },
  106. {
  107. "id": "a59001c4.2a4dd8",
  108. "type": "inject",
  109. "z": "368c6b12.3ae6f4",
  110. "name": "Analog in",
  111. "topic": "",
  112. "payload": "123454",
  113. "payloadType": "str",
  114. "repeat": "1",
  115. "crontab": "",
  116. "once": true,
  117. "onceDelay": 0.1,
  118. "x": 1290,
  119. "y": 40,
  120. "wires": [
  121. [
  122. "b0c20f16.72267",
  123. "207eb92c.a0628e",
  124. "bb1d0f05.8b5a1",
  125. "b37ccddf.7e07e8",
  126. "4ffb02eb.00b7e4",
  127. "5c26e7ae.dbbbc8",
  128. "c81efba0.ad7af",
  129. "b0e036ed.603da",
  130. "8fde4d20.605de8",
  131. "4ddf83ce.4acb1c",
  132. "31e906b8.bc40ba",
  133. "eb4e62f5.6b72f8",
  134. "8dae0381.0d3e88",
  135. "a2415a34.ffb258",
  136. "7b444078.c3d5e8",
  137. "e6597cbd.540898",
  138. "16b984b7.5d2e03",
  139. "8ec2878e.8ec66",
  140. "488de313.1b02c4",
  141. "1304aef1.250359",
  142. "7fa9d5c6.5a2f74",
  143. "1dd513db.bd8f44",
  144. "32acbddb.48c02a",
  145. "89dedeff.3a83b8"
  146. ]
  147. ]
  148. },
  149. {
  150. "id": "1304aef1.250359",
  151. "type": "change",
  152. "z": "368c6b12.3ae6f4",
  153. "name": "100",
  154. "rules": [
  155. {
  156. "t": "set",
  157. "p": "100",
  158. "pt": "flow",
  159. "to": "payload",
  160. "tot": "msg"
  161. }
  162. ],
  163. "action": "",
  164. "property": "",
  165. "from": "",
  166. "to": "",
  167. "reg": false,
  168. "x": 1170,
  169. "y": 140,
  170. "wires": [
  171. []
  172. ]
  173. },
  174. {
  175. "id": "4ddf83ce.4acb1c",
  176. "type": "change",
  177. "z": "368c6b12.3ae6f4",
  178. "name": "202",
  179. "rules": [
  180. {
  181. "t": "set",
  182. "p": "202",
  183. "pt": "flow",
  184. "to": "payload",
  185. "tot": "msg"
  186. }
  187. ],
  188. "action": "",
  189. "property": "",
  190. "from": "",
  191. "to": "",
  192. "reg": false,
  193. "x": 1270,
  194. "y": 220,
  195. "wires": [
  196. []
  197. ]
  198. },
  199. {
  200. "id": "31e906b8.bc40ba",
  201. "type": "change",
  202. "z": "368c6b12.3ae6f4",
  203. "name": "203",
  204. "rules": [
  205. {
  206. "t": "set",
  207. "p": "203",
  208. "pt": "flow",
  209. "to": "payload",
  210. "tot": "msg"
  211. }
  212. ],
  213. "action": "",
  214. "property": "",
  215. "from": "",
  216. "to": "",
  217. "reg": false,
  218. "x": 1270,
  219. "y": 260,
  220. "wires": [
  221. []
  222. ]
  223. },
  224. {
  225. "id": "eb4e62f5.6b72f8",
  226. "type": "change",
  227. "z": "368c6b12.3ae6f4",
  228. "name": "204",
  229. "rules": [
  230. {
  231. "t": "set",
  232. "p": "204",
  233. "pt": "flow",
  234. "to": "payload",
  235. "tot": "msg"
  236. }
  237. ],
  238. "action": "",
  239. "property": "",
  240. "from": "",
  241. "to": "",
  242. "reg": false,
  243. "x": 1270,
  244. "y": 300,
  245. "wires": [
  246. []
  247. ]
  248. },
  249. {
  250. "id": "8dae0381.0d3e88",
  251. "type": "change",
  252. "z": "368c6b12.3ae6f4",
  253. "name": "205",
  254. "rules": [
  255. {
  256. "t": "set",
  257. "p": "205",
  258. "pt": "flow",
  259. "to": "payload",
  260. "tot": "msg"
  261. }
  262. ],
  263. "action": "",
  264. "property": "",
  265. "from": "",
  266. "to": "",
  267. "reg": false,
  268. "x": 1270,
  269. "y": 340,
  270. "wires": [
  271. []
  272. ]
  273. },
  274. {
  275. "id": "a2415a34.ffb258",
  276. "type": "change",
  277. "z": "368c6b12.3ae6f4",
  278. "name": "206",
  279. "rules": [
  280. {
  281. "t": "set",
  282. "p": "206",
  283. "pt": "flow",
  284. "to": "payload",
  285. "tot": "msg"
  286. }
  287. ],
  288. "action": "",
  289. "property": "",
  290. "from": "",
  291. "to": "",
  292. "reg": false,
  293. "x": 1270,
  294. "y": 380,
  295. "wires": [
  296. []
  297. ]
  298. },
  299. {
  300. "id": "7b444078.c3d5e8",
  301. "type": "change",
  302. "z": "368c6b12.3ae6f4",
  303. "name": "207",
  304. "rules": [
  305. {
  306. "t": "set",
  307. "p": "207",
  308. "pt": "flow",
  309. "to": "payload",
  310. "tot": "msg"
  311. }
  312. ],
  313. "action": "",
  314. "property": "",
  315. "from": "",
  316. "to": "",
  317. "reg": false,
  318. "x": 1270,
  319. "y": 420,
  320. "wires": [
  321. []
  322. ]
  323. },
  324. {
  325. "id": "e6597cbd.540898",
  326. "type": "change",
  327. "z": "368c6b12.3ae6f4",
  328. "name": "208",
  329. "rules": [
  330. {
  331. "t": "set",
  332. "p": "208",
  333. "pt": "flow",
  334. "to": "payload",
  335. "tot": "msg"
  336. }
  337. ],
  338. "action": "",
  339. "property": "",
  340. "from": "",
  341. "to": "",
  342. "reg": false,
  343. "x": 1270,
  344. "y": 460,
  345. "wires": [
  346. []
  347. ]
  348. },
  349. {
  350. "id": "16b984b7.5d2e03",
  351. "type": "change",
  352. "z": "368c6b12.3ae6f4",
  353. "name": "209",
  354. "rules": [
  355. {
  356. "t": "set",
  357. "p": "209",
  358. "pt": "flow",
  359. "to": "payload",
  360. "tot": "msg"
  361. }
  362. ],
  363. "action": "",
  364. "property": "",
  365. "from": "",
  366. "to": "",
  367. "reg": false,
  368. "x": 1270,
  369. "y": 500,
  370. "wires": [
  371. []
  372. ]
  373. },
  374. {
  375. "id": "b0c20f16.72267",
  376. "type": "change",
  377. "z": "368c6b12.3ae6f4",
  378. "name": "101",
  379. "rules": [
  380. {
  381. "t": "set",
  382. "p": "101",
  383. "pt": "flow",
  384. "to": "payload",
  385. "tot": "msg"
  386. }
  387. ],
  388. "action": "",
  389. "property": "",
  390. "from": "",
  391. "to": "",
  392. "reg": false,
  393. "x": 1170,
  394. "y": 180,
  395. "wires": [
  396. []
  397. ]
  398. },
  399. {
  400. "id": "207eb92c.a0628e",
  401. "type": "change",
  402. "z": "368c6b12.3ae6f4",
  403. "name": "102",
  404. "rules": [
  405. {
  406. "t": "set",
  407. "p": "102",
  408. "pt": "flow",
  409. "to": "payload",
  410. "tot": "msg"
  411. }
  412. ],
  413. "action": "",
  414. "property": "",
  415. "from": "",
  416. "to": "",
  417. "reg": false,
  418. "x": 1170,
  419. "y": 220,
  420. "wires": [
  421. []
  422. ]
  423. },
  424. {
  425. "id": "bb1d0f05.8b5a1",
  426. "type": "change",
  427. "z": "368c6b12.3ae6f4",
  428. "name": "103",
  429. "rules": [
  430. {
  431. "t": "set",
  432. "p": "103",
  433. "pt": "flow",
  434. "to": "payload",
  435. "tot": "msg"
  436. }
  437. ],
  438. "action": "",
  439. "property": "",
  440. "from": "",
  441. "to": "",
  442. "reg": false,
  443. "x": 1170,
  444. "y": 260,
  445. "wires": [
  446. []
  447. ]
  448. },
  449. {
  450. "id": "b37ccddf.7e07e8",
  451. "type": "change",
  452. "z": "368c6b12.3ae6f4",
  453. "name": "104",
  454. "rules": [
  455. {
  456. "t": "set",
  457. "p": "104",
  458. "pt": "flow",
  459. "to": "payload",
  460. "tot": "msg"
  461. }
  462. ],
  463. "action": "",
  464. "property": "",
  465. "from": "",
  466. "to": "",
  467. "reg": false,
  468. "x": 1170,
  469. "y": 300,
  470. "wires": [
  471. []
  472. ]
  473. },
  474. {
  475. "id": "4ffb02eb.00b7e4",
  476. "type": "change",
  477. "z": "368c6b12.3ae6f4",
  478. "name": "105",
  479. "rules": [
  480. {
  481. "t": "set",
  482. "p": "105",
  483. "pt": "flow",
  484. "to": "payload",
  485. "tot": "msg"
  486. }
  487. ],
  488. "action": "",
  489. "property": "",
  490. "from": "",
  491. "to": "",
  492. "reg": false,
  493. "x": 1170,
  494. "y": 340,
  495. "wires": [
  496. []
  497. ]
  498. },
  499. {
  500. "id": "5c26e7ae.dbbbc8",
  501. "type": "change",
  502. "z": "368c6b12.3ae6f4",
  503. "name": "106",
  504. "rules": [
  505. {
  506. "t": "set",
  507. "p": "106",
  508. "pt": "flow",
  509. "to": "payload",
  510. "tot": "msg"
  511. }
  512. ],
  513. "action": "",
  514. "property": "",
  515. "from": "",
  516. "to": "",
  517. "reg": false,
  518. "x": 1170,
  519. "y": 380,
  520. "wires": [
  521. []
  522. ]
  523. },
  524. {
  525. "id": "c81efba0.ad7af",
  526. "type": "change",
  527. "z": "368c6b12.3ae6f4",
  528. "name": "107",
  529. "rules": [
  530. {
  531. "t": "set",
  532. "p": "107",
  533. "pt": "flow",
  534. "to": "payload",
  535. "tot": "msg"
  536. }
  537. ],
  538. "action": "",
  539. "property": "",
  540. "from": "",
  541. "to": "",
  542. "reg": false,
  543. "x": 1170,
  544. "y": 420,
  545. "wires": [
  546. []
  547. ]
  548. },
  549. {
  550. "id": "b0e036ed.603da",
  551. "type": "change",
  552. "z": "368c6b12.3ae6f4",
  553. "name": "108",
  554. "rules": [
  555. {
  556. "t": "set",
  557. "p": "108",
  558. "pt": "flow",
  559. "to": "payload",
  560. "tot": "msg"
  561. }
  562. ],
  563. "action": "",
  564. "property": "",
  565. "from": "",
  566. "to": "",
  567. "reg": false,
  568. "x": 1170,
  569. "y": 460,
  570. "wires": [
  571. []
  572. ]
  573. },
  574. {
  575. "id": "8fde4d20.605de8",
  576. "type": "change",
  577. "z": "368c6b12.3ae6f4",
  578. "name": "109",
  579. "rules": [
  580. {
  581. "t": "set",
  582. "p": "109",
  583. "pt": "flow",
  584. "to": "payload",
  585. "tot": "msg"
  586. }
  587. ],
  588. "action": "",
  589. "property": "",
  590. "from": "",
  591. "to": "",
  592. "reg": false,
  593. "x": 1170,
  594. "y": 500,
  595. "wires": [
  596. []
  597. ]
  598. },
  599. {
  600. "id": "8ec2878e.8ec66",
  601. "type": "change",
  602. "z": "368c6b12.3ae6f4",
  603. "name": "110",
  604. "rules": [
  605. {
  606. "t": "set",
  607. "p": "110",
  608. "pt": "flow",
  609. "to": "payload",
  610. "tot": "msg"
  611. }
  612. ],
  613. "action": "",
  614. "property": "",
  615. "from": "",
  616. "to": "",
  617. "reg": false,
  618. "x": 1290,
  619. "y": 140,
  620. "wires": [
  621. []
  622. ]
  623. },
  624. {
  625. "id": "488de313.1b02c4",
  626. "type": "change",
  627. "z": "368c6b12.3ae6f4",
  628. "name": "111",
  629. "rules": [
  630. {
  631. "t": "set",
  632. "p": "111",
  633. "pt": "flow",
  634. "to": "payload",
  635. "tot": "msg"
  636. }
  637. ],
  638. "action": "",
  639. "property": "",
  640. "from": "",
  641. "to": "",
  642. "reg": false,
  643. "x": 1290,
  644. "y": 180,
  645. "wires": [
  646. []
  647. ]
  648. },
  649. {
  650. "id": "7fa9d5c6.5a2f74",
  651. "type": "change",
  652. "z": "368c6b12.3ae6f4",
  653. "name": "112",
  654. "rules": [
  655. {
  656. "t": "set",
  657. "p": "112",
  658. "pt": "flow",
  659. "to": "payload",
  660. "tot": "msg"
  661. }
  662. ],
  663. "action": "",
  664. "property": "",
  665. "from": "",
  666. "to": "",
  667. "reg": false,
  668. "x": 1290,
  669. "y": 220,
  670. "wires": [
  671. []
  672. ]
  673. },
  674. {
  675. "id": "1dd513db.bd8f44",
  676. "type": "change",
  677. "z": "368c6b12.3ae6f4",
  678. "name": "113",
  679. "rules": [
  680. {
  681. "t": "set",
  682. "p": "113",
  683. "pt": "flow",
  684. "to": "payload",
  685. "tot": "msg"
  686. }
  687. ],
  688. "action": "",
  689. "property": "",
  690. "from": "",
  691. "to": "",
  692. "reg": false,
  693. "x": 1290,
  694. "y": 260,
  695. "wires": [
  696. []
  697. ]
  698. },
  699. {
  700. "id": "32acbddb.48c02a",
  701. "type": "change",
  702. "z": "368c6b12.3ae6f4",
  703. "name": "114",
  704. "rules": [
  705. {
  706. "t": "set",
  707. "p": "114",
  708. "pt": "flow",
  709. "to": "payload",
  710. "tot": "msg"
  711. }
  712. ],
  713. "action": "",
  714. "property": "",
  715. "from": "",
  716. "to": "",
  717. "reg": false,
  718. "x": 1290,
  719. "y": 300,
  720. "wires": [
  721. []
  722. ]
  723. },
  724. {
  725. "id": "89dedeff.3a83b8",
  726. "type": "change",
  727. "z": "368c6b12.3ae6f4",
  728. "name": "115",
  729. "rules": [
  730. {
  731. "t": "set",
  732. "p": "115",
  733. "pt": "flow",
  734. "to": "payload",
  735. "tot": "msg"
  736. }
  737. ],
  738. "action": "",
  739. "property": "",
  740. "from": "",
  741. "to": "",
  742. "reg": false,
  743. "x": 1290,
  744. "y": 340,
  745. "wires": [
  746. []
  747. ]
  748. },
  749. {
  750. "id": "ce616d18.fef93",
  751. "type": "mqtt out",
  752. "z": "368c6b12.3ae6f4",
  753. "name": "F2 ctrl",
  754. "topic": "cmnd/Fcool/POWER2",
  755. "qos": "",
  756. "retain": "",
  757. "broker": "e15967f2.8aa848",
  758. "x": 570,
  759. "y": 100,
  760. "wires": []
  761. },
  762. {
  763. "id": "137d5803.f2199",
  764. "type": "switch",
  765. "z": "368c6b12.3ae6f4",
  766. "name": "Out",
  767. "property": "topic",
  768. "propertyType": "msg",
  769. "rules": [
  770. {
  771. "t": "eq",
  772. "v": "1",
  773. "vt": "str"
  774. },
  775. {
  776. "t": "eq",
  777. "v": "2",
  778. "vt": "str"
  779. },
  780. {
  781. "t": "eq",
  782. "v": "3",
  783. "vt": "str"
  784. },
  785. {
  786. "t": "eq",
  787. "v": "4",
  788. "vt": "str"
  789. },
  790. {
  791. "t": "eq",
  792. "v": "5",
  793. "vt": "str"
  794. },
  795. {
  796. "t": "eq",
  797. "v": "6",
  798. "vt": "str"
  799. },
  800. {
  801. "t": "eq",
  802. "v": "7",
  803. "vt": "str"
  804. },
  805. {
  806. "t": "eq",
  807. "v": "8",
  808. "vt": "str"
  809. },
  810. {
  811. "t": "eq",
  812. "v": "9",
  813. "vt": "str"
  814. },
  815. {
  816. "t": "eq",
  817. "v": "10",
  818. "vt": "str"
  819. },
  820. {
  821. "t": "eq",
  822. "v": "11",
  823. "vt": "str"
  824. },
  825. {
  826. "t": "eq",
  827. "v": "12",
  828. "vt": "str"
  829. },
  830. {
  831. "t": "eq",
  832. "v": "13",
  833. "vt": "str"
  834. },
  835. {
  836. "t": "eq",
  837. "v": "14",
  838. "vt": "str"
  839. },
  840. {
  841. "t": "eq",
  842. "v": "15",
  843. "vt": "str"
  844. },
  845. {
  846. "t": "eq",
  847. "v": "16",
  848. "vt": "str"
  849. },
  850. {
  851. "t": "eq",
  852. "v": "17",
  853. "vt": "str"
  854. },
  855. {
  856. "t": "eq",
  857. "v": "18",
  858. "vt": "str"
  859. },
  860. {
  861. "t": "eq",
  862. "v": "19",
  863. "vt": "str"
  864. },
  865. {
  866. "t": "eq",
  867. "v": "20",
  868. "vt": "str"
  869. },
  870. {
  871. "t": "eq",
  872. "v": "21",
  873. "vt": "str"
  874. },
  875. {
  876. "t": "eq",
  877. "v": "22",
  878. "vt": "str"
  879. },
  880. {
  881. "t": "eq",
  882. "v": "23",
  883. "vt": "str"
  884. }
  885. ],
  886. "checkall": "true",
  887. "repair": false,
  888. "outputs": 23,
  889. "x": 50,
  890. "y": 180,
  891. "wires": [
  892. [],
  893. [],
  894. [],
  895. [
  896. "e42edb68.196658"
  897. ],
  898. [],
  899. [
  900. "179a0b7d.e3dee5"
  901. ],
  902. [
  903. "ce616d18.fef93"
  904. ],
  905. [
  906. "f3ed6fc1.a6822"
  907. ],
  908. [],
  909. [],
  910. [
  911. "1b20fa56.8799b6",
  912. "ce7072ee.32213"
  913. ],
  914. [],
  915. [],
  916. [],
  917. [],
  918. [
  919. "50ba9255.e3055c",
  920. "3b0f82a9.baa34e"
  921. ],
  922. [],
  923. [],
  924. [],
  925. [],
  926. [],
  927. [],
  928. []
  929. ]
  930. },
  931. {
  932. "id": "179a0b7d.e3dee5",
  933. "type": "mqtt out",
  934. "z": "368c6b12.3ae6f4",
  935. "name": "F1 ctrl",
  936. "topic": "cmnd/Fcool/POWER1",
  937. "qos": "",
  938. "retain": "",
  939. "broker": "e15967f2.8aa848",
  940. "x": 570,
  941. "y": 60,
  942. "wires": []
  943. },
  944. {
  945. "id": "75807430.88109c",
  946. "type": "mqtt in",
  947. "z": "368c6b12.3ae6f4",
  948. "name": "Cooler temp",
  949. "topic": "tele/cooler/SENSOR",
  950. "qos": "2",
  951. "datatype": "auto",
  952. "broker": "e15967f2.8aa848",
  953. "x": 730,
  954. "y": 300,
  955. "wires": [
  956. [
  957. "375bb888.d87dd8"
  958. ]
  959. ]
  960. },
  961. {
  962. "id": "375bb888.d87dd8",
  963. "type": "json",
  964. "z": "368c6b12.3ae6f4",
  965. "name": "",
  966. "property": "payload",
  967. "action": "",
  968. "pretty": false,
  969. "x": 870,
  970. "y": 300,
  971. "wires": [
  972. [
  973. "58408118.db1018"
  974. ]
  975. ]
  976. },
  977. {
  978. "id": "d4df721b.34af",
  979. "type": "mqtt out",
  980. "z": "368c6b12.3ae6f4",
  981. "name": "Cooler ctrl",
  982. "topic": "cmnd/cooler/POWER",
  983. "qos": "",
  984. "retain": "",
  985. "broker": "e15967f2.8aa848",
  986. "x": 550,
  987. "y": 320,
  988. "wires": []
  989. },
  990. {
  991. "id": "e38efb94.440698",
  992. "type": "mqtt out",
  993. "z": "368c6b12.3ae6f4",
  994. "name": "4ch L1",
  995. "topic": "cmnd/4ch/POWER1",
  996. "qos": "",
  997. "retain": "",
  998. "broker": "e15967f2.8aa848",
  999. "x": 570,
  1000. "y": 20,
  1001. "wires": []
  1002. },
  1003. {
  1004. "id": "9762d994.361d98",
  1005. "type": "mqtt in",
  1006. "z": "368c6b12.3ae6f4",
  1007. "name": "Freezer temp",
  1008. "topic": "tele/freezer/SENSOR",
  1009. "qos": "2",
  1010. "datatype": "auto",
  1011. "broker": "e15967f2.8aa848",
  1012. "x": 730,
  1013. "y": 260,
  1014. "wires": [
  1015. [
  1016. "9696e940.76b2a8"
  1017. ]
  1018. ]
  1019. },
  1020. {
  1021. "id": "9696e940.76b2a8",
  1022. "type": "json",
  1023. "z": "368c6b12.3ae6f4",
  1024. "name": "",
  1025. "property": "payload",
  1026. "action": "",
  1027. "pretty": false,
  1028. "x": 870,
  1029. "y": 260,
  1030. "wires": [
  1031. [
  1032. "2a6686fe.5791d2"
  1033. ]
  1034. ]
  1035. },
  1036. {
  1037. "id": "2be0985d.8818e8",
  1038. "type": "mqtt out",
  1039. "z": "368c6b12.3ae6f4",
  1040. "name": "Freezer ctrl",
  1041. "topic": "cmnd/freezer/POWER",
  1042. "qos": "",
  1043. "retain": "",
  1044. "broker": "e15967f2.8aa848",
  1045. "x": 550,
  1046. "y": 220,
  1047. "wires": []
  1048. },
  1049. {
  1050. "id": "82506c1e.0ab398",
  1051. "type": "mqtt in",
  1052. "z": "368c6b12.3ae6f4",
  1053. "name": "Cooler feedback",
  1054. "topic": "stat/cooler/POWER",
  1055. "qos": "2",
  1056. "datatype": "auto",
  1057. "broker": "e15967f2.8aa848",
  1058. "x": 740,
  1059. "y": 220,
  1060. "wires": [
  1061. [
  1062. "8c0b2cbd.f5a0f8",
  1063. "21316851.1b579"
  1064. ]
  1065. ]
  1066. },
  1067. {
  1068. "id": "8c0b2cbd.f5a0f8",
  1069. "type": "change",
  1070. "z": "368c6b12.3ae6f4",
  1071. "name": "16",
  1072. "rules": [
  1073. {
  1074. "t": "change",
  1075. "p": "payload",
  1076. "pt": "msg",
  1077. "from": "ON",
  1078. "fromt": "str",
  1079. "to": "1",
  1080. "tot": "num"
  1081. },
  1082. {
  1083. "t": "change",
  1084. "p": "payload",
  1085. "pt": "msg",
  1086. "from": "OFF",
  1087. "fromt": "str",
  1088. "to": "0",
  1089. "tot": "num"
  1090. },
  1091. {
  1092. "t": "set",
  1093. "p": "16",
  1094. "pt": "flow",
  1095. "to": "payload",
  1096. "tot": "msg"
  1097. }
  1098. ],
  1099. "action": "",
  1100. "property": "",
  1101. "from": "",
  1102. "to": "",
  1103. "reg": false,
  1104. "x": 990,
  1105. "y": 220,
  1106. "wires": [
  1107. []
  1108. ]
  1109. },
  1110. {
  1111. "id": "e408cd4e.20e708",
  1112. "type": "mqtt in",
  1113. "z": "368c6b12.3ae6f4",
  1114. "name": "4ch feedback",
  1115. "topic": "stat/4ch/POWER1",
  1116. "qos": "2",
  1117. "datatype": "auto",
  1118. "broker": "e15967f2.8aa848",
  1119. "x": 730,
  1120. "y": 20,
  1121. "wires": [
  1122. [
  1123. "3685d214.b48a06",
  1124. "21316851.1b579"
  1125. ]
  1126. ]
  1127. },
  1128. {
  1129. "id": "3685d214.b48a06",
  1130. "type": "change",
  1131. "z": "368c6b12.3ae6f4",
  1132. "name": "4",
  1133. "rules": [
  1134. {
  1135. "t": "change",
  1136. "p": "payload",
  1137. "pt": "msg",
  1138. "from": "ON",
  1139. "fromt": "str",
  1140. "to": "1",
  1141. "tot": "num"
  1142. },
  1143. {
  1144. "t": "change",
  1145. "p": "payload",
  1146. "pt": "msg",
  1147. "from": "OFF",
  1148. "fromt": "str",
  1149. "to": "0",
  1150. "tot": "num"
  1151. },
  1152. {
  1153. "t": "set",
  1154. "p": "4",
  1155. "pt": "flow",
  1156. "to": "payload",
  1157. "tot": "msg"
  1158. }
  1159. ],
  1160. "action": "",
  1161. "property": "",
  1162. "from": "",
  1163. "to": "",
  1164. "reg": false,
  1165. "x": 990,
  1166. "y": 20,
  1167. "wires": [
  1168. []
  1169. ]
  1170. },
  1171. {
  1172. "id": "ad8f13fc.951b98",
  1173. "type": "mqtt in",
  1174. "z": "368c6b12.3ae6f4",
  1175. "name": "F1 feedback",
  1176. "topic": "stat/Fcool/POWER1",
  1177. "qos": "2",
  1178. "datatype": "auto",
  1179. "broker": "e15967f2.8aa848",
  1180. "x": 730,
  1181. "y": 60,
  1182. "wires": [
  1183. [
  1184. "ae355df.1b1aca",
  1185. "21316851.1b579"
  1186. ]
  1187. ]
  1188. },
  1189. {
  1190. "id": "ae355df.1b1aca",
  1191. "type": "change",
  1192. "z": "368c6b12.3ae6f4",
  1193. "name": "6",
  1194. "rules": [
  1195. {
  1196. "t": "change",
  1197. "p": "payload",
  1198. "pt": "msg",
  1199. "from": "ON",
  1200. "fromt": "str",
  1201. "to": "1",
  1202. "tot": "num"
  1203. },
  1204. {
  1205. "t": "change",
  1206. "p": "payload",
  1207. "pt": "msg",
  1208. "from": "OFF",
  1209. "fromt": "str",
  1210. "to": "0",
  1211. "tot": "num"
  1212. },
  1213. {
  1214. "t": "set",
  1215. "p": "6",
  1216. "pt": "flow",
  1217. "to": "payload",
  1218. "tot": "msg"
  1219. }
  1220. ],
  1221. "action": "",
  1222. "property": "",
  1223. "from": "",
  1224. "to": "",
  1225. "reg": false,
  1226. "x": 990,
  1227. "y": 60,
  1228. "wires": [
  1229. []
  1230. ]
  1231. },
  1232. {
  1233. "id": "ffd9d1cf.8dec88",
  1234. "type": "mqtt in",
  1235. "z": "368c6b12.3ae6f4",
  1236. "name": "F2 feedback",
  1237. "topic": "stat/Fcool/POWER2",
  1238. "qos": "2",
  1239. "datatype": "auto",
  1240. "broker": "e15967f2.8aa848",
  1241. "x": 730,
  1242. "y": 100,
  1243. "wires": [
  1244. [
  1245. "f9936e54.d6d5a8",
  1246. "21316851.1b579"
  1247. ]
  1248. ]
  1249. },
  1250. {
  1251. "id": "f9936e54.d6d5a8",
  1252. "type": "change",
  1253. "z": "368c6b12.3ae6f4",
  1254. "name": "7",
  1255. "rules": [
  1256. {
  1257. "t": "change",
  1258. "p": "payload",
  1259. "pt": "msg",
  1260. "from": "ON",
  1261. "fromt": "str",
  1262. "to": "1",
  1263. "tot": "num"
  1264. },
  1265. {
  1266. "t": "change",
  1267. "p": "payload",
  1268. "pt": "msg",
  1269. "from": "OFF",
  1270. "fromt": "str",
  1271. "to": "0",
  1272. "tot": "num"
  1273. },
  1274. {
  1275. "t": "set",
  1276. "p": "7",
  1277. "pt": "flow",
  1278. "to": "payload",
  1279. "tot": "msg"
  1280. }
  1281. ],
  1282. "action": "",
  1283. "property": "",
  1284. "from": "",
  1285. "to": "",
  1286. "reg": false,
  1287. "x": 990,
  1288. "y": 100,
  1289. "wires": [
  1290. []
  1291. ]
  1292. },
  1293. {
  1294. "id": "306509fc.3b5c5e",
  1295. "type": "rbe",
  1296. "z": "368c6b12.3ae6f4",
  1297. "name": "",
  1298. "func": "rbe",
  1299. "gap": "",
  1300. "start": "",
  1301. "inout": "out",
  1302. "property": "payload",
  1303. "x": 730,
  1304. "y": 920,
  1305. "wires": [
  1306. [
  1307. "137d5803.f2199",
  1308. "ce0c590e.efa008"
  1309. ]
  1310. ]
  1311. },
  1312. {
  1313. "id": "2a6686fe.5791d2",
  1314. "type": "change",
  1315. "z": "368c6b12.3ae6f4",
  1316. "name": "201",
  1317. "rules": [
  1318. {
  1319. "t": "set",
  1320. "p": "payload",
  1321. "pt": "msg",
  1322. "to": "$floor(msg.payload.DS18B20.Temperature*100)\t",
  1323. "tot": "jsonata"
  1324. },
  1325. {
  1326. "t": "set",
  1327. "p": "201",
  1328. "pt": "flow",
  1329. "to": "payload",
  1330. "tot": "msg"
  1331. },
  1332. {
  1333. "t": "set",
  1334. "p": "topic",
  1335. "pt": "msg",
  1336. "to": "201",
  1337. "tot": "num"
  1338. }
  1339. ],
  1340. "action": "",
  1341. "property": "",
  1342. "from": "",
  1343. "to": "",
  1344. "reg": false,
  1345. "x": 990,
  1346. "y": 260,
  1347. "wires": [
  1348. [
  1349. "bd38150b.8dce8"
  1350. ]
  1351. ]
  1352. },
  1353. {
  1354. "id": "c4fc07f7.b802",
  1355. "type": "change",
  1356. "z": "368c6b12.3ae6f4",
  1357. "name": "11",
  1358. "rules": [
  1359. {
  1360. "t": "change",
  1361. "p": "payload",
  1362. "pt": "msg",
  1363. "from": "ON",
  1364. "fromt": "str",
  1365. "to": "1",
  1366. "tot": "num"
  1367. },
  1368. {
  1369. "t": "change",
  1370. "p": "payload",
  1371. "pt": "msg",
  1372. "from": "OFF",
  1373. "fromt": "str",
  1374. "to": "0",
  1375. "tot": "num"
  1376. },
  1377. {
  1378. "t": "set",
  1379. "p": "11",
  1380. "pt": "flow",
  1381. "to": "payload",
  1382. "tot": "msg"
  1383. }
  1384. ],
  1385. "action": "",
  1386. "property": "",
  1387. "from": "",
  1388. "to": "",
  1389. "reg": false,
  1390. "x": 990,
  1391. "y": 180,
  1392. "wires": [
  1393. []
  1394. ]
  1395. },
  1396. {
  1397. "id": "5ef1bfff.454408",
  1398. "type": "mqtt in",
  1399. "z": "368c6b12.3ae6f4",
  1400. "name": "Freezer feedback",
  1401. "topic": "stat/freezer/POWER",
  1402. "qos": "2",
  1403. "datatype": "auto",
  1404. "broker": "e15967f2.8aa848",
  1405. "x": 740,
  1406. "y": 180,
  1407. "wires": [
  1408. [
  1409. "c4fc07f7.b802",
  1410. "21316851.1b579"
  1411. ]
  1412. ]
  1413. },
  1414. {
  1415. "id": "bd38150b.8dce8",
  1416. "type": "function",
  1417. "z": "368c6b12.3ae6f4",
  1418. "name": "Hysteresis",
  1419. "func": "var port = msg.topic\nvar value = msg.payload\nvar delay;\nvar flush = {};\nvar coolmode;\nvar output;\nvar on;\nvar off;\nvar pin = flow.get(String(port)+\"pin\")\nvar target = flow.get(String(port)+\"target\")\nvar onoffset = flow.get(String(port)+\"onoffset\")\nvar cooling = flow.get(String(pin));\nvar activelow = flow.get(String(port)+\"activelow\")\nvar ondelay = flow.get(String(port)+\"ondelay\")\n\nif (activelow === 1) {\n on = 0\n off = 1\n}\nelse {\n on = 1\n off = 0\n}\n\nif (onoffset > target) {\n coolmode = true\n}\n\nif (value >= onoffset && coolmode === true){\noutput = on\n}\nif (value <= onoffset && value > target && cooling === 1 && coolmode === true) {\n output = on \n}\nif (value <= target && coolmode === true){\n output = off\nmsg.flush = flush\nnode.send(msg.flush)\n}\n\nif (flow.get(String(pin)+\"disabled\") === 1) {\noutput = off\nmsg.flush = flush\nnode.send(msg.flush)\n}\n\nmsg.topic = pin\nmsg.payload = output\nmsg.delay = ondelay\nreturn msg;",
  1420. "outputs": 1,
  1421. "noerr": 0,
  1422. "x": 530,
  1423. "y": 940,
  1424. "wires": [
  1425. [
  1426. "306509fc.3b5c5e"
  1427. ]
  1428. ]
  1429. },
  1430. {
  1431. "id": "1cb68ce9.48f553",
  1432. "type": "mqtt out",
  1433. "z": "368c6b12.3ae6f4",
  1434. "name": "Steam ctrl",
  1435. "topic": "cmnd/steam/POWER",
  1436. "qos": "",
  1437. "retain": "",
  1438. "broker": "e15967f2.8aa848",
  1439. "x": 560,
  1440. "y": 140,
  1441. "wires": []
  1442. },
  1443. {
  1444. "id": "855a522c.a10c1",
  1445. "type": "mqtt in",
  1446. "z": "368c6b12.3ae6f4",
  1447. "name": "Steam feedback",
  1448. "topic": "stat/steam/POWER",
  1449. "qos": "2",
  1450. "datatype": "auto",
  1451. "broker": "e15967f2.8aa848",
  1452. "x": 740,
  1453. "y": 140,
  1454. "wires": [
  1455. [
  1456. "2c750a9c.0ca526",
  1457. "21316851.1b579"
  1458. ]
  1459. ]
  1460. },
  1461. {
  1462. "id": "2c750a9c.0ca526",
  1463. "type": "change",
  1464. "z": "368c6b12.3ae6f4",
  1465. "name": "8",
  1466. "rules": [
  1467. {
  1468. "t": "change",
  1469. "p": "payload",
  1470. "pt": "msg",
  1471. "from": "ON",
  1472. "fromt": "str",
  1473. "to": "1",
  1474. "tot": "num"
  1475. },
  1476. {
  1477. "t": "change",
  1478. "p": "payload",
  1479. "pt": "msg",
  1480. "from": "OFF",
  1481. "fromt": "str",
  1482. "to": "0",
  1483. "tot": "num"
  1484. },
  1485. {
  1486. "t": "set",
  1487. "p": "8",
  1488. "pt": "flow",
  1489. "to": "payload",
  1490. "tot": "msg"
  1491. }
  1492. ],
  1493. "action": "",
  1494. "property": "",
  1495. "from": "",
  1496. "to": "",
  1497. "reg": false,
  1498. "x": 990,
  1499. "y": 140,
  1500. "wires": [
  1501. []
  1502. ]
  1503. },
  1504. {
  1505. "id": "50ba9255.e3055c",
  1506. "type": "falling-edge",
  1507. "z": "368c6b12.3ae6f4",
  1508. "name": "Stop",
  1509. "threshold": "1",
  1510. "x": 270,
  1511. "y": 320,
  1512. "wires": [
  1513. [
  1514. "d4df721b.34af"
  1515. ]
  1516. ]
  1517. },
  1518. {
  1519. "id": "3b0f82a9.baa34e",
  1520. "type": "delay",
  1521. "z": "368c6b12.3ae6f4",
  1522. "name": "ONdelay",
  1523. "pauseType": "delayv",
  1524. "timeout": "0",
  1525. "timeoutUnits": "seconds",
  1526. "rate": "1",
  1527. "nbRateUnits": "1",
  1528. "rateUnits": "second",
  1529. "randomFirst": "1",
  1530. "randomLast": "5",
  1531. "randomUnits": "seconds",
  1532. "drop": false,
  1533. "x": 280,
  1534. "y": 280,
  1535. "wires": [
  1536. [
  1537. "47ff9754.f0ae28"
  1538. ]
  1539. ]
  1540. },
  1541. {
  1542. "id": "ce7072ee.32213",
  1543. "type": "falling-edge",
  1544. "z": "368c6b12.3ae6f4",
  1545. "name": "Stop",
  1546. "threshold": "1",
  1547. "x": 270,
  1548. "y": 220,
  1549. "wires": [
  1550. [
  1551. "2be0985d.8818e8"
  1552. ]
  1553. ]
  1554. },
  1555. {
  1556. "id": "1b20fa56.8799b6",
  1557. "type": "delay",
  1558. "z": "368c6b12.3ae6f4",
  1559. "name": "ONdelay",
  1560. "pauseType": "delayv",
  1561. "timeout": "0",
  1562. "timeoutUnits": "seconds",
  1563. "rate": "1",
  1564. "nbRateUnits": "1",
  1565. "rateUnits": "second",
  1566. "randomFirst": "1",
  1567. "randomLast": "5",
  1568. "randomUnits": "seconds",
  1569. "drop": false,
  1570. "x": 280,
  1571. "y": 180,
  1572. "wires": [
  1573. [
  1574. "1849cdac.6051b2"
  1575. ]
  1576. ]
  1577. },
  1578. {
  1579. "id": "21316851.1b579",
  1580. "type": "debug",
  1581. "z": "368c6b12.3ae6f4",
  1582. "name": "",
  1583. "active": false,
  1584. "tosidebar": true,
  1585. "console": false,
  1586. "tostatus": false,
  1587. "complete": "false",
  1588. "x": 1010,
  1589. "y": 340,
  1590. "wires": []
  1591. },
  1592. {
  1593. "id": "30344b49.8fc444",
  1594. "type": "string",
  1595. "z": "368c6b12.3ae6f4",
  1596. "name": "first",
  1597. "methods": [
  1598. {
  1599. "name": "getLeftMost",
  1600. "params": [
  1601. {
  1602. "type": "str",
  1603. "value": "?"
  1604. }
  1605. ]
  1606. }
  1607. ],
  1608. "prop": "payload",
  1609. "propout": "payload",
  1610. "object": "msg",
  1611. "objectout": "msg",
  1612. "x": 230,
  1613. "y": 1040,
  1614. "wires": [
  1615. [
  1616. "e07ac922.25a448",
  1617. "e4f98089.b5c448"
  1618. ]
  1619. ]
  1620. },
  1621. {
  1622. "id": "bf63d504.758de8",
  1623. "type": "string",
  1624. "z": "368c6b12.3ae6f4",
  1625. "name": "last",
  1626. "methods": [
  1627. {
  1628. "name": "delLeftMost",
  1629. "params": [
  1630. {
  1631. "type": "str",
  1632. "value": "?"
  1633. }
  1634. ]
  1635. },
  1636. {
  1637. "name": "ensureLeft",
  1638. "params": [
  1639. {
  1640. "type": "str",
  1641. "value": "?"
  1642. }
  1643. ]
  1644. },
  1645. {
  1646. "name": "delRightMost",
  1647. "params": [
  1648. {
  1649. "type": "str",
  1650. "value": "!"
  1651. }
  1652. ]
  1653. },
  1654. {
  1655. "name": "delRightMost",
  1656. "params": [
  1657. {
  1658. "type": "str",
  1659. "value": "!"
  1660. }
  1661. ]
  1662. },
  1663. {
  1664. "name": "delRightMost",
  1665. "params": [
  1666. {
  1667. "type": "str",
  1668. "value": "!"
  1669. }
  1670. ]
  1671. },
  1672. {
  1673. "name": "delRightMost",
  1674. "params": [
  1675. {
  1676. "type": "str",
  1677. "value": ";"
  1678. }
  1679. ]
  1680. }
  1681. ],
  1682. "prop": "payload",
  1683. "propout": "payload",
  1684. "object": "msg",
  1685. "objectout": "msg",
  1686. "x": 230,
  1687. "y": 1080,
  1688. "wires": [
  1689. [
  1690. "ce236939.941758"
  1691. ]
  1692. ]
  1693. },
  1694. {
  1695. "id": "3f8fd60f.068cfa",
  1696. "type": "inject",
  1697. "z": "368c6b12.3ae6f4",
  1698. "name": "",
  1699. "topic": "",
  1700. "payload": "/6/68/89?89",
  1701. "payloadType": "str",
  1702. "repeat": "",
  1703. "crontab": "",
  1704. "once": false,
  1705. "onceDelay": 0.1,
  1706. "x": 150,
  1707. "y": 620,
  1708. "wires": [
  1709. []
  1710. ]
  1711. },
  1712. {
  1713. "id": "e07ac922.25a448",
  1714. "type": "split",
  1715. "z": "368c6b12.3ae6f4",
  1716. "name": "",
  1717. "splt": "!",
  1718. "spltType": "str",
  1719. "arraySplt": 1,
  1720. "arraySpltType": "len",
  1721. "stream": false,
  1722. "addname": "",
  1723. "x": 370,
  1724. "y": 1000,
  1725. "wires": [
  1726. [
  1727. "52bb424f.135f2c"
  1728. ]
  1729. ]
  1730. },
  1731. {
  1732. "id": "ce236939.941758",
  1733. "type": "split",
  1734. "z": "368c6b12.3ae6f4",
  1735. "name": "",
  1736. "splt": "?",
  1737. "spltType": "str",
  1738. "arraySplt": 1,
  1739. "arraySpltType": "len",
  1740. "stream": false,
  1741. "addname": "",
  1742. "x": 370,
  1743. "y": 1080,
  1744. "wires": [
  1745. [
  1746. "66608328.39483c"
  1747. ]
  1748. ]
  1749. },
  1750. {
  1751. "id": "e4f98089.b5c448",
  1752. "type": "join",
  1753. "z": "368c6b12.3ae6f4",
  1754. "name": "",
  1755. "mode": "custom",
  1756. "build": "string",
  1757. "property": "payload",
  1758. "propertyType": "msg",
  1759. "key": "topic",
  1760. "joiner": "",
  1761. "joinerType": "str",
  1762. "accumulate": false,
  1763. "timeout": "0.1",
  1764. "count": "",
  1765. "reduceRight": false,
  1766. "reduceExp": "",
  1767. "reduceInit": "",
  1768. "reduceInitType": "",
  1769. "reduceFixup": "",
  1770. "x": 650,
  1771. "y": 1040,
  1772. "wires": [
  1773. [
  1774. "4dc4fade.04b844"
  1775. ]
  1776. ]
  1777. },
  1778. {
  1779. "id": "66608328.39483c",
  1780. "type": "function",
  1781. "z": "368c6b12.3ae6f4",
  1782. "name": "feedback",
  1783. "func": "if (msg.payload.length > 0) {\n var pin = msg.payload\n msg.payload = \"?\"+String(pin)+\"=\"+String(flow.get(pin));\n\nreturn msg;\n}",
  1784. "outputs": 1,
  1785. "noerr": 0,
  1786. "x": 520,
  1787. "y": 1080,
  1788. "wires": [
  1789. [
  1790. "e4f98089.b5c448"
  1791. ]
  1792. ]
  1793. },
  1794. {
  1795. "id": "52bb424f.135f2c",
  1796. "type": "function",
  1797. "z": "368c6b12.3ae6f4",
  1798. "name": "pin config",
  1799. "func": "if (msg.payload.length > 0) {\nvar input = msg.payload.split(\",\");\nvar pin = parseInt(input[0])\nvar config = parseInt(input[1])\nvar state;\n\nflow.set(String(pin)+\"disabled\", 0);\n\nif (config == 1) {\n var one ={};\n one.topic = pin\n state = parseInt(input[2])\n one.payload = state \n return [one, null, null];\n}\nif (config == 5) {\n five = {};\n five.topic = \"newconfig\"\n pin = parseInt(input[0])\n config = parseInt(input[1])\n var port = parseInt(input[2])\n var target = parseInt(input[3])\n var onoffset = parseInt(input[4])\n var ondelay = parseInt(input[5]) * 1000\n var activelow = parseInt(input[6])\n var value = parseInt(flow.get(String(port)))\n flow.set(String(port)+\"pin\", pin);\n flow.set(String(port)+\"target\", target);\n flow.set(String(port)+\"onoffset\", onoffset);\n flow.set(String(port)+\"activelow\", activelow);\n flow.set(String(port)+\"ondelay\", ondelay);\n five.payload = [pin, config, port, target, onoffset, ondelay, activelow]\n return [null, five, null];\n}\nif (config == 7) {\n var seven = {};\n seven.topic = pin\n state = parseInt(input[2])\n seven.payload = state \n return [null, null, seven];\n}\n}",
  1800. "outputs": 3,
  1801. "noerr": 0,
  1802. "x": 520,
  1803. "y": 1000,
  1804. "wires": [
  1805. [
  1806. "306509fc.3b5c5e"
  1807. ],
  1808. [],
  1809. [
  1810. "306509fc.3b5c5e"
  1811. ]
  1812. ]
  1813. },
  1814. {
  1815. "id": "35844c6e.bcd07c",
  1816. "type": "split",
  1817. "z": "368c6b12.3ae6f4",
  1818. "name": "",
  1819. "splt": "/",
  1820. "spltType": "str",
  1821. "arraySplt": 1,
  1822. "arraySpltType": "len",
  1823. "stream": false,
  1824. "addname": "",
  1825. "x": 370,
  1826. "y": 900,
  1827. "wires": [
  1828. [
  1829. "83f84393.6dbd7"
  1830. ]
  1831. ]
  1832. },
  1833. {
  1834. "id": "83f84393.6dbd7",
  1835. "type": "function",
  1836. "z": "368c6b12.3ae6f4",
  1837. "name": "disable pins",
  1838. "func": "\nif (msg.payload.length > 0) {\nvar input = msg.payload;\nvar pin = input;\nflow.set(String(pin)+\"disabled\", 1);\nmsg.topic = pin;\nmsg.payload = 0;\nreturn msg;\n}\n\n",
  1839. "outputs": 1,
  1840. "noerr": 0,
  1841. "x": 530,
  1842. "y": 900,
  1843. "wires": [
  1844. [
  1845. "306509fc.3b5c5e",
  1846. "137d5803.f2199"
  1847. ]
  1848. ]
  1849. },
  1850. {
  1851. "id": "4dc4fade.04b844",
  1852. "type": "string",
  1853. "z": "368c6b12.3ae6f4",
  1854. "name": "",
  1855. "methods": [
  1856. {
  1857. "name": "ensureRight",
  1858. "params": [
  1859. {
  1860. "type": "str",
  1861. "value": ";"
  1862. }
  1863. ]
  1864. }
  1865. ],
  1866. "prop": "payload",
  1867. "propout": "payload",
  1868. "object": "msg",
  1869. "objectout": "msg",
  1870. "x": 730,
  1871. "y": 960,
  1872. "wires": [
  1873. [
  1874. "c55602d6.eaeb",
  1875. "24c0dd5f.742752"
  1876. ]
  1877. ]
  1878. },
  1879. {
  1880. "id": "12fa773.1516589",
  1881. "type": "switch",
  1882. "z": "368c6b12.3ae6f4",
  1883. "name": "keepalive",
  1884. "property": "payload",
  1885. "propertyType": "msg",
  1886. "rules": [
  1887. {
  1888. "t": "cont",
  1889. "v": "*",
  1890. "vt": "str"
  1891. }
  1892. ],
  1893. "checkall": "true",
  1894. "repair": false,
  1895. "outputs": 1,
  1896. "x": 380,
  1897. "y": 960,
  1898. "wires": [
  1899. [
  1900. "4dc4fade.04b844"
  1901. ]
  1902. ]
  1903. },
  1904. {
  1905. "id": "24c0dd5f.742752",
  1906. "type": "debug",
  1907. "z": "368c6b12.3ae6f4",
  1908. "name": "",
  1909. "active": false,
  1910. "tosidebar": true,
  1911. "console": false,
  1912. "tostatus": false,
  1913. "complete": "false",
  1914. "x": 870,
  1915. "y": 1000,
  1916. "wires": []
  1917. },
  1918. {
  1919. "id": "41ea08e5.849c08",
  1920. "type": "change",
  1921. "z": "368c6b12.3ae6f4",
  1922. "name": "rbe reset",
  1923. "rules": [
  1924. {
  1925. "t": "set",
  1926. "p": "reset",
  1927. "pt": "msg",
  1928. "to": "on",
  1929. "tot": "str"
  1930. }
  1931. ],
  1932. "action": "",
  1933. "property": "",
  1934. "from": "",
  1935. "to": "",
  1936. "reg": false,
  1937. "x": 520,
  1938. "y": 860,
  1939. "wires": [
  1940. [
  1941. "306509fc.3b5c5e"
  1942. ]
  1943. ]
  1944. },
  1945. {
  1946. "id": "c75835f6.090708",
  1947. "type": "inject",
  1948. "z": "368c6b12.3ae6f4",
  1949. "name": "",
  1950. "topic": "",
  1951. "payload": "",
  1952. "payloadType": "date",
  1953. "repeat": "600",
  1954. "crontab": "",
  1955. "once": true,
  1956. "onceDelay": "60",
  1957. "x": 250,
  1958. "y": 860,
  1959. "wires": [
  1960. [
  1961. "41ea08e5.849c08"
  1962. ]
  1963. ]
  1964. },
  1965. {
  1966. "id": "ce0c590e.efa008",
  1967. "type": "debug",
  1968. "z": "368c6b12.3ae6f4",
  1969. "name": "",
  1970. "active": false,
  1971. "tosidebar": true,
  1972. "console": false,
  1973. "tostatus": false,
  1974. "complete": "false",
  1975. "x": 870,
  1976. "y": 920,
  1977. "wires": []
  1978. },
  1979. {
  1980. "id": "47ff9754.f0ae28",
  1981. "type": "delay",
  1982. "z": "368c6b12.3ae6f4",
  1983. "name": "limit",
  1984. "pauseType": "rate",
  1985. "timeout": "0",
  1986. "timeoutUnits": "seconds",
  1987. "rate": "1",
  1988. "nbRateUnits": "60",
  1989. "rateUnits": "second",
  1990. "randomFirst": "1",
  1991. "randomLast": "5",
  1992. "randomUnits": "seconds",
  1993. "drop": true,
  1994. "x": 410,
  1995. "y": 280,
  1996. "wires": [
  1997. [
  1998. "d4df721b.34af"
  1999. ]
  2000. ]
  2001. },
  2002. {
  2003. "id": "1849cdac.6051b2",
  2004. "type": "delay",
  2005. "z": "368c6b12.3ae6f4",
  2006. "name": "limit",
  2007. "pauseType": "rate",
  2008. "timeout": "0",
  2009. "timeoutUnits": "seconds",
  2010. "rate": "1",
  2011. "nbRateUnits": "60",
  2012. "rateUnits": "second",
  2013. "randomFirst": "1",
  2014. "randomLast": "5",
  2015. "randomUnits": "seconds",
  2016. "drop": true,
  2017. "x": 410,
  2018. "y": 180,
  2019. "wires": [
  2020. [
  2021. "2be0985d.8818e8"
  2022. ]
  2023. ]
  2024. },
  2025. {
  2026. "id": "3d95c515.4187ba",
  2027. "type": "function",
  2028. "z": "368c6b12.3ae6f4",
  2029. "name": "disable",
  2030. "func": "var str = msg.payload\nif (str.indexOf(\"/\") >= 0) {\n var firstq = str.indexOf(\"?\")\n var firstw = str.indexOf(\"!\")\n var slashpart\n if (firstq >= 0 || firstw >= 0) {\n if (firstw > firstq) {\n slashpart = str.slice(0, firstw)\n }\n if (firstq > firstw) {\n if (firstw > -1) { \n slashpart = str.slice(0, firstw)\n }\n if (firstw == -1) { \n slashpart = str.slice(0, firstq)\n }\n }\n msg.payload = slashpart\n return msg;\n }\n else {\n msg.payload = str\n }\n return msg;\n}\n",
  2031. "outputs": 1,
  2032. "noerr": 0,
  2033. "x": 240,
  2034. "y": 900,
  2035. "wires": [
  2036. [
  2037. "35844c6e.bcd07c"
  2038. ]
  2039. ]
  2040. },
  2041. {
  2042. "id": "e42edb68.196658",
  2043. "type": "delay",
  2044. "z": "368c6b12.3ae6f4",
  2045. "name": "limit",
  2046. "pauseType": "rate",
  2047. "timeout": "0",
  2048. "timeoutUnits": "seconds",
  2049. "rate": "1",
  2050. "nbRateUnits": "2",
  2051. "rateUnits": "second",
  2052. "randomFirst": "1",
  2053. "randomLast": "5",
  2054. "randomUnits": "seconds",
  2055. "drop": false,
  2056. "x": 410,
  2057. "y": 20,
  2058. "wires": [
  2059. [
  2060. "e38efb94.440698"
  2061. ]
  2062. ]
  2063. },
  2064. {
  2065. "id": "f3ed6fc1.a6822",
  2066. "type": "delay",
  2067. "z": "368c6b12.3ae6f4",
  2068. "name": "limit",
  2069. "pauseType": "rate",
  2070. "timeout": "0",
  2071. "timeoutUnits": "seconds",
  2072. "rate": "1",
  2073. "nbRateUnits": "2",
  2074. "rateUnits": "second",
  2075. "randomFirst": "1",
  2076. "randomLast": "5",
  2077. "randomUnits": "seconds",
  2078. "drop": false,
  2079. "x": 410,
  2080. "y": 140,
  2081. "wires": [
  2082. [
  2083. "1cb68ce9.48f553"
  2084. ]
  2085. ]
  2086. },
  2087. {
  2088. "id": "e15967f2.8aa848",
  2089. "type": "mqtt-broker",
  2090. "z": "",
  2091. "name": "",
  2092. "broker": "localhost",
  2093. "port": "1883",
  2094. "clientid": "",
  2095. "usetls": false,
  2096. "compatmode": true,
  2097. "keepalive": "60",
  2098. "cleansession": true,
  2099. "birthTopic": "",
  2100. "birthQos": "0",
  2101. "birthPayload": "",
  2102. "closeTopic": "",
  2103. "closeQos": "0",
  2104. "closePayload": "",
  2105. "willTopic": "",
  2106. "willQos": "0",
  2107. "willPayload": ""
  2108. }
  2109. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement