Guest User

Untitled

a guest
Feb 7th, 2020
106
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [{"id":"f45ea1b8.906a9","type":"tab","label":"Telnet2LoRa","disabled":false,"info":""},{"id":"2d941f64.2cf12","type":"tcp in","z":"f45ea1b8.906a9","name":"Node-RED Client","server":"client","host":"192.168.1.69","port":"3333","datamode":"stream","datatype":"utf8","newline":"\\n","topic":"text2","base64":false,"x":120,"y":40,"wires":[["49705053.7c2c","7ac3d814.ecb588"]]},{"id":"49705053.7c2c","type":"debug","z":"f45ea1b8.906a9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":410,"y":40,"wires":[]},{"id":"c6dcb06e.186f","type":"function","z":"f45ea1b8.906a9","name":"","func":"var msg1 = {};\nvar msg2 = {};\nvar msg3 = {};\nvar msg4 = {};\nvar msg5 = {};\nvar msg6 = {};\nvar msg7 = {};\nvar msg8 = {};\nvar temp = 0;\nvar hum = 0;\nmsg1.payload = msg.payload.UID\nmsg2.payload = (msg.payload.V/1000).toFixed(2);\nmsg3.payload = (msg.payload.P/100/1.333).toFixed(2);\ntemp = msg.payload.T/100\nif (temp<100)\n {msg4.payload = temp.toFixed(2)}\nelse\n {\n temp =~ msg.payload.T\n temp = -temp \n }\nmsg4.payload = (temp/100).toFixed(2)\nglobal.set('Outside_Temperature',msg4.payload);\nhum = msg.payload.H/1024\nmsg5.payload = hum.toFixed(2);\nglobal.set('Outside_Humidity',msg5.payload);\nmsg6.payload = msg.payload.TS;\nmsg7.payload = (temp/100-(20*(1-hum/100))).toFixed(2)\nmsg8.payload = msg.payload.rssi\nreturn [msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8]","outputs":8,"noerr":0,"x":130,"y":320,"wires":[["cfd3aa5f.6a7b88","89b77651.47e6f8","292f20de.555fc"],["4b0cf1b0.d775a","89b77651.47e6f8","5e4930d5.892e4"],["6c5add8a.4f7004","89b77651.47e6f8","631b6232.0f1e5c","d1e6f7aa.bb69a8"],["14d82268.0763ae","89b77651.47e6f8","e93b4b59.623678","bb057651.d0dc18"],["9a6d55c6.44bf78","89b77651.47e6f8","1c197c9d.32b7c3","67bb3f81.e7124"],["a55ce658.2e5028","89b77651.47e6f8","7fe4c92e.58f5f8"],["b391560d.232d78","89b77651.47e6f8","1c95169b.859cc9"],["89b77651.47e6f8","229968b0.47dee8","e9502b6e.9c4e38"]]},{"id":"cfd3aa5f.6a7b88","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/UID","qos":"","retain":"","broker":"97e00361.ed99d","x":760,"y":240,"wires":[]},{"id":"4b0cf1b0.d775a","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/Voltage","qos":"","retain":"","broker":"97e00361.ed99d","x":770,"y":300,"wires":[]},{"id":"6c5add8a.4f7004","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/Pressure","qos":"","retain":"","broker":"97e00361.ed99d","x":780,"y":360,"wires":[]},{"id":"14d82268.0763ae","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/Temperature","qos":"","retain":"","broker":"97e00361.ed99d","x":790,"y":420,"wires":[]},{"id":"9a6d55c6.44bf78","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/Humidity","qos":"","retain":"","broker":"97e00361.ed99d","x":780,"y":480,"wires":[]},{"id":"a55ce658.2e5028","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/Counter","qos":"","retain":"","broker":"97e00361.ed99d","x":770,"y":540,"wires":[]},{"id":"b391560d.232d78","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/DewPoint","qos":"","retain":"","broker":"97e00361.ed99d","x":780,"y":600,"wires":[]},{"id":"89b77651.47e6f8","type":"debug","z":"f45ea1b8.906a9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":190,"y":560,"wires":[]},{"id":"e93b4b59.623678","type":"ui_gauge","z":"f45ea1b8.906a9","name":"Temp","group":"1a258e33.906382","order":1,"width":0,"height":0,"gtype":"gage","title":"Temp","label":"C","format":"{{value}}","min":"-35","max":"35","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":430,"y":360,"wires":[]},{"id":"bb057651.d0dc18","type":"ui_chart","z":"f45ea1b8.906a9","name":"Temp","group":"1a258e33.906382","order":3,"width":0,"height":0,"label":"Temp","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-35","ymax":"35","removeOlder":"6","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":430,"y":320,"wires":[[]]},{"id":"1c197c9d.32b7c3","type":"ui_gauge","z":"f45ea1b8.906a9","name":"humidity","group":"d78f52cb.0dace","order":1,"width":0,"height":0,"gtype":"gage","title":"humidity","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":440,"y":400,"wires":[]},{"id":"67bb3f81.e7124","type":"ui_chart","z":"f45ea1b8.906a9","name":"humidity","group":"d78f52cb.0dace","order":3,"width":0,"height":0,"label":"humidity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"100","removeOlder":"6","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":440,"y":440,"wires":[[]]},{"id":"631b6232.0f1e5c","type":"ui_gauge","z":"f45ea1b8.906a9","name":"Pressure","group":"ddccce93.3e4f8","order":1,"width":0,"height":0,"gtype":"gage","title":"Pressure","label":"ммРтс","format":"{{value}}","min":"720","max":"780","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":440,"y":600,"wires":[]},{"id":"d1e6f7aa.bb69a8","type":"ui_chart","z":"f45ea1b8.906a9","name":"Pressure","group":"ddccce93.3e4f8","order":3,"width":0,"height":0,"label":"Pressure","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"6","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"outputs":1,"x":440,"y":640,"wires":[[]]},{"id":"292f20de.555fc","type":"ui_text","z":"f45ea1b8.906a9","group":"36e06bc0.afbb04","order":10,"width":0,"height":0,"name":"UID","label":"UID","format":"{{msg.payload}}","layout":"row-spread","x":430,"y":240,"wires":[]},{"id":"5e4930d5.892e4","type":"ui_text","z":"f45ea1b8.906a9","group":"36e06bc0.afbb04","order":11,"width":0,"height":0,"name":"Voltage","label":"Voltage","format":"{{msg.payload}} В","layout":"row-spread","x":440,"y":280,"wires":[]},{"id":"7fe4c92e.58f5f8","type":"ui_text","z":"f45ea1b8.906a9","group":"36e06bc0.afbb04","order":12,"width":0,"height":0,"name":"Counter","label":"Counter","format":"{{msg.payload}}","layout":"row-spread","x":440,"y":480,"wires":[]},{"id":"1c95169b.859cc9","type":"ui_text","z":"f45ea1b8.906a9","group":"36e06bc0.afbb04","order":13,"width":0,"height":0,"name":"Точка росы","label":"Точка росы","format":"{{msg.payload}} С","layout":"row-spread","x":450,"y":520,"wires":[]},{"id":"7ac3d814.ecb588","type":"function","z":"f45ea1b8.906a9","name":"getJSON","func":"var regex = new RegExp(/{.*}/)\nvar regexRSSI = new RegExp(/-.*/)\nresults = regex.exec(msg.payload);\nresultsRSSI = regexRSSI.exec(msg.payload)\nJSON1 = JSON.parse(results[0])\nJSON1.rssi = Number(resultsRSSI[0])\nmsg.payload = JSON1;\nreturn [msg]","outputs":1,"noerr":0,"x":100,"y":120,"wires":[["748d526e.7e732c","c6dcb06e.186f","64e1fa92.9cd414"]]},{"id":"748d526e.7e732c","type":"debug","z":"f45ea1b8.906a9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":430,"y":120,"wires":[]},{"id":"64e1fa92.9cd414","type":"function","z":"f45ea1b8.906a9","name":"LoRaSensor to Domoticz","func":"var Battery = parseInt((((Number(msg.payload.V/1000)-1.7)/1.3)*100).toFixed(2));\nvar Pressure = (msg.payload.P/100/1.333).toFixed(2);\nvar Temp = 0\nif (msg.payload.T/100<100)\n{Temp = (msg.payload.T/100).toFixed(2)}\nelse\n{Temp =~ msg.payload.T\nTemp = -(Temp/100).toFixed(2)}\nvar Hum = (msg.payload.H/1024).toFixed(2);\nvar rssi = Math.round((((msg.payload.rssi - (-98))*(10))/((-54) - (-98))) );\n\nif (Number(Hum)>70) \n{var HUM_Status = 3}\nelse if\n(Number(Hum)>30) \n{HUM_Status = 1}\nelse\n{\n{HUM_Status = 2}\n}\n\nif (Number(Pressure)>760) \n{var BARO_Status = 1}\nelse if\n(Number(Pressure)>750)\n{BARO_Status = 2}\nelse if\n(Number(Pressure)>740)\n{BARO_Status = 3}\nelse\n{BARO_Status = 4}\n\n\nvar text = Temp + \";\" + Hum + \";\" + HUM_Status + \";\" + Pressure + \";\" + BARO_Status;\n//var text = msg.payload[0] + \";\" + msg.payload[1]+ \";\" + msg.payload[2];\nmsg.payload = {\"idx\":26,\"RSSI\":rssi,\"Battery\":Battery,\"nvalue\":0,\"svalue\":text};\n//msg.payload = {\"idx\":8,\"RSSI\":10,\"svalue\":text};\nreturn msg;","outputs":1,"noerr":0,"x":450,"y":180,"wires":[["898609e1.a43148","7162d0e9.60321"]]},{"id":"898609e1.a43148","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"97e00361.ed99d","x":730,"y":120,"wires":[]},{"id":"7162d0e9.60321","type":"debug","z":"f45ea1b8.906a9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","x":730,"y":180,"wires":[]},{"id":"229968b0.47dee8","type":"mqtt out","z":"f45ea1b8.906a9","name":"","topic":"LoRaSensorBME/RSSI","qos":"","retain":"","broker":"97e00361.ed99d","x":770,"y":660,"wires":[]},{"id":"e9502b6e.9c4e38","type":"ui_text","z":"f45ea1b8.906a9","group":"36e06bc0.afbb04","order":13,"width":0,"height":0,"name":"RSSI","label":"RSSI","format":"{{msg.payload}}","layout":"row-spread","x":430,"y":560,"wires":[]},{"id":"1dd05898.174c37","type":"inject","z":"f45ea1b8.906a9","name":"Test + temperature","topic":"","payload":"{\"UID\":2745814594,\"V\":2910,\"P\":97476,\"T\":100,\"H\":86927,\"TS\":16792,\"rssi\":-89}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":180,"wires":[["64e1fa92.9cd414","c6dcb06e.186f"]]},{"id":"6a1b08eb.1f9b78","type":"inject","z":"f45ea1b8.906a9","name":"Test - temperature","topic":"","payload":"{\"UID\":2745814594,\"V\":2910,\"P\":97476,\"T\":4294967017,\"H\":86927,\"TS\":16792,\"rssi\":-89}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":130,"y":220,"wires":[["64e1fa92.9cd414","c6dcb06e.186f"]]},{"id":"84c91e2f.388c8","type":"function","z":"f45ea1b8.906a9","name":"Online?","func":"var x = msg.payload;\nvar ping = context.get(\"pingCountValue\") || 0;\nvar pong = context.get(\"pongCountValue\") || 0;\nping += 1;\nif (x !== false) pong += 1;\ncontext.set(\"pingCountValue\", ping);\ncontext.set(\"pongCountValue\", pong);\nif (ping == 30){\n if (pong > 0) msg.payload = 'online';\n else msg.payload = 'offline';\n global.set('LoRaBridge_status',msg.payload)\n ping = 0;\n pong = 0;\n context.set(\"pingCountValue\", ping);\n context.set(\"pongCountValue\", pong);\n return msg;\n}","outputs":1,"noerr":0,"x":280,"y":720,"wires":[["38d32a14.d6d976"]]},{"id":"38d32a14.d6d976","type":"debug","z":"f45ea1b8.906a9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":470,"y":720,"wires":[]},{"id":"7431fd90.e2fd54","type":"ping","z":"f45ea1b8.906a9","name":"RFGate","host":"192.168.1.69","timer":"5","x":110,"y":720,"wires":[["84c91e2f.388c8"]]},{"id":"97e00361.ed99d","type":"mqtt-broker","z":"","name":"localhost","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"1a258e33.906382","type":"ui_group","z":"","name":"Group 6","tab":"95b7d355.687ea","order":6,"disp":false,"width":"6","collapse":false},{"id":"d78f52cb.0dace","type":"ui_group","z":"","name":"Group 5","tab":"95b7d355.687ea","order":5,"disp":false,"width":"6","collapse":false},{"id":"ddccce93.3e4f8","type":"ui_group","z":"","name":"Group 7","tab":"95b7d355.687ea","order":7,"disp":false,"width":"6","collapse":false},{"id":"36e06bc0.afbb04","type":"ui_group","z":"","name":"Group 4","tab":"95b7d355.687ea","order":4,"disp":false,"width":8,"collapse":false},{"id":"95b7d355.687ea","type":"ui_tab","z":"","name":"Погода на улице","icon":"dashboard","order":9,"disabled":false,"hidden":false}]
RAW Paste Data