-
Notifications
You must be signed in to change notification settings - Fork 9
/
Node-RED-flow.json
1 lines (1 loc) · 2.92 KB
/
Node-RED-flow.json
1
[{"id":"35df7962.28a63e","type":"mqtt in","z":"6490c198.aa40d","name":"GasmeterPulse","topic":"gasmeter/pulse","qos":"2","datatype":"utf8","broker":"fb63a031.3f9e28","x":982.316650390625,"y":1078.25,"wires":[["32740220.78e8be","4be4d39f.d5caa4"]]},{"id":"32740220.78e8be","type":"debug","z":"6490c198.aa40d","name":"GasmeterPulse","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":1201.3167114257812,"y":1078.2499389648438,"wires":[]},{"id":"b03fa69f.21d8a8","type":"influxdb out","z":"6490c198.aa40d","influxdb":"b038dadb.08c52","name":"counter,gas","measurement":"counter,loc=gas","precision":"","retentionPolicy":"","database":"","retentionPolicyV18Flux":"","org":"","bucket":"","x":1466.316650390625,"y":1130.25,"wires":[]},{"id":"4be4d39f.d5caa4","type":"change","z":"6490c198.aa40d","name":"String to number","rules":[{"t":"set","p":"payload","pt":"msg","to":"$number(msg.payload)","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":1099.316650390625,"y":1131.25,"wires":[["e5232f99.d6ab8"]]},{"id":"6b417abe.a1ff1c","type":"inject","z":"6490c198.aa40d","name":"Metercount*100","topic":"","payload":"4678081","payloadType":"num","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":1239.2000122070312,"y":1248.1332397460938,"wires":[["3308d564.de939a"]]},{"id":"3308d564.de939a","type":"mqtt out","z":"6490c198.aa40d","name":"gasmeter/status","topic":"gasmeter/status","qos":"2","retain":"","broker":"fb63a031.3f9e28","x":1449.699951171875,"y":1194.1332397460938,"wires":[]},{"id":"e5232f99.d6ab8","type":"function","z":"6490c198.aa40d","name":"Status","func":"var gasmeter = global.get(\"gasmeter\") || 0.1;\n\nreed = msg.payload;\n\nif (reed < 1000) {\n msg.payload = (gasmeter+1)/100;\n msg.correction = gasmeter+1;\n} else {\n msg.payload = reed/100;\n global.set(\"gasmeter\", reed/100);\n msg.correction = \"\";\n}\n\nreturn msg;\n","outputs":1,"noerr":0,"x":1272.199951171875,"y":1131.13330078125,"wires":[["b03fa69f.21d8a8","41a3ae40.1ec5f"]]},{"id":"41a3ae40.1ec5f","type":"function","z":"6490c198.aa40d","name":"Reed-Sensor-Correction","func":"if (msg.correction !== \"\") {\n msg.payload = msg.correction;\n return msg;\n} else {\n return null;\n}\n","outputs":1,"noerr":0,"x":1167.199951171875,"y":1196.1332397460938,"wires":[["3308d564.de939a"]]},{"id":"fb63a031.3f9e28","type":"mqtt-broker","z":"","name":"localhost","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"salaWelcome","birthQos":"0","birthRetain":"true","birthPayload":"","closeTopic":"salaBye","closeQos":"0","closeRetain":"true","closePayload":"","willTopic":"salaOoops","willQos":"0","willRetain":"true","willPayload":""},{"id":"b038dadb.08c52","type":"influxdb","z":"","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"weather","name":"weather","usetls":false,"tls":"","influxdbVersion":"1.x"}]