Weather Monitoring System using MQTT Protocol

Weather Monitoring System using MQTT Protocol

[{"id":"99cc9be2c56d3238","type":"tab","label":"Flow 1","disabled":false,"info":"","env":[]},{"id":"8ac4eedea0137346","type":"mqtt in","z":"99cc9be2c56d3238","name":"","topic":"weather/sample","qos":"0","datatype":"auto-detect","broker":"bb9b255b2ab99149","nl":false,"rap":true,"rh":0,"inputs":0,"x":100,"y":280,"wires":[["6ec2a04fdda35a5b","5b11a12c2bc169ea","ebf5b68cc610b20a","df24ce2857fc0cfc","4c887c1842dae29d","9e799dcc39c440e0","dba42c6c8a9f0db6","d9eac6e675a03757"]]},{"id":"6ec2a04fdda35a5b","type":"debug","z":"99cc9be2c56d3238","name":"Sample","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":340,"y":420,"wires":[]},{"id":"27f5855f6f5587b4","type":"ui_chart","z":"99cc9be2c56d3238","name":"","group":"e05b403afe4c6562","order":0,"width":0,"height":0,"label":"Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":630,"y":60,"wires":[[]]},{"id":"d1654bcb9b9bdee0","type":"ui_chart","z":"99cc9be2c56d3238","name":"","group":"e05b403afe4c6562","order":1,"width":0,"height":0,"label":"Humidity","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":1,"removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":620,"y":120,"wires":[[]]},{"id":"1ebc6d279d9bc7be","type":"ui_gauge","z":"99cc9be2c56d3238","name":"","group":"cbe1c0772d77e08b","order":2,"width":0,"height":0,"gtype":"gage","title":"Heat Index","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":630,"y":300,"wires":[]},{"id":"318463cc1dbb0fc3","type":"ui_gauge","z":"99cc9be2c56d3238","name":"Alcohol Concentration","group":"cbe1c0772d77e08b","order":3,"width":0,"height":0,"gtype":"gage","title":"Alcohol Concentration","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":660,"y":360,"wires":[]},{"id":"85b53fef4ae9d00c","type":"twilio out","z":"99cc9be2c56d3238","twilio":"4cc736fa346d634c","twilioType":"sms","url":"","number":"whatsapp:919811890414","name":"Twillio Sparsh","x":740,"y":420,"wires":[]},{"id":"5b11a12c2bc169ea","type":"function","z":"99cc9be2c56d3238","name":"Format the object for sending on whatsapp","func":"var data = msg.payload;\nvar temperature = data.temperature\nvar humidity = data.humidity;\nvar heatIndex = data.heatIndex\nvar alcoholConcentration = data.alcoholConcentration;\nvar CO_PPM=data.CO_PPM;\nvar AQI=data.AQI;\n\nmsg.payload = `Temperature: ${temperature} °C\\n` +\n    `Humidity: ${humidity}\\n` +\n    `Heat Index: ${heatIndex} °F\\n` +\n    `Alcohol Concentration: ${alcoholConcentration} PPM \\n`+\n    `CO parts per million: ${CO_PPM} PPM \\n`+\n    `AQI: ${AQI} \\n`;\n    \nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":450,"y":480,"wires":[[]]},{"id":"ebf5b68cc610b20a","type":"function","z":"99cc9be2c56d3238","name":"Temperature","func":"var temp = Math.round(msg.payload.temperature); // Rounds the temperature to the nearest integer\nmsg.payload = temp; // Assigns the rounded integer value to msg.payload\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":60,"wires":[["27f5855f6f5587b4"]]},{"id":"df24ce2857fc0cfc","type":"function","z":"99cc9be2c56d3238","name":"Humidity","func":"msg.payload = Math.round(msg.payload.humidity);// Assigns the rounded integer value to msg.payload\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":120,"wires":[["d1654bcb9b9bdee0"]]},{"id":"4c887c1842dae29d","type":"function","z":"99cc9be2c56d3238","name":"Heat Index","func":"msg.payload = Math.round(msg.payload.heatIndex);// Assigns the rounded integer value to msg.payload\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":350,"y":300,"wires":[["1ebc6d279d9bc7be"]]},{"id":"9e799dcc39c440e0","type":"function","z":"99cc9be2c56d3238","name":"Alcohol Concentration","func":"msg.payload = Math.round(msg.payload.alcoholConcentration);// Assigns the rounded integer value to msg.payload\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":360,"wires":[["318463cc1dbb0fc3"]]},{"id":"dba42c6c8a9f0db6","type":"function","z":"99cc9be2c56d3238","name":"CO_PPM","func":"msg.payload = Math.round(msg.payload.CO_PPM);// Assigns the rounded integer value to msg.payload\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":180,"wires":[["780df77fee2a9fdc"]]},{"id":"d9eac6e675a03757","type":"function","z":"99cc9be2c56d3238","name":"AQI","func":"msg.payload = Math.round(msg.payload.AQI);// Assigns the rounded integer value to msg.payload\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":240,"wires":[["86a37e9844413a56"]]},{"id":"780df77fee2a9fdc","type":"ui_gauge","z":"99cc9be2c56d3238","name":"","group":"06722350d62e620d","order":0,"width":0,"height":0,"gtype":"gage","title":"CO_PPM","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":620,"y":180,"wires":[]},{"id":"86a37e9844413a56","type":"ui_gauge","z":"99cc9be2c56d3238","name":"","group":"06722350d62e620d","order":1,"width":0,"height":0,"gtype":"gage","title":"AQI","label":"units","format":"{{value}}","min":0,"max":10,"colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":610,"y":240,"wires":[]},{"id":"5594d6f6bf163535","type":"twilio out","z":"99cc9be2c56d3238","twilio":"4cc736fa346d634c","twilioType":"sms","url":"","number":"whatsapp:917488027831","name":"Twillio Sarv","x":730,"y":480,"wires":[]},{"id":"252b838f90638e6f","type":"twilio out","z":"99cc9be2c56d3238","twilio":"4cc736fa346d634c","twilioType":"sms","url":"","number":"whatsapp:918248910042","name":"Twillio Aquib","x":730,"y":540,"wires":[]},{"id":"bb9b255b2ab99149","type":"mqtt-broker","name":"emqx free broker","broker":"broker.emqx.io","port":"1883","clientid":"","autoConnect":true,"usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"autoUnsubscribe":true,"birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closeRetain":"false","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","willMsg":{},"userProps":"","sessionExpiry":""},{"id":"e05b403afe4c6562","type":"ui_group","name":"DHT 11","tab":"28dced3eb7a91628","order":2,"disp":true,"width":"10","collapse":false,"className":""},{"id":"cbe1c0772d77e08b","type":"ui_group","name":"MQ-3","tab":"28dced3eb7a91628","order":2,"disp":true,"width":"13","collapse":false,"className":""},{"id":"4cc736fa346d634c","type":"twilio-api","name":"","sid":"AC16dc78b6efd7c95f9063fc3b8ab996bc","from":"whatsapp:+14155238886"},{"id":"06722350d62e620d","type":"ui_group","name":"MQ 9,135","tab":"28dced3eb7a91628","order":3,"disp":true,"width":"8","collapse":false,"className":""},{"id":"28dced3eb7a91628","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Flow Info

Created 8 months ago
Rating: 5 1

Actions

Rate:

Node Types

Core
  • debug (x1)
  • function (x7)
  • mqtt in (x1)
  • mqtt-broker (x1)
Other
  • tab (x1)
  • twilio out (x3)
  • twilio-api (x1)
  • ui_chart (x2)
  • ui_gauge (x4)
  • ui_group (x3)
  • ui_tab (x1)

Tags

Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option