Advertisement
poldim

node flow for furnace diagnostic code

Dec 26th, 2020 (edited)
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.68 KB | None | 0 0
  1. [
  2. {
  3. "id": "e879a259.a179b",
  4. "type": "debug",
  5. "z": "2745fc07.7d2274",
  6. "name": "",
  7. "active": false,
  8. "tosidebar": true,
  9. "console": false,
  10. "tostatus": false,
  11. "complete": "count",
  12. "targetType": "msg",
  13. "statusVal": "",
  14. "statusType": "auto",
  15. "x": 1190,
  16. "y": 3470,
  17. "wires": []
  18. },
  19. {
  20. "id": "9be54c36.45007",
  21. "type": "change",
  22. "z": "2745fc07.7d2274",
  23. "name": "",
  24. "rules": [
  25. {
  26. "t": "set",
  27. "p": "reset",
  28. "pt": "msg",
  29. "to": "reset",
  30. "tot": "str"
  31. }
  32. ],
  33. "action": "",
  34. "property": "",
  35. "from": "",
  36. "to": "",
  37. "reg": false,
  38. "x": 690,
  39. "y": 3390,
  40. "wires": [
  41. [
  42. "7d3aff09.54a18"
  43. ]
  44. ]
  45. },
  46. {
  47. "id": "4a411474.7146cc",
  48. "type": "switch",
  49. "z": "2745fc07.7d2274",
  50. "name": "",
  51. "property": "count",
  52. "propertyType": "msg",
  53. "rules": [
  54. {
  55. "t": "nnull"
  56. }
  57. ],
  58. "checkall": "true",
  59. "repair": false,
  60. "outputs": 1,
  61. "x": 690,
  62. "y": 3450,
  63. "wires": [
  64. [
  65. "86a6c2ae.7f3d9",
  66. "dfd3507e.770a5"
  67. ]
  68. ]
  69. },
  70. {
  71. "id": "86a6c2ae.7f3d9",
  72. "type": "join",
  73. "z": "2745fc07.7d2274",
  74. "name": "",
  75. "mode": "custom",
  76. "build": "string",
  77. "property": "count",
  78. "propertyType": "msg",
  79. "key": "topic",
  80. "joiner": "",
  81. "joinerType": "str",
  82. "accumulate": false,
  83. "timeout": "",
  84. "count": "2",
  85. "reduceRight": false,
  86. "reduceExp": "",
  87. "reduceInit": "",
  88. "reduceInitType": "num",
  89. "reduceFixup": "",
  90. "x": 970,
  91. "y": 3500,
  92. "wires": [
  93. [
  94. "e879a259.a179b",
  95. "47a68f2c.5b895"
  96. ]
  97. ]
  98. },
  99. {
  100. "id": "b7d9faf6.c4baf8",
  101. "type": "switch",
  102. "z": "2745fc07.7d2274",
  103. "name": "",
  104. "property": "count",
  105. "propertyType": "msg",
  106. "rules": [
  107. {
  108. "t": "nnull"
  109. }
  110. ],
  111. "checkall": "true",
  112. "repair": false,
  113. "outputs": 1,
  114. "x": 700,
  115. "y": 3670,
  116. "wires": [
  117. [
  118. "86a6c2ae.7f3d9",
  119. "e0352e74.fb529"
  120. ]
  121. ]
  122. },
  123. {
  124. "id": "9048d542.dfa238",
  125. "type": "change",
  126. "z": "2745fc07.7d2274",
  127. "name": "",
  128. "rules": [
  129. {
  130. "t": "set",
  131. "p": "reset",
  132. "pt": "msg",
  133. "to": "reset",
  134. "tot": "str"
  135. }
  136. ],
  137. "action": "",
  138. "property": "",
  139. "from": "",
  140. "to": "",
  141. "reg": false,
  142. "x": 690,
  143. "y": 3620,
  144. "wires": [
  145. [
  146. "2d39fc3c.1b3964"
  147. ]
  148. ]
  149. },
  150. {
  151. "id": "b4f54f27.13f1a",
  152. "type": "interval-length",
  153. "z": "2745fc07.7d2274",
  154. "format": "mills",
  155. "bytopic": false,
  156. "minimum": "150",
  157. "maximum": "350",
  158. "window": "",
  159. "timeout": true,
  160. "msgTimeout": "950",
  161. "minimumunit": "msecs",
  162. "maximumunit": "msecs",
  163. "windowunit": "msecs",
  164. "msgTimeoutUnit": "msecs",
  165. "reset": true,
  166. "startup": false,
  167. "msgField": "payload",
  168. "timestampField": "timestamp",
  169. "repeatTimeout": false,
  170. "name": "",
  171. "x": 450,
  172. "y": 3390,
  173. "wires": [
  174. [
  175. "7d3aff09.54a18"
  176. ],
  177. [
  178. "9be54c36.45007",
  179. "4a411474.7146cc"
  180. ]
  181. ]
  182. },
  183. {
  184. "id": "4da722d2.e7ae5c",
  185. "type": "interval-length",
  186. "z": "2745fc07.7d2274",
  187. "format": "mills",
  188. "bytopic": false,
  189. "minimum": "900",
  190. "maximum": "1100",
  191. "window": "",
  192. "timeout": false,
  193. "msgTimeout": "1150",
  194. "minimumunit": "msecs",
  195. "maximumunit": "msecs",
  196. "windowunit": "msecs",
  197. "msgTimeoutUnit": "msecs",
  198. "reset": false,
  199. "startup": false,
  200. "msgField": "payload",
  201. "timestampField": "timestamp",
  202. "repeatTimeout": false,
  203. "name": "",
  204. "x": 450,
  205. "y": 3640,
  206. "wires": [
  207. [
  208. "2d39fc3c.1b3964"
  209. ],
  210. [
  211. "b7d9faf6.c4baf8",
  212. "9048d542.dfa238"
  213. ]
  214. ]
  215. },
  216. {
  217. "id": "7d3aff09.54a18",
  218. "type": "counter",
  219. "z": "2745fc07.7d2274",
  220. "name": "",
  221. "init": "0",
  222. "step": "1",
  223. "lower": null,
  224. "upper": null,
  225. "mode": "increment",
  226. "outputs": "1",
  227. "x": 690,
  228. "y": 3330,
  229. "wires": [
  230. []
  231. ]
  232. },
  233. {
  234. "id": "2d39fc3c.1b3964",
  235. "type": "counter",
  236. "z": "2745fc07.7d2274",
  237. "name": "",
  238. "init": "0",
  239. "step": "1",
  240. "lower": null,
  241. "upper": null,
  242. "mode": "increment",
  243. "outputs": "1",
  244. "x": 690,
  245. "y": 3560,
  246. "wires": [
  247. []
  248. ]
  249. },
  250. {
  251. "id": "dc79cd19.19527",
  252. "type": "server-state-changed",
  253. "z": "2745fc07.7d2274",
  254. "name": "Diagnostic LED",
  255. "server": "c75798f0.9eb148",
  256. "version": 1,
  257. "exposeToHomeAssistant": false,
  258. "haConfig": [
  259. {
  260. "property": "name",
  261. "value": ""
  262. },
  263. {
  264. "property": "icon",
  265. "value": ""
  266. }
  267. ],
  268. "entityidfilter": "binary_sensor.heater_diagnostic_led",
  269. "entityidfiltertype": "exact",
  270. "outputinitially": false,
  271. "state_type": "str",
  272. "haltifstate": "",
  273. "halt_if_type": "str",
  274. "halt_if_compare": "is",
  275. "outputs": 1,
  276. "output_only_on_state_change": true,
  277. "for": 0,
  278. "forType": "num",
  279. "forUnits": "minutes",
  280. "ignorePrevStateNull": false,
  281. "ignorePrevStateUnknown": false,
  282. "ignorePrevStateUnavailable": false,
  283. "ignoreCurrentStateUnknown": true,
  284. "ignoreCurrentStateUnavailable": true,
  285. "x": 230,
  286. "y": 3500,
  287. "wires": [
  288. [
  289. "b4f54f27.13f1a",
  290. "4da722d2.e7ae5c",
  291. "1e8769f5.c3df26"
  292. ]
  293. ]
  294. },
  295. {
  296. "id": "1e8769f5.c3df26",
  297. "type": "trigger",
  298. "z": "2745fc07.7d2274",
  299. "name": "Reset after 5 min",
  300. "op1": "",
  301. "op2": "true",
  302. "op1type": "nul",
  303. "op2type": "bool",
  304. "duration": "5",
  305. "extend": true,
  306. "overrideDelay": false,
  307. "units": "min",
  308. "reset": "",
  309. "bytopic": "all",
  310. "topic": "topic",
  311. "outputs": 1,
  312. "x": 460,
  313. "y": 3500,
  314. "wires": [
  315. [
  316. "a9c4a845.7b3138"
  317. ]
  318. ]
  319. },
  320. {
  321. "id": "47a68f2c.5b895",
  322. "type": "api-call-service",
  323. "z": "2745fc07.7d2274",
  324. "name": "Select Code",
  325. "server": "c75798f0.9eb148",
  326. "version": 1,
  327. "debugenabled": false,
  328. "service_domain": "input_number",
  329. "service": "set_value",
  330. "entityId": "input_number.heater_diagnostic_code",
  331. "data": "{\"value\":\"{{count}}\"}",
  332. "dataType": "json",
  333. "mergecontext": "",
  334. "output_location": "",
  335. "output_location_type": "none",
  336. "mustacheAltTags": false,
  337. "x": 1190,
  338. "y": 3520,
  339. "wires": [
  340. []
  341. ]
  342. },
  343. {
  344. "id": "a9c4a845.7b3138",
  345. "type": "api-call-service",
  346. "z": "2745fc07.7d2274",
  347. "name": "Select Code",
  348. "server": "c75798f0.9eb148",
  349. "version": 1,
  350. "debugenabled": false,
  351. "service_domain": "input_number",
  352. "service": "set_value",
  353. "entityId": "input_number.heater_diagnostic_code",
  354. "data": "{\"value\":\"0\"}",
  355. "dataType": "json",
  356. "mergecontext": "",
  357. "output_location": "",
  358. "output_location_type": "none",
  359. "mustacheAltTags": false,
  360. "x": 660,
  361. "y": 3500,
  362. "wires": [
  363. []
  364. ]
  365. },
  366. {
  367. "id": "dfd3507e.770a5",
  368. "type": "function",
  369. "z": "2745fc07.7d2274",
  370. "name": "",
  371. "func": "var counting = function () {\n let digit = flow.get('led_code');\n node.status({fill:\"red\",shape:\"dot\",text:\"First: \" + digit});\n // flow.set('count',counter);\n clearInterval(flow.get('timer1'));\n node.send(msg);\n return digit;\n\n // if (counter === 0) {\n // clearInterval(flow.get('timer1'));\n // node.status({fill:\"green\",shape:\"dot\",text: \"Finished\"});\n // node.send(msg);\n // return led_code;\n // } else {\n // clearInterval(flow.get('timer1')); \n // node.send(msg);\n // return led_code;\n // }\n}\n\nif (typeof msg.payload === 'number') {\n flow.set('led_code',msg.count);\n // node.status({text: \"Starting\"}); \n let timer1 = setInterval(counting, 1);\n flow.set('timer1',timer1);\n} else if (msg.payload === \"stop\") {\n node.status({}); // clear the status decoration\n clearInterval(flow.get('timer1')); \n \n}\n",
  372. "outputs": 1,
  373. "noerr": 0,
  374. "initialize": "",
  375. "finalize": "",
  376. "x": 1180,
  377. "y": 3340,
  378. "wires": [
  379. []
  380. ]
  381. },
  382. {
  383. "id": "e0352e74.fb529",
  384. "type": "function",
  385. "z": "2745fc07.7d2274",
  386. "name": "",
  387. "func": "var counting = function () {\n let digit = flow.get('led_code');\n node.status({fill:\"red\",shape:\"dot\",text:\"Second: \" + digit});\n // flow.set('count',counter);\n clearInterval(flow.get('timer1'));\n node.send(msg);\n return digit;\n\n // if (counter === 0) {\n // clearInterval(flow.get('timer1'));\n // node.status({fill:\"green\",shape:\"dot\",text: \"Finished\"});\n // node.send(msg);\n // return led_code;\n // } else {\n // clearInterval(flow.get('timer1')); \n // node.send(msg);\n // return led_code;\n // }\n}\n\nif (typeof msg.payload === 'number') {\n flow.set('led_code',msg.count);\n // node.status({text: \"Starting\"}); \n let timer1 = setInterval(counting, 1);\n flow.set('timer1',timer1);\n} else if (msg.payload === \"stop\") {\n node.status({}); // clear the status decoration\n clearInterval(flow.get('timer1')); \n \n}\n",
  388. "outputs": 1,
  389. "noerr": 0,
  390. "initialize": "",
  391. "finalize": "",
  392. "x": 1180,
  393. "y": 3390,
  394. "wires": [
  395. []
  396. ]
  397. },
  398. {
  399. "id": "c75798f0.9eb148",
  400. "type": "server",
  401. "name": "Home Assistant Synology",
  402. "legacy": false,
  403. "addon": false,
  404. "rejectUnauthorizedCerts": false,
  405. "ha_boolean": "y|yes|true|on|ON|home|open",
  406. "connectionDelay": true,
  407. "cacheJson": true
  408. }
  409. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement