Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [
- {
- "id": "bc97e132f9f1e7a6",
- "type": "tab",
- "label": "Flow 1",
- "disabled": false,
- "info": "",
- "env": []
- },
- {
- "id": "2f32594cf61bd0ed",
- "type": "mqtt in",
- "z": "bc97e132f9f1e7a6",
- "name": "Voltage Daikin",
- "topic": "espaltherma/OneATTR/Voltage (N-phase) (V)",
- "qos": "2",
- "datatype": "auto",
- "broker": "d60722c4841f7d9f",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 330,
- "y": 220,
- "wires": [
- [
- "dbe495c2f02ac6e0"
- ]
- ]
- },
- {
- "id": "ed83aaf8ee3d60aa",
- "type": "mqtt out",
- "z": "bc97e132f9f1e7a6",
- "name": "To Domoticz",
- "topic": "domoticz/in",
- "qos": "",
- "retain": "",
- "respTopic": "",
- "contentType": "",
- "userProps": "",
- "correl": "",
- "expiry": "",
- "broker": "d60722c4841f7d9f",
- "x": 1290,
- "y": 460,
- "wires": []
- },
- {
- "id": "dbe495c2f02ac6e0",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 1, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 220,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "5c50985ab0857e3c",
- "type": "mqtt in",
- "z": "bc97e132f9f1e7a6",
- "name": "Current Daikin",
- "topic": "espaltherma/OneATTR/INV primary current (A)",
- "qos": "2",
- "datatype": "auto",
- "broker": "d60722c4841f7d9f",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 330,
- "y": 280,
- "wires": [
- [
- "65f21b9a0943ab50",
- "c3733755aed5ac80"
- ]
- ]
- },
- {
- "id": "65f21b9a0943ab50",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 2, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 280,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "c3733755aed5ac80",
- "type": "function",
- "z": "bc97e132f9f1e7a6",
- "name": "Wattage",
- "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",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 560,
- "y": 360,
- "wires": [
- [
- "b7f4e57a98974bd6",
- "01cc553052292500",
- "d814d63c.fc96e8"
- ]
- ]
- },
- {
- "id": "b7f4e57a98974bd6",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 3, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 360,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "a2b9540e857e8a61",
- "type": "mqtt in",
- "z": "bc97e132f9f1e7a6",
- "name": "Inlet water temp",
- "topic": "espaltherma/OneATTR/Inlet water temp.(R4T)",
- "qos": "2",
- "datatype": "auto",
- "broker": "d60722c4841f7d9f",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 300,
- "y": 480,
- "wires": [
- [
- "5185061f3e90050e",
- "cc3c0bfd0cb17e6d",
- "238922bff0416c05"
- ]
- ]
- },
- {
- "id": "e4bad7c7cafb1ffd",
- "type": "mqtt in",
- "z": "bc97e132f9f1e7a6",
- "name": "Leaving after BUH",
- "topic": "espaltherma/OneATTR/Leaving water temp. after BUH (R2T)",
- "qos": "2",
- "datatype": "auto",
- "broker": "d60722c4841f7d9f",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 290,
- "y": 420,
- "wires": [
- [
- "5185061f3e90050e",
- "2e47b7597f301d02",
- "238922bff0416c05"
- ]
- ]
- },
- {
- "id": "6502d87b2a7147fb",
- "type": "mqtt in",
- "z": "bc97e132f9f1e7a6",
- "name": "Flowrate",
- "topic": "espaltherma/OneATTR/Flow sensor (l/min)",
- "qos": "2",
- "datatype": "auto",
- "broker": "d60722c4841f7d9f",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 320,
- "y": 540,
- "wires": [
- [
- "3b87994cc91c5633",
- "5185061f3e90050e"
- ]
- ]
- },
- {
- "id": "11d9495635869480",
- "type": "mqtt in",
- "z": "bc97e132f9f1e7a6",
- "name": "DHW temp",
- "topic": "espaltherma/OneATTR/DHW tank temp. (R5T)",
- "qos": "2",
- "datatype": "auto",
- "broker": "d60722c4841f7d9f",
- "nl": false,
- "rap": true,
- "rh": 0,
- "inputs": 0,
- "x": 320,
- "y": 800,
- "wires": [
- [
- "7c228a098ed0a307"
- ]
- ]
- },
- {
- "id": "5185061f3e90050e",
- "type": "function",
- "z": "bc97e132f9f1e7a6",
- "name": "Heat production",
- "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}",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 540,
- "y": 600,
- "wires": [
- [
- "bf4cae082cae34fe",
- "01cc553052292500",
- "17cf50e57040f2da"
- ]
- ]
- },
- {
- "id": "bf4cae082cae34fe",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 4, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 600,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "3b87994cc91c5633",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 7, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 540,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "cc3c0bfd0cb17e6d",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 5, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 480,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "2e47b7597f301d02",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 6, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 420,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "7c228a098ed0a307",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 9, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 800,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "01cc553052292500",
- "type": "function",
- "z": "bc97e132f9f1e7a6",
- "name": "COP",
- "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}",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 710,
- "y": 660,
- "wires": [
- [
- "41718e3fc8867361"
- ]
- ]
- },
- {
- "id": "41718e3fc8867361",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 10, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 880,
- "y": 660,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "238922bff0416c05",
- "type": "function",
- "z": "bc97e132f9f1e7a6",
- "name": "Delta T",
- "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}",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 520,
- "y": 740,
- "wires": [
- [
- "96ead7c7fd3cf9c8"
- ]
- ]
- },
- {
- "id": "96ead7c7fd3cf9c8",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 11, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 740,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "1bf0b5e4.35c0ea",
- "type": "function",
- "z": "bc97e132f9f1e7a6",
- "name": "kWh",
- "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};",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 650,
- "y": 940,
- "wires": [
- [
- "45333d690d81c74b"
- ]
- ]
- },
- {
- "id": "d814d63c.fc96e8",
- "type": "simpletime",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "mydate": true,
- "myymd": true,
- "myyear": true,
- "mymonth": true,
- "mymonthn": true,
- "mydom": true,
- "mydoy": true,
- "myday": true,
- "myhourpm": true,
- "myhour": true,
- "mytime": true,
- "mytimes": true,
- "myminute": true,
- "myminutes": true,
- "mysecond": true,
- "mymillis": true,
- "myepoch": true,
- "myrawdate": true,
- "mypm": true,
- "x": 490,
- "y": 940,
- "wires": [
- [
- "1bf0b5e4.35c0ea"
- ]
- ]
- },
- {
- "id": "45333d690d81c74b",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 12, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 940,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "63c1ad91f43a2de2",
- "type": "function",
- "z": "bc97e132f9f1e7a6",
- "name": "kWh",
- "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};",
- "outputs": 1,
- "noerr": 0,
- "initialize": "",
- "finalize": "",
- "libs": [],
- "x": 650,
- "y": 1020,
- "wires": [
- [
- "3dc41d547d2a95af"
- ]
- ]
- },
- {
- "id": "17cf50e57040f2da",
- "type": "simpletime",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "mydate": true,
- "myymd": true,
- "myyear": true,
- "mymonth": true,
- "mymonthn": true,
- "mydom": true,
- "mydoy": true,
- "myday": true,
- "myhourpm": true,
- "myhour": true,
- "mytime": true,
- "mytimes": true,
- "myminute": true,
- "myminutes": true,
- "mysecond": true,
- "mymillis": true,
- "myepoch": true,
- "myrawdate": true,
- "mypm": true,
- "x": 490,
- "y": 1020,
- "wires": [
- [
- "63c1ad91f43a2de2"
- ]
- ]
- },
- {
- "id": "3dc41d547d2a95af",
- "type": "template",
- "z": "bc97e132f9f1e7a6",
- "name": "",
- "field": "payload",
- "fieldType": "msg",
- "format": "handlebars",
- "syntax": "mustache",
- "template": "{ \"command\": \"udevice\", \"idx\" : 13, \"nvalue\" : 0, \"svalue\" : \"{{payload}}\" }\n",
- "output": "json",
- "x": 820,
- "y": 1020,
- "wires": [
- [
- "ed83aaf8ee3d60aa"
- ]
- ]
- },
- {
- "id": "d60722c4841f7d9f",
- "type": "mqtt-broker",
- "name": "Mosquitto",
- "broker": "localhost",
- "port": "1883",
- "clientid": "NodeRed",
- "autoConnect": true,
- "usetls": false,
- "protocolVersion": "4",
- "keepalive": "60",
- "cleansession": true,
- "birthTopic": "",
- "birthQos": "0",
- "birthPayload": "",
- "birthMsg": {},
- "closeTopic": "",
- "closeQos": "0",
- "closePayload": "",
- "closeMsg": {},
- "willTopic": "",
- "willQos": "0",
- "willPayload": "",
- "willMsg": {},
- "sessionExpiry": ""
- }
- ]
Advertisement
Add Comment
Please, Sign In to add comment