-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
node-red.json
1 lines (1 loc) · 4.9 KB
/
node-red.json
1
[{"id":"d849ec0520fbcfa4","type":"function","z":"4216ea58c324e098","name":"influxdb format","func":"var message = [\n {\n measurement: msg.topic,\n fields: {\n value: msg.payload \n },\n tags:{\n type: 'status',\n ort: 'keller',\n sensor: 'km271',\n },\n }\n];\n\nmsg = {};\nmsg.payload = message;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":1470,"wires":[["6698dd1d2f36646f","d3665360ed70bacd"]]},{"id":"2dbe259198aeadb0","type":"function","z":"4216ea58c324e098","name":"filter \"/status/\"","func":"let prefix = \"/status/\";\nmsg.topic = msg.topic.substring(msg.topic.indexOf(prefix) + prefix.length);\n\nif (msg.payload != \"online\" && msg.payload != \"offline\") {\n if (isNaN(msg.payload)) {\n msg.payload = (msg.payload);\n }\n else {\n msg.payload = parseInt(msg.payload);\n }\n return msg;\n}\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1470,"wires":[["d849ec0520fbcfa4"]]},{"id":"18e1eb435f36d245","type":"comment","z":"4216ea58c324e098","name":"KM271 - Heizung","info":"","x":90,"y":1420,"wires":[]},{"id":"a86c3792ae6209bf","type":"mqtt in","z":"4216ea58c324e098","name":"","topic":"esp_heizung/status/#","qos":"2","datatype":"auto","broker":"cfad789e.d15798","nl":false,"rap":true,"rh":0,"inputs":0,"x":110,"y":1470,"wires":[["2dbe259198aeadb0"]]},{"id":"8860649548a9eab2","type":"mqtt in","z":"4216ea58c324e098","name":"","topic":"esp_heizung/config/#","qos":"2","datatype":"auto","broker":"cfad789e.d15798","nl":false,"rap":true,"rh":0,"inputs":0,"x":110,"y":1530,"wires":[["231107e100d9fe72"]]},{"id":"231107e100d9fe72","type":"function","z":"4216ea58c324e098","name":"filter \"/config/\"","func":"let prefix = \"/config/\";\nmsg.topic = msg.topic.substring(msg.topic.indexOf(prefix) + prefix.length);\n\nif (isNaN(msg.payload)) {\n msg.payload = (msg.payload);\n}\nelse {\n msg.payload = parseInt(msg.payload);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1530,"wires":[["691c1584a995b89b"]]},{"id":"691c1584a995b89b","type":"function","z":"4216ea58c324e098","name":"influxdb format","func":"var message = [\n {\n measurement: msg.topic,\n fields: {\n value: msg.payload \n },\n tags:{\n type: 'config',\n ort: 'keller',\n sensor: 'km271',\n },\n }\n];\n\nmsg = {};\nmsg.payload = message;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":1530,"wires":[["6698dd1d2f36646f"]]},{"id":"75d46745dba58b61","type":"mqtt in","z":"4216ea58c324e098","name":"","topic":"esp_heizung/alarm/#","qos":"2","datatype":"auto","broker":"cfad789e.d15798","nl":false,"rap":true,"rh":0,"inputs":0,"x":100,"y":1580,"wires":[["49e9494b0ca3277e"]]},{"id":"49e9494b0ca3277e","type":"function","z":"4216ea58c324e098","name":"filter \"/alarm/\"","func":"let prefix = \"/alarm/\";\nmsg.topic = msg.topic.substring(msg.topic.indexOf(prefix) + prefix.length);\n\nif (isNaN(msg.payload)) {\n msg.payload = (msg.payload);\n}\nelse {\n msg.payload = parseInt(msg.payload);\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":370,"y":1580,"wires":[["1933fb83b7047dc4"]]},{"id":"1933fb83b7047dc4","type":"function","z":"4216ea58c324e098","name":"influxdb format","func":"var message = [\n {\n measurement: msg.topic,\n fields: {\n value: msg.payload \n },\n tags:{\n type: 'error',\n ort: 'keller',\n sensor: 'km271',\n },\n }\n];\n\nmsg = {};\nmsg.payload = message;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":570,"y":1580,"wires":[["6698dd1d2f36646f"]]},{"id":"6698dd1d2f36646f","type":"influxdb batch","z":"4216ea58c324e098","influxdb":"12964b84.42778c","precision":"","retentionPolicy":"","name":"Heizung","database":"database","precisionV18FluxV20":"s","retentionPolicyV18Flux":"","org":"smarthome","bucket":"heizung","x":840,"y":1530,"wires":[]},{"id":"cfad789e.d15798","type":"mqtt-broker","name":"Mosquitto Docker","broker":"192.168.178.2","port":"1883","clientid":"node-red","usetls":false,"compatmode":false,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","willTopic":"","willQos":"0","willRetain":"false","willPayload":""},{"id":"12964b84.42778c","type":"influxdb","hostname":"127.0.0.1","port":"8086","protocol":"http","database":"database","name":"influxdb","usetls":false,"tls":"d50d0c9f.31e858","influxdbVersion":"2.0","url":"http://192.168.178.2:8086/","rejectUnauthorized":false},{"id":"d50d0c9f.31e858","type":"tls-config","name":"","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"","verifyservercert":false}]