Guest User

Node red Daikin flow

a guest
Jun 29th, 2022
212
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 17.46 KB | None | 0 0
  1. [
  2. {
  3. "id": "bc97e132f9f1e7a6",
  4. "type": "tab",
  5. "label": "Flow 1",
  6. "disabled": false,
  7. "info": "",
  8. "env": []
  9. },
  10. {
  11. "id": "2f32594cf61bd0ed",
  12. "type": "mqtt in",
  13. "z": "bc97e132f9f1e7a6",
  14. "name": "Voltage Daikin",
  15. "topic": "espaltherma/OneATTR/Voltage (N-phase) (V)",
  16. "qos": "2",
  17. "datatype": "auto",
  18. "broker": "d60722c4841f7d9f",
  19. "nl": false,
  20. "rap": true,
  21. "rh": 0,
  22. "inputs": 0,
  23. "x": 330,
  24. "y": 220,
  25. "wires": [
  26. [
  27. "dbe495c2f02ac6e0"
  28. ]
  29. ]
  30. },
  31. {
  32. "id": "ed83aaf8ee3d60aa",
  33. "type": "mqtt out",
  34. "z": "bc97e132f9f1e7a6",
  35. "name": "To Domoticz",
  36. "topic": "domoticz/in",
  37. "qos": "",
  38. "retain": "",
  39. "respTopic": "",
  40. "contentType": "",
  41. "userProps": "",
  42. "correl": "",
  43. "expiry": "",
  44. "broker": "d60722c4841f7d9f",
  45. "x": 1290,
  46. "y": 460,
  47. "wires": []
  48. },
  49. {
  50. "id": "dbe495c2f02ac6e0",
  51. "type": "template",
  52. "z": "bc97e132f9f1e7a6",
  53. "name": "",
  54. "field": "payload",
  55. "fieldType": "msg",
  56. "format": "handlebars",
  57. "syntax": "mustache",
  58. "template": "{ \"command\": \"udevice\", \"idx\" : 1, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  59. "output": "json",
  60. "x": 820,
  61. "y": 220,
  62. "wires": [
  63. [
  64. "ed83aaf8ee3d60aa"
  65. ]
  66. ]
  67. },
  68. {
  69. "id": "5c50985ab0857e3c",
  70. "type": "mqtt in",
  71. "z": "bc97e132f9f1e7a6",
  72. "name": "Current Daikin",
  73. "topic": "espaltherma/OneATTR/INV primary current (A)",
  74. "qos": "2",
  75. "datatype": "auto",
  76. "broker": "d60722c4841f7d9f",
  77. "nl": false,
  78. "rap": true,
  79. "rh": 0,
  80. "inputs": 0,
  81. "x": 330,
  82. "y": 280,
  83. "wires": [
  84. [
  85. "65f21b9a0943ab50",
  86. "c3733755aed5ac80"
  87. ]
  88. ]
  89. },
  90. {
  91. "id": "65f21b9a0943ab50",
  92. "type": "template",
  93. "z": "bc97e132f9f1e7a6",
  94. "name": "",
  95. "field": "payload",
  96. "fieldType": "msg",
  97. "format": "handlebars",
  98. "syntax": "mustache",
  99. "template": "{ \"command\": \"udevice\", \"idx\" : 2, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  100. "output": "json",
  101. "x": 820,
  102. "y": 280,
  103. "wires": [
  104. [
  105. "ed83aaf8ee3d60aa"
  106. ]
  107. ]
  108. },
  109. {
  110. "id": "c3733755aed5ac80",
  111. "type": "function",
  112. "z": "bc97e132f9f1e7a6",
  113. "name": "Wattage",
  114. "func": "context.amp = context.amp || 0.0;\ncontext.volt = context.volt || 0.0;\n\nif (msg.topic === 'espaltherma/OneATTR/Voltage (N-phase) (V)') {\n context.volt = Number(msg.payload);\n} else if (msg.topic === 'espaltherma/OneATTR/INV primary current (A)') {\n context.amp = Number(msg.payload);\n}\n\nreturn {topic: 'power', payload: context.amp * 230};\n",
  115. "outputs": 1,
  116. "noerr": 0,
  117. "initialize": "",
  118. "finalize": "",
  119. "libs": [],
  120. "x": 560,
  121. "y": 360,
  122. "wires": [
  123. [
  124. "b7f4e57a98974bd6",
  125. "01cc553052292500",
  126. "d814d63c.fc96e8"
  127. ]
  128. ]
  129. },
  130. {
  131. "id": "b7f4e57a98974bd6",
  132. "type": "template",
  133. "z": "bc97e132f9f1e7a6",
  134. "name": "",
  135. "field": "payload",
  136. "fieldType": "msg",
  137. "format": "handlebars",
  138. "syntax": "mustache",
  139. "template": "{ \"command\": \"udevice\", \"idx\" : 3, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  140. "output": "json",
  141. "x": 820,
  142. "y": 360,
  143. "wires": [
  144. [
  145. "ed83aaf8ee3d60aa"
  146. ]
  147. ]
  148. },
  149. {
  150. "id": "a2b9540e857e8a61",
  151. "type": "mqtt in",
  152. "z": "bc97e132f9f1e7a6",
  153. "name": "Inlet water temp",
  154. "topic": "espaltherma/OneATTR/Inlet water temp.(R4T)",
  155. "qos": "2",
  156. "datatype": "auto",
  157. "broker": "d60722c4841f7d9f",
  158. "nl": false,
  159. "rap": true,
  160. "rh": 0,
  161. "inputs": 0,
  162. "x": 300,
  163. "y": 480,
  164. "wires": [
  165. [
  166. "5185061f3e90050e",
  167. "cc3c0bfd0cb17e6d",
  168. "238922bff0416c05"
  169. ]
  170. ]
  171. },
  172. {
  173. "id": "e4bad7c7cafb1ffd",
  174. "type": "mqtt in",
  175. "z": "bc97e132f9f1e7a6",
  176. "name": "Leaving after BUH",
  177. "topic": "espaltherma/OneATTR/Leaving water temp. after BUH (R2T)",
  178. "qos": "2",
  179. "datatype": "auto",
  180. "broker": "d60722c4841f7d9f",
  181. "nl": false,
  182. "rap": true,
  183. "rh": 0,
  184. "inputs": 0,
  185. "x": 290,
  186. "y": 420,
  187. "wires": [
  188. [
  189. "5185061f3e90050e",
  190. "2e47b7597f301d02",
  191. "238922bff0416c05"
  192. ]
  193. ]
  194. },
  195. {
  196. "id": "6502d87b2a7147fb",
  197. "type": "mqtt in",
  198. "z": "bc97e132f9f1e7a6",
  199. "name": "Flowrate",
  200. "topic": "espaltherma/OneATTR/Flow sensor (l/min)",
  201. "qos": "2",
  202. "datatype": "auto",
  203. "broker": "d60722c4841f7d9f",
  204. "nl": false,
  205. "rap": true,
  206. "rh": 0,
  207. "inputs": 0,
  208. "x": 320,
  209. "y": 540,
  210. "wires": [
  211. [
  212. "3b87994cc91c5633",
  213. "5185061f3e90050e"
  214. ]
  215. ]
  216. },
  217. {
  218. "id": "11d9495635869480",
  219. "type": "mqtt in",
  220. "z": "bc97e132f9f1e7a6",
  221. "name": "DHW temp",
  222. "topic": "espaltherma/OneATTR/DHW tank temp. (R5T)",
  223. "qos": "2",
  224. "datatype": "auto",
  225. "broker": "d60722c4841f7d9f",
  226. "nl": false,
  227. "rap": true,
  228. "rh": 0,
  229. "inputs": 0,
  230. "x": 320,
  231. "y": 800,
  232. "wires": [
  233. [
  234. "7c228a098ed0a307"
  235. ]
  236. ]
  237. },
  238. {
  239. "id": "5185061f3e90050e",
  240. "type": "function",
  241. "z": "bc97e132f9f1e7a6",
  242. "name": "Heat production",
  243. "func": "context.inlet = context.inlet || 0.0;\ncontext.outlet = context.outlet || 0.0;\ncontext.test = context.test || 0.0;\noutput = 0.0;\n\nif (msg.topic === 'espaltherma/OneATTR/Inlet water temp.(R4T)') {\n context.inlet = Number(msg.payload);\n} else if (msg.topic === 'espaltherma/OneATTR/Leaving water temp. after BUH (R2T)') {\n context.outlet = Number(msg.payload);\n} else if (msg.topic === 'espaltherma/OneATTR/Flow sensor (l/min)') {\n context.test = Number(msg.payload);\n} \n\noutput = (context.outlet - context.inlet) * context.test * 69.7;\n\nif (msg.topic === 'espaltherma/OneATTR/Inlet water temp.(R4T)') {\n return {topic: 'Heat production', payload: output};\n}",
  244. "outputs": 1,
  245. "noerr": 0,
  246. "initialize": "",
  247. "finalize": "",
  248. "libs": [],
  249. "x": 540,
  250. "y": 600,
  251. "wires": [
  252. [
  253. "bf4cae082cae34fe",
  254. "01cc553052292500",
  255. "17cf50e57040f2da"
  256. ]
  257. ]
  258. },
  259. {
  260. "id": "bf4cae082cae34fe",
  261. "type": "template",
  262. "z": "bc97e132f9f1e7a6",
  263. "name": "",
  264. "field": "payload",
  265. "fieldType": "msg",
  266. "format": "handlebars",
  267. "syntax": "mustache",
  268. "template": "{ \"command\": \"udevice\", \"idx\" : 4, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  269. "output": "json",
  270. "x": 820,
  271. "y": 600,
  272. "wires": [
  273. [
  274. "ed83aaf8ee3d60aa"
  275. ]
  276. ]
  277. },
  278. {
  279. "id": "3b87994cc91c5633",
  280. "type": "template",
  281. "z": "bc97e132f9f1e7a6",
  282. "name": "",
  283. "field": "payload",
  284. "fieldType": "msg",
  285. "format": "handlebars",
  286. "syntax": "mustache",
  287. "template": "{ \"command\": \"udevice\", \"idx\" : 7, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  288. "output": "json",
  289. "x": 820,
  290. "y": 540,
  291. "wires": [
  292. [
  293. "ed83aaf8ee3d60aa"
  294. ]
  295. ]
  296. },
  297. {
  298. "id": "cc3c0bfd0cb17e6d",
  299. "type": "template",
  300. "z": "bc97e132f9f1e7a6",
  301. "name": "",
  302. "field": "payload",
  303. "fieldType": "msg",
  304. "format": "handlebars",
  305. "syntax": "mustache",
  306. "template": "{ \"command\": \"udevice\", \"idx\" : 5, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  307. "output": "json",
  308. "x": 820,
  309. "y": 480,
  310. "wires": [
  311. [
  312. "ed83aaf8ee3d60aa"
  313. ]
  314. ]
  315. },
  316. {
  317. "id": "2e47b7597f301d02",
  318. "type": "template",
  319. "z": "bc97e132f9f1e7a6",
  320. "name": "",
  321. "field": "payload",
  322. "fieldType": "msg",
  323. "format": "handlebars",
  324. "syntax": "mustache",
  325. "template": "{ \"command\": \"udevice\", \"idx\" : 6, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  326. "output": "json",
  327. "x": 820,
  328. "y": 420,
  329. "wires": [
  330. [
  331. "ed83aaf8ee3d60aa"
  332. ]
  333. ]
  334. },
  335. {
  336. "id": "7c228a098ed0a307",
  337. "type": "template",
  338. "z": "bc97e132f9f1e7a6",
  339. "name": "",
  340. "field": "payload",
  341. "fieldType": "msg",
  342. "format": "handlebars",
  343. "syntax": "mustache",
  344. "template": "{ \"command\": \"udevice\", \"idx\" : 9, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  345. "output": "json",
  346. "x": 820,
  347. "y": 800,
  348. "wires": [
  349. [
  350. "ed83aaf8ee3d60aa"
  351. ]
  352. ]
  353. },
  354. {
  355. "id": "01cc553052292500",
  356. "type": "function",
  357. "z": "bc97e132f9f1e7a6",
  358. "name": "COP",
  359. "func": "context.heat = context.heat || 0.0;\ncontext.power = context.power || 0.0;\noutput = 0.0\n\nif (msg.topic === 'Heat production') {\n context.heat = msg.payload;\n} else if (msg.topic === 'power') {\n context.power = msg.payload;\n}\n\nif (!context.power) {\n output = 0;\n} else {\n output = context.heat / context.power;\n}\n\nif (msg.topic === 'power') {\n return {topic: 'COP', payload: output};\n}",
  360. "outputs": 1,
  361. "noerr": 0,
  362. "initialize": "",
  363. "finalize": "",
  364. "libs": [],
  365. "x": 710,
  366. "y": 660,
  367. "wires": [
  368. [
  369. "41718e3fc8867361"
  370. ]
  371. ]
  372. },
  373. {
  374. "id": "41718e3fc8867361",
  375. "type": "template",
  376. "z": "bc97e132f9f1e7a6",
  377. "name": "",
  378. "field": "payload",
  379. "fieldType": "msg",
  380. "format": "handlebars",
  381. "syntax": "mustache",
  382. "template": "{ \"command\": \"udevice\", \"idx\" : 10, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  383. "output": "json",
  384. "x": 880,
  385. "y": 660,
  386. "wires": [
  387. [
  388. "ed83aaf8ee3d60aa"
  389. ]
  390. ]
  391. },
  392. {
  393. "id": "238922bff0416c05",
  394. "type": "function",
  395. "z": "bc97e132f9f1e7a6",
  396. "name": "Delta T",
  397. "func": "context.inlet = context.inlet || 0.0;\ncontext.outlet = context.outlet || 0.0;\noutput = 0.0;\n\nif (msg.topic === 'espaltherma/OneATTR/Inlet water temp.(R4T)') {\n context.inlet = Number(msg.payload);\n} else if (msg.topic === 'espaltherma/OneATTR/Leaving water temp. after BUH (R2T)') {\n context.outlet = Number(msg.payload);\n} \n\noutput = (context.outlet - context.inlet);\n\nif (msg.topic === 'espaltherma/OneATTR/Inlet water temp.(R4T)') {\n return {topic: 'Heat production', payload: output};\n}",
  398. "outputs": 1,
  399. "noerr": 0,
  400. "initialize": "",
  401. "finalize": "",
  402. "libs": [],
  403. "x": 520,
  404. "y": 740,
  405. "wires": [
  406. [
  407. "96ead7c7fd3cf9c8"
  408. ]
  409. ]
  410. },
  411. {
  412. "id": "96ead7c7fd3cf9c8",
  413. "type": "template",
  414. "z": "bc97e132f9f1e7a6",
  415. "name": "",
  416. "field": "payload",
  417. "fieldType": "msg",
  418. "format": "handlebars",
  419. "syntax": "mustache",
  420. "template": "{ \"command\": \"udevice\", \"idx\" : 11, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  421. "output": "json",
  422. "x": 820,
  423. "y": 740,
  424. "wires": [
  425. [
  426. "ed83aaf8ee3d60aa"
  427. ]
  428. ]
  429. },
  430. {
  431. "id": "1bf0b5e4.35c0ea",
  432. "type": "function",
  433. "z": "bc97e132f9f1e7a6",
  434. "name": "kWh",
  435. "func": " var grid = msg.payload;\n \n //Find time since last update\n\t\tvar updateTime = msg.myepoch;\n\t\tvar lastTime = flow.get('lastTime2')||updateTime;\n\t\tvar t = updateTime-lastTime;\n\t\tflow.set(\"lastTime2\",updateTime);\n\n // Energy calculations\n\t\twatthr = (t*grid)/3600000;\n\t\t\n return {topic: 'Powerused', payload: watthr/1000};",
  436. "outputs": 1,
  437. "noerr": 0,
  438. "initialize": "",
  439. "finalize": "",
  440. "libs": [],
  441. "x": 650,
  442. "y": 940,
  443. "wires": [
  444. [
  445. "45333d690d81c74b"
  446. ]
  447. ]
  448. },
  449. {
  450. "id": "d814d63c.fc96e8",
  451. "type": "simpletime",
  452. "z": "bc97e132f9f1e7a6",
  453. "name": "",
  454. "mydate": true,
  455. "myymd": true,
  456. "myyear": true,
  457. "mymonth": true,
  458. "mymonthn": true,
  459. "mydom": true,
  460. "mydoy": true,
  461. "myday": true,
  462. "myhourpm": true,
  463. "myhour": true,
  464. "mytime": true,
  465. "mytimes": true,
  466. "myminute": true,
  467. "myminutes": true,
  468. "mysecond": true,
  469. "mymillis": true,
  470. "myepoch": true,
  471. "myrawdate": true,
  472. "mypm": true,
  473. "x": 490,
  474. "y": 940,
  475. "wires": [
  476. [
  477. "1bf0b5e4.35c0ea"
  478. ]
  479. ]
  480. },
  481. {
  482. "id": "45333d690d81c74b",
  483. "type": "template",
  484. "z": "bc97e132f9f1e7a6",
  485. "name": "",
  486. "field": "payload",
  487. "fieldType": "msg",
  488. "format": "handlebars",
  489. "syntax": "mustache",
  490. "template": "{ \"command\": \"udevice\", \"idx\" : 12, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  491. "output": "json",
  492. "x": 820,
  493. "y": 940,
  494. "wires": [
  495. [
  496. "ed83aaf8ee3d60aa"
  497. ]
  498. ]
  499. },
  500. {
  501. "id": "63c1ad91f43a2de2",
  502. "type": "function",
  503. "z": "bc97e132f9f1e7a6",
  504. "name": "kWh",
  505. "func": " var grid = msg.payload;\n \n //Find time since last update\n\t\tvar updateTime = msg.myepoch;\n\t\tvar lastTime = flow.get('lastTime2')||updateTime;\n\t\tvar t = updateTime-lastTime;\n\t\tflow.set(\"lastTime2\",updateTime);\n\n // Energy calculations\n\t\twatthr = (t*grid)/3600000;\n\t\t\n return {topic: 'Powerused', payload: watthr/1000};",
  506. "outputs": 1,
  507. "noerr": 0,
  508. "initialize": "",
  509. "finalize": "",
  510. "libs": [],
  511. "x": 650,
  512. "y": 1020,
  513. "wires": [
  514. [
  515. "3dc41d547d2a95af"
  516. ]
  517. ]
  518. },
  519. {
  520. "id": "17cf50e57040f2da",
  521. "type": "simpletime",
  522. "z": "bc97e132f9f1e7a6",
  523. "name": "",
  524. "mydate": true,
  525. "myymd": true,
  526. "myyear": true,
  527. "mymonth": true,
  528. "mymonthn": true,
  529. "mydom": true,
  530. "mydoy": true,
  531. "myday": true,
  532. "myhourpm": true,
  533. "myhour": true,
  534. "mytime": true,
  535. "mytimes": true,
  536. "myminute": true,
  537. "myminutes": true,
  538. "mysecond": true,
  539. "mymillis": true,
  540. "myepoch": true,
  541. "myrawdate": true,
  542. "mypm": true,
  543. "x": 490,
  544. "y": 1020,
  545. "wires": [
  546. [
  547. "63c1ad91f43a2de2"
  548. ]
  549. ]
  550. },
  551. {
  552. "id": "3dc41d547d2a95af",
  553. "type": "template",
  554. "z": "bc97e132f9f1e7a6",
  555. "name": "",
  556. "field": "payload",
  557. "fieldType": "msg",
  558. "format": "handlebars",
  559. "syntax": "mustache",
  560. "template": "{ \"command\": \"udevice\", \"idx\" : 13, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
  561. "output": "json",
  562. "x": 820,
  563. "y": 1020,
  564. "wires": [
  565. [
  566. "ed83aaf8ee3d60aa"
  567. ]
  568. ]
  569. },
  570. {
  571. "id": "d60722c4841f7d9f",
  572. "type": "mqtt-broker",
  573. "name": "Mosquitto",
  574. "broker": "localhost",
  575. "port": "1883",
  576. "clientid": "NodeRed",
  577. "autoConnect": true,
  578. "usetls": false,
  579. "protocolVersion": "4",
  580. "keepalive": "60",
  581. "cleansession": true,
  582. "birthTopic": "",
  583. "birthQos": "0",
  584. "birthPayload": "",
  585. "birthMsg": {},
  586. "closeTopic": "",
  587. "closeQos": "0",
  588. "closePayload": "",
  589. "closeMsg": {},
  590. "willTopic": "",
  591. "willQos": "0",
  592. "willPayload": "",
  593. "willMsg": {},
  594. "sessionExpiry": ""
  595. }
  596. ]
Advertisement
Add Comment
Please, Sign In to add comment