Difference between revisions of "Pressac"
Jump to navigation
Jump to search
(Created page with " ==Node-RED== <pre> [{"id":"99ac7471.8c5608","type":"tab","label":"Pressac Flow","disabled":false,"info":""},{"id":"7d3d3ccf.945f84","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"059E894B","list":"059E894B??CO2-T-H-1$$","x":200,"y":440,"wires":"ed2998de.033ee8","5215e9a1.b203d8"},{"id":"d62cc7d4.e14d88","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus...") |
|||
Line 2: | Line 2: | ||
==Node-RED== | ==Node-RED== | ||
[[File:Nodered-pressac-1.png|frameless|1390x1390px]]<pre> | |||
<pre> | |||
[{"id":"99ac7471.8c5608","type":"tab","label":"Pressac Flow","disabled":false,"info":""},{"id":"7d3d3ccf.945f84","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"059E894B","list":"059E894B??CO2-T-H-1$$","x":200,"y":440,"wires":[["ed2998de.033ee8","5215e9a1.b203d8"]]},{"id":"d62cc7d4.e14d88","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":440,"wires":[]},{"id":"bbcfdd16.2f1d7","type":"function","z":"99ac7471.8c5608","name":"InfluxDB","func":"\nvar oot = {};\nvar tags = {};\nvar tops = msg.topic.split(\"/\");\n\n\n\n\nif (!tops[4]) { return null; }\n\nvar net = global.get(\"config.networkId\") || \"local\";\nnet = (tops[0] == \"local\" ? net : tops[0])\n\ntags.node = tops[1];\ntags.device = tops[2];\ntags.network = net;\ntags.vargroup = tops[3];\ntags.varkey = tops[4];\n\n//tags.title = flow.get(\"title.\" + tops[2]) || tops[2];\n\nvar msg1={};\nmsg1.topic = \"\"+msg.topic;\n\ntry {\n\n \n\n if (isNaN(msg.payload)) { msg1.payload = '' + msg.payload }\n else { msg1.payload = parseFloat(msg.payload); }\n \n\n oot[tops[3] + '_' + tops[4]] = msg1.payload;\n\n msg1.measurement = net + '_' + tops[1] + '_' + tops[2];\n msg1.payload = [oot, tags];\n\n return msg1;\n\n\n\n\n} catch { return null; }\n\n","outputs":1,"noerr":0,"x":720,"y":80,"wires":[["546e7d86.0faf74"]]},{"id":"546e7d86.0faf74","type":"influxdb out","z":"99ac7471.8c5608","influxdb":"140bcdb8.e6d6f2","name":"excel","measurement":"","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"heatweb","bucket":"excel","x":930,"y":80,"wires":[]},{"id":"ed2998de.033ee8","type":"function","z":"99ac7471.8c5608","name":"CO2 Temp Humidity","func":"\nvar msg1 = { \"payload\": msg.payload.concentration.value, \"units\": msg.payload.concentration.unit, \"title\": \"CO2 Concentration\" };\nvar msg2 = { \"payload\": msg.payload.temperature.value, \"units\": msg.payload.temperature.unit, \"title\": \"Temperature\" };\nvar msg3 = { \"payload\": msg.payload.humidity.value, \"units\": msg.payload.humidity.unit, \"title\": \"Humidity\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/co2\";\nmsg2.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/temperature\";\nmsg3.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/humidity\";\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"x":440,"y":440,"wires":[["d62cc7d4.e14d88","7fcd4ff.425f9b"],["d62cc7d4.e14d88","7fcd4ff.425f9b"],["d62cc7d4.e14d88","7fcd4ff.425f9b"]]},{"id":"797269b2.755618","type":"inject","z":"99ac7471.8c5608","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":190,"y":80,"wires":[["3b1ac644.e9d4fa"]]},{"id":"3b1ac644.e9d4fa","type":"function","z":"99ac7471.8c5608","name":"excel / PRGW-ELW-1","func":"global.set(\"config\",{\"networkId\":\"excel\", \"nodeId\": \"PRGW-ELW-1\"});\n\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":80,"wires":[[]]},{"id":"e2942f48.fc264","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"0522F758","list":"059E894B??CO2-T-H-1$$0522F758??CT-CLAMP-1$$","x":200,"y":600,"wires":[["a846ce1d.be043","5e79c54c.59bb8c"]]},{"id":"a846ce1d.be043","type":"debug","z":"99ac7471.8c5608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":660,"wires":[]},{"id":"5215e9a1.b203d8","type":"debug","z":"99ac7471.8c5608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":500,"wires":[]},{"id":"5e79c54c.59bb8c","type":"function","z":"99ac7471.8c5608","name":"CT Clamp","func":"\nvar msg1 = { \"payload\": msg.payload.channel1.value, \"units\": msg.payload.channel1.unit, \"title\": \"Current\" };\n//var msg2 = { \"payload\": msg.payload.channel2.value, \"units\": msg.payload.channel2.unit, \"title\": \"Current 2\" };\n//var msg3 = { \"payload\": msg.payload.channel3.value, \"units\": msg.payload.channel3.unit, \"title\": \"Current 3\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n//msg2.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n//msg3.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n\n//return [msg1,msg2,msg3];\nreturn [msg1,null,null];","outputs":3,"noerr":0,"x":400,"y":600,"wires":[["4f27b983.e21da8","aeb01f7c.2c266"],["4f27b983.e21da8"],["4f27b983.e21da8"]]},{"id":"4f27b983.e21da8","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":600,"wires":[]},{"id":"c534a45f.a49d08","type":"link in","z":"99ac7471.8c5608","name":"","links":["aeb01f7c.2c266","7fcd4ff.425f9b","1c25f8ae.df5eb7"],"x":615,"y":80,"wires":[["bbcfdd16.2f1d7"]]},{"id":"aeb01f7c.2c266","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":575,"y":560,"wires":[]},{"id":"7fcd4ff.425f9b","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":655,"y":400,"wires":[]},{"id":"4276e464.4e26bc","type":"switch","z":"99ac7471.8c5608","name":"","property":"payload[1]","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":160,"wires":[["fac00ed8.87f0c"]]},{"id":"fac00ed8.87f0c","type":"trigger","z":"99ac7471.8c5608","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"3","extend":true,"units":"s","reset":"","bytopic":"topic","name":"","x":760,"y":160,"wires":[["546e7d86.0faf74"]]},{"id":"b90f5603.bab258","type":"catch","z":"99ac7471.8c5608","name":"","scope":["546e7d86.0faf74"],"uncaught":false,"x":490,"y":220,"wires":[["b393afe1.061a3","89b95f06.c18da","4276e464.4e26bc"]]},{"id":"b393afe1.061a3","type":"debug","z":"99ac7471.8c5608","name":"debug 20","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":640,"y":260,"wires":[]},{"id":"89b95f06.c18da","type":"trigger","z":"99ac7471.8c5608","op1":"","op2":"alarm","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"min","reset":"","bytopic":"all","name":"","x":870,"y":220,"wires":[["241f0f47.4e6ed"]]},{"id":"a527c73e.752e08","type":"complete","z":"99ac7471.8c5608","name":"","scope":["546e7d86.0faf74"],"uncaught":false,"x":510,"y":300,"wires":[["fdca847.746f878"]]},{"id":"fdca847.746f878","type":"change","z":"99ac7471.8c5608","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":300,"wires":[["89b95f06.c18da"]]},{"id":"88faa244.7a35e","type":"comment","z":"99ac7471.8c5608","name":"Try resending dropped messages","info":"","x":1010,"y":300,"wires":[]},{"id":"241f0f47.4e6ed","type":"debug","z":"99ac7471.8c5608","name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1120,"y":220,"wires":[]},{"id":"20a94d9b.10e622","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"058FDBE1","list":"059E894B??CO2-T-H-1$$0522F758??CT-CLAMP-1$$058FDBE1??DRY-CON-1$$","x":200,"y":740,"wires":[["de3e243.3f807d8","bb1a6f2c.e6923"]]},{"id":"de3e243.3f807d8","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":780,"wires":[]},{"id":"bb1a6f2c.e6923","type":"function","z":"99ac7471.8c5608","name":"Dry Contact","func":"\nvar msg1 = { \"payload\": msg.payload.contact, \"title\": \"Dry Contact\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/contact\";\n\n\nreturn msg1;","outputs":1,"noerr":0,"x":410,"y":740,"wires":[["f1c2708e.858af","1c25f8ae.df5eb7"]]},{"id":"f1c2708e.858af","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":740,"wires":[]},{"id":"1c25f8ae.df5eb7","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":575,"y":700,"wires":[]},{"id":"cca4d3fa.9998","type":"remote-gateway","z":"","name":"PRGW-ELW-1","ip":"127.0.0.1","password":"PressacSensing@"},{"id":"140bcdb8.e6d6f2","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"heatweb","usetls":false,"tls":"","influxdbVersion":"2.0","url":"https://europe-west1-1.gcp.cloud2.influxdata.com","rejectUnauthorized":true}] | [{"id":"99ac7471.8c5608","type":"tab","label":"Pressac Flow","disabled":false,"info":""},{"id":"7d3d3ccf.945f84","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"059E894B","list":"059E894B??CO2-T-H-1$$","x":200,"y":440,"wires":[["ed2998de.033ee8","5215e9a1.b203d8"]]},{"id":"d62cc7d4.e14d88","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":440,"wires":[]},{"id":"bbcfdd16.2f1d7","type":"function","z":"99ac7471.8c5608","name":"InfluxDB","func":"\nvar oot = {};\nvar tags = {};\nvar tops = msg.topic.split(\"/\");\n\n\n\n\nif (!tops[4]) { return null; }\n\nvar net = global.get(\"config.networkId\") || \"local\";\nnet = (tops[0] == \"local\" ? net : tops[0])\n\ntags.node = tops[1];\ntags.device = tops[2];\ntags.network = net;\ntags.vargroup = tops[3];\ntags.varkey = tops[4];\n\n//tags.title = flow.get(\"title.\" + tops[2]) || tops[2];\n\nvar msg1={};\nmsg1.topic = \"\"+msg.topic;\n\ntry {\n\n \n\n if (isNaN(msg.payload)) { msg1.payload = '' + msg.payload }\n else { msg1.payload = parseFloat(msg.payload); }\n \n\n oot[tops[3] + '_' + tops[4]] = msg1.payload;\n\n msg1.measurement = net + '_' + tops[1] + '_' + tops[2];\n msg1.payload = [oot, tags];\n\n return msg1;\n\n\n\n\n} catch { return null; }\n\n","outputs":1,"noerr":0,"x":720,"y":80,"wires":[["546e7d86.0faf74"]]},{"id":"546e7d86.0faf74","type":"influxdb out","z":"99ac7471.8c5608","influxdb":"140bcdb8.e6d6f2","name":"excel","measurement":"","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"heatweb","bucket":"excel","x":930,"y":80,"wires":[]},{"id":"ed2998de.033ee8","type":"function","z":"99ac7471.8c5608","name":"CO2 Temp Humidity","func":"\nvar msg1 = { \"payload\": msg.payload.concentration.value, \"units\": msg.payload.concentration.unit, \"title\": \"CO2 Concentration\" };\nvar msg2 = { \"payload\": msg.payload.temperature.value, \"units\": msg.payload.temperature.unit, \"title\": \"Temperature\" };\nvar msg3 = { \"payload\": msg.payload.humidity.value, \"units\": msg.payload.humidity.unit, \"title\": \"Humidity\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/co2\";\nmsg2.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/temperature\";\nmsg3.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/humidity\";\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"x":440,"y":440,"wires":[["d62cc7d4.e14d88","7fcd4ff.425f9b"],["d62cc7d4.e14d88","7fcd4ff.425f9b"],["d62cc7d4.e14d88","7fcd4ff.425f9b"]]},{"id":"797269b2.755618","type":"inject","z":"99ac7471.8c5608","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":190,"y":80,"wires":[["3b1ac644.e9d4fa"]]},{"id":"3b1ac644.e9d4fa","type":"function","z":"99ac7471.8c5608","name":"excel / PRGW-ELW-1","func":"global.set(\"config\",{\"networkId\":\"excel\", \"nodeId\": \"PRGW-ELW-1\"});\n\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":80,"wires":[[]]},{"id":"e2942f48.fc264","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"0522F758","list":"059E894B??CO2-T-H-1$$0522F758??CT-CLAMP-1$$","x":200,"y":600,"wires":[["a846ce1d.be043","5e79c54c.59bb8c"]]},{"id":"a846ce1d.be043","type":"debug","z":"99ac7471.8c5608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":660,"wires":[]},{"id":"5215e9a1.b203d8","type":"debug","z":"99ac7471.8c5608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":500,"wires":[]},{"id":"5e79c54c.59bb8c","type":"function","z":"99ac7471.8c5608","name":"CT Clamp","func":"\nvar msg1 = { \"payload\": msg.payload.channel1.value, \"units\": msg.payload.channel1.unit, \"title\": \"Current\" };\n//var msg2 = { \"payload\": msg.payload.channel2.value, \"units\": msg.payload.channel2.unit, \"title\": \"Current 2\" };\n//var msg3 = { \"payload\": msg.payload.channel3.value, \"units\": msg.payload.channel3.unit, \"title\": \"Current 3\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n//msg2.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n//msg3.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n\n//return [msg1,msg2,msg3];\nreturn [msg1,null,null];","outputs":3,"noerr":0,"x":400,"y":600,"wires":[["4f27b983.e21da8","aeb01f7c.2c266"],["4f27b983.e21da8"],["4f27b983.e21da8"]]},{"id":"4f27b983.e21da8","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":600,"wires":[]},{"id":"c534a45f.a49d08","type":"link in","z":"99ac7471.8c5608","name":"","links":["aeb01f7c.2c266","7fcd4ff.425f9b","1c25f8ae.df5eb7"],"x":615,"y":80,"wires":[["bbcfdd16.2f1d7"]]},{"id":"aeb01f7c.2c266","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":575,"y":560,"wires":[]},{"id":"7fcd4ff.425f9b","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":655,"y":400,"wires":[]},{"id":"4276e464.4e26bc","type":"switch","z":"99ac7471.8c5608","name":"","property":"payload[1]","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":160,"wires":[["fac00ed8.87f0c"]]},{"id":"fac00ed8.87f0c","type":"trigger","z":"99ac7471.8c5608","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"3","extend":true,"units":"s","reset":"","bytopic":"topic","name":"","x":760,"y":160,"wires":[["546e7d86.0faf74"]]},{"id":"b90f5603.bab258","type":"catch","z":"99ac7471.8c5608","name":"","scope":["546e7d86.0faf74"],"uncaught":false,"x":490,"y":220,"wires":[["b393afe1.061a3","89b95f06.c18da","4276e464.4e26bc"]]},{"id":"b393afe1.061a3","type":"debug","z":"99ac7471.8c5608","name":"debug 20","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":640,"y":260,"wires":[]},{"id":"89b95f06.c18da","type":"trigger","z":"99ac7471.8c5608","op1":"","op2":"alarm","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"min","reset":"","bytopic":"all","name":"","x":870,"y":220,"wires":[["241f0f47.4e6ed"]]},{"id":"a527c73e.752e08","type":"complete","z":"99ac7471.8c5608","name":"","scope":["546e7d86.0faf74"],"uncaught":false,"x":510,"y":300,"wires":[["fdca847.746f878"]]},{"id":"fdca847.746f878","type":"change","z":"99ac7471.8c5608","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":300,"wires":[["89b95f06.c18da"]]},{"id":"88faa244.7a35e","type":"comment","z":"99ac7471.8c5608","name":"Try resending dropped messages","info":"","x":1010,"y":300,"wires":[]},{"id":"241f0f47.4e6ed","type":"debug","z":"99ac7471.8c5608","name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1120,"y":220,"wires":[]},{"id":"20a94d9b.10e622","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"058FDBE1","list":"059E894B??CO2-T-H-1$$0522F758??CT-CLAMP-1$$058FDBE1??DRY-CON-1$$","x":200,"y":740,"wires":[["de3e243.3f807d8","bb1a6f2c.e6923"]]},{"id":"de3e243.3f807d8","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":780,"wires":[]},{"id":"bb1a6f2c.e6923","type":"function","z":"99ac7471.8c5608","name":"Dry Contact","func":"\nvar msg1 = { \"payload\": msg.payload.contact, \"title\": \"Dry Contact\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/contact\";\n\n\nreturn msg1;","outputs":1,"noerr":0,"x":410,"y":740,"wires":[["f1c2708e.858af","1c25f8ae.df5eb7"]]},{"id":"f1c2708e.858af","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":740,"wires":[]},{"id":"1c25f8ae.df5eb7","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":575,"y":700,"wires":[]},{"id":"cca4d3fa.9998","type":"remote-gateway","z":"","name":"PRGW-ELW-1","ip":"127.0.0.1","password":"PressacSensing@"},{"id":"140bcdb8.e6d6f2","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"heatweb","usetls":false,"tls":"","influxdbVersion":"2.0","url":"https://europe-west1-1.gcp.cloud2.influxdata.com","rejectUnauthorized":true}] | ||
</pre> | </pre> |
Revision as of 20:47, 17 January 2023
Node-RED
[{"id":"99ac7471.8c5608","type":"tab","label":"Pressac Flow","disabled":false,"info":""},{"id":"7d3d3ccf.945f84","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"059E894B","list":"059E894B??CO2-T-H-1$$","x":200,"y":440,"wires":[["ed2998de.033ee8","5215e9a1.b203d8"]]},{"id":"d62cc7d4.e14d88","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":710,"y":440,"wires":[]},{"id":"bbcfdd16.2f1d7","type":"function","z":"99ac7471.8c5608","name":"InfluxDB","func":"\nvar oot = {};\nvar tags = {};\nvar tops = msg.topic.split(\"/\");\n\n\n\n\nif (!tops[4]) { return null; }\n\nvar net = global.get(\"config.networkId\") || \"local\";\nnet = (tops[0] == \"local\" ? net : tops[0])\n\ntags.node = tops[1];\ntags.device = tops[2];\ntags.network = net;\ntags.vargroup = tops[3];\ntags.varkey = tops[4];\n\n//tags.title = flow.get(\"title.\" + tops[2]) || tops[2];\n\nvar msg1={};\nmsg1.topic = \"\"+msg.topic;\n\ntry {\n\n \n\n if (isNaN(msg.payload)) { msg1.payload = '' + msg.payload }\n else { msg1.payload = parseFloat(msg.payload); }\n \n\n oot[tops[3] + '_' + tops[4]] = msg1.payload;\n\n msg1.measurement = net + '_' + tops[1] + '_' + tops[2];\n msg1.payload = [oot, tags];\n\n return msg1;\n\n\n\n\n} catch { return null; }\n\n","outputs":1,"noerr":0,"x":720,"y":80,"wires":[["546e7d86.0faf74"]]},{"id":"546e7d86.0faf74","type":"influxdb out","z":"99ac7471.8c5608","influxdb":"140bcdb8.e6d6f2","name":"excel","measurement":"","precision":"","retentionPolicy":"","database":"database","precisionV18FluxV20":"ms","retentionPolicyV18Flux":"","org":"heatweb","bucket":"excel","x":930,"y":80,"wires":[]},{"id":"ed2998de.033ee8","type":"function","z":"99ac7471.8c5608","name":"CO2 Temp Humidity","func":"\nvar msg1 = { \"payload\": msg.payload.concentration.value, \"units\": msg.payload.concentration.unit, \"title\": \"CO2 Concentration\" };\nvar msg2 = { \"payload\": msg.payload.temperature.value, \"units\": msg.payload.temperature.unit, \"title\": \"Temperature\" };\nvar msg3 = { \"payload\": msg.payload.humidity.value, \"units\": msg.payload.humidity.unit, \"title\": \"Humidity\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/co2\";\nmsg2.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/temperature\";\nmsg3.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/humidity\";\n\nreturn [msg1,msg2,msg3];","outputs":3,"noerr":0,"x":440,"y":440,"wires":[["d62cc7d4.e14d88","7fcd4ff.425f9b"],["d62cc7d4.e14d88","7fcd4ff.425f9b"],["d62cc7d4.e14d88","7fcd4ff.425f9b"]]},{"id":"797269b2.755618","type":"inject","z":"99ac7471.8c5608","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":190,"y":80,"wires":[["3b1ac644.e9d4fa"]]},{"id":"3b1ac644.e9d4fa","type":"function","z":"99ac7471.8c5608","name":"excel / PRGW-ELW-1","func":"global.set(\"config\",{\"networkId\":\"excel\", \"nodeId\": \"PRGW-ELW-1\"});\n\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":80,"wires":[[]]},{"id":"e2942f48.fc264","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"0522F758","list":"059E894B??CO2-T-H-1$$0522F758??CT-CLAMP-1$$","x":200,"y":600,"wires":[["a846ce1d.be043","5e79c54c.59bb8c"]]},{"id":"a846ce1d.be043","type":"debug","z":"99ac7471.8c5608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":660,"wires":[]},{"id":"5215e9a1.b203d8","type":"debug","z":"99ac7471.8c5608","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":500,"wires":[]},{"id":"5e79c54c.59bb8c","type":"function","z":"99ac7471.8c5608","name":"CT Clamp","func":"\nvar msg1 = { \"payload\": msg.payload.channel1.value, \"units\": msg.payload.channel1.unit, \"title\": \"Current\" };\n//var msg2 = { \"payload\": msg.payload.channel2.value, \"units\": msg.payload.channel2.unit, \"title\": \"Current 2\" };\n//var msg3 = { \"payload\": msg.payload.channel3.value, \"units\": msg.payload.channel3.unit, \"title\": \"Current 3\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n//msg2.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n//msg3.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/amps\";\n\n//return [msg1,msg2,msg3];\nreturn [msg1,null,null];","outputs":3,"noerr":0,"x":400,"y":600,"wires":[["4f27b983.e21da8","aeb01f7c.2c266"],["4f27b983.e21da8"],["4f27b983.e21da8"]]},{"id":"4f27b983.e21da8","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":600,"wires":[]},{"id":"c534a45f.a49d08","type":"link in","z":"99ac7471.8c5608","name":"","links":["aeb01f7c.2c266","7fcd4ff.425f9b","1c25f8ae.df5eb7"],"x":615,"y":80,"wires":[["bbcfdd16.2f1d7"]]},{"id":"aeb01f7c.2c266","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":575,"y":560,"wires":[]},{"id":"7fcd4ff.425f9b","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":655,"y":400,"wires":[]},{"id":"4276e464.4e26bc","type":"switch","z":"99ac7471.8c5608","name":"","property":"payload[1]","propertyType":"msg","rules":[{"t":"nempty"}],"checkall":"true","repair":false,"outputs":1,"x":630,"y":160,"wires":[["fac00ed8.87f0c"]]},{"id":"fac00ed8.87f0c","type":"trigger","z":"99ac7471.8c5608","op1":"","op2":"","op1type":"nul","op2type":"payl","duration":"3","extend":true,"units":"s","reset":"","bytopic":"topic","name":"","x":760,"y":160,"wires":[["546e7d86.0faf74"]]},{"id":"b90f5603.bab258","type":"catch","z":"99ac7471.8c5608","name":"","scope":["546e7d86.0faf74"],"uncaught":false,"x":490,"y":220,"wires":[["b393afe1.061a3","89b95f06.c18da","4276e464.4e26bc"]]},{"id":"b393afe1.061a3","type":"debug","z":"99ac7471.8c5608","name":"debug 20","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":640,"y":260,"wires":[]},{"id":"89b95f06.c18da","type":"trigger","z":"99ac7471.8c5608","op1":"","op2":"alarm","op1type":"nul","op2type":"str","duration":"5","extend":false,"units":"min","reset":"","bytopic":"all","name":"","x":870,"y":220,"wires":[["241f0f47.4e6ed"]]},{"id":"a527c73e.752e08","type":"complete","z":"99ac7471.8c5608","name":"","scope":["546e7d86.0faf74"],"uncaught":false,"x":510,"y":300,"wires":[["fdca847.746f878"]]},{"id":"fdca847.746f878","type":"change","z":"99ac7471.8c5608","name":"","rules":[{"t":"set","p":"reset","pt":"msg","to":"1","tot":"str"},{"t":"delete","p":"payload","pt":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":680,"y":300,"wires":[["89b95f06.c18da"]]},{"id":"88faa244.7a35e","type":"comment","z":"99ac7471.8c5608","name":"Try resending dropped messages","info":"","x":1010,"y":300,"wires":[]},{"id":"241f0f47.4e6ed","type":"debug","z":"99ac7471.8c5608","name":"debug 19","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":1120,"y":220,"wires":[]},{"id":"20a94d9b.10e622","type":"pressac-sensor","z":"99ac7471.8c5608","name":"pressac-sensor","gateway":"cca4d3fa.9998","sensors":"058FDBE1","list":"059E894B??CO2-T-H-1$$0522F758??CT-CLAMP-1$$058FDBE1??DRY-CON-1$$","x":200,"y":740,"wires":[["de3e243.3f807d8","bb1a6f2c.e6923"]]},{"id":"de3e243.3f807d8","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":780,"wires":[]},{"id":"bb1a6f2c.e6923","type":"function","z":"99ac7471.8c5608","name":"Dry Contact","func":"\nvar msg1 = { \"payload\": msg.payload.contact, \"title\": \"Dry Contact\" };\n\nvar nodeId = global.get(\"config.nodeId\") || \"enocean\";\n\nmsg1.topic = \"local/\" + nodeId + \"/\" + msg.payload.deviceName + \"/dat/contact\";\n\n\nreturn msg1;","outputs":1,"noerr":0,"x":410,"y":740,"wires":[["f1c2708e.858af","1c25f8ae.df5eb7"]]},{"id":"f1c2708e.858af","type":"debug","z":"99ac7471.8c5608","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":630,"y":740,"wires":[]},{"id":"1c25f8ae.df5eb7","type":"link out","z":"99ac7471.8c5608","name":"","links":["c534a45f.a49d08"],"x":575,"y":700,"wires":[]},{"id":"cca4d3fa.9998","type":"remote-gateway","z":"","name":"PRGW-ELW-1","ip":"127.0.0.1","password":"PressacSensing@"},{"id":"140bcdb8.e6d6f2","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"heatweb","usetls":false,"tls":"","influxdbVersion":"2.0","url":"https://europe-west1-1.gcp.cloud2.influxdata.com","rejectUnauthorized":true}]