DHT11 Humidity and Temperature with extract csv data

  1. DHT11 Sensor reads temperature and humidity data
  2. ESP32 processes and publishes sensor data via MQTT
  3. MQTT broker handles message transmission
  4. Node-red dashboard visualizes real-time data
  5. Extract csv data of humidity and temperature
[{"id":"9bb602cdccf2781b","type":"ui_gauge","z":"972cf1a3ce413cb4","name":"","group":"d015aad33e1aa10a","order":4,"width":11,"height":7,"gtype":"gage","title":"Humidity Gauge","label":"%","format":"{{value}}","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":440,"y":100,"wires":[]},{"id":"aeb7d0eac6a03df0","type":"ui_gauge","z":"972cf1a3ce413cb4","name":"","group":"d015aad33e1aa10a","order":2,"width":10,"height":7,"gtype":"gage","title":"Temperature Gauge","label":"°C","format":"{{value}}","min":"-20","max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","diff":false,"className":"","x":380,"y":420,"wires":[]},{"id":"9cb7d379ce43eac9","type":"ui_chart","z":"972cf1a3ce413cb4","name":"","group":"d015aad33e1aa10a","order":26,"width":10,"height":6,"label":"Temperature Chart","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":410,"y":500,"wires":[[]]},{"id":"a8e8bbc9bed2aa75","type":"ui_chart","z":"972cf1a3ce413cb4","name":"","group":"d015aad33e1aa10a","order":28,"width":11,"height":6,"label":"Humidity Chart","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":440,"y":180,"wires":[[]]},{"id":"afc6f0c36edee809","type":"mqtt in","z":"972cf1a3ce413cb4","name":"ESP32 Temp","topic":"esp32/sensor/temperature","qos":"0","datatype":"auto-detect","broker":"31f4229f4c4a5c39","nl":false,"rap":true,"rh":0,"inputs":0,"x":110,"y":480,"wires":[["aeb7d0eac6a03df0","9cb7d379ce43eac9","d1c03f2504d5dc59","bc144b27d0938f1e"]]},{"id":"bbe1f177696e2091","type":"mqtt in","z":"972cf1a3ce413cb4","name":"ESP32 Hum","topic":"esp32/sensor/humidity","qos":"0","datatype":"auto-detect","broker":"31f4229f4c4a5c39","nl":false,"rap":true,"rh":0,"inputs":0,"x":130,"y":240,"wires":[["9bb602cdccf2781b","a8e8bbc9bed2aa75","442591a7f8e0864a","67b757868f8d5536"]]},{"id":"442591a7f8e0864a","type":"function","z":"972cf1a3ce413cb4","name":"Add timestamp","func":"var timestamp = new Date().toISOString(); // Get the current timestamp in ISO 8601 format\nvar value = msg.payload; // Get the input value\n\n// Create the output message\nmsg.payload = timestamp + \", \" + value;\n\nreturn msg;\n","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":440,"y":260,"wires":[["c8860f665249d749"]]},{"id":"d1c03f2504d5dc59","type":"function","z":"972cf1a3ce413cb4","name":"Add timestamp","func":"var timestamp = new Date().toISOString(); // Get the current timestamp in ISO 8601 format\nvar value = msg.payload; // Get the input value\n\n// Create the output message\nmsg.payload = timestamp + \", \" + value;\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":400,"y":560,"wires":[["ac60a664cc541ff2"]]},{"id":"c8860f665249d749","type":"file","z":"972cf1a3ce413cb4","name":"Humidity Data","filename":"D:\\Portofolio Github\\Dashboard DHT22 - Predictive Maintenance Github/Humidity.csv","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":800,"y":220,"wires":[[]],"info":"var timestamp = new Date().toISOString(); // Get the current timestamp in ISO 8601 format\r\nvar value = msg.payload; // Get the input value\r\n\r\n// Create the output message\r\nmsg.payload = timestamp + \", \" + value;\r\n\r\nreturn msg;"},{"id":"ac60a664cc541ff2","type":"file","z":"972cf1a3ce413cb4","name":"Temperature Data","filename":"D:\\Portofolio Github\\Dashboard DHT22 - Predictive Maintenance Github/Temperature.csv","filenameType":"str","appendNewline":true,"createDir":false,"overwriteFile":"false","encoding":"none","x":770,"y":500,"wires":[[]],"info":"var timestamp = new Date().toISOString(); // Get the current timestamp in ISO 8601 format\r\nvar value = msg.payload; // Get the input value\r\n\r\n// Create the output message\r\nmsg.payload = timestamp + \", \" + value;\r\n\r\nreturn msg;"},{"id":"b81977d38c8e1381","type":"comment","z":"972cf1a3ce413cb4","name":"Data from device to file csv","info":"","x":170,"y":40,"wires":[]},{"id":"bc144b27d0938f1e","type":"debug","z":"972cf1a3ce413cb4","name":"Data Temperature","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":390,"y":360,"wires":[]},{"id":"67b757868f8d5536","type":"debug","z":"972cf1a3ce413cb4","name":"Data Humidity","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":440,"y":40,"wires":[]},{"id":"d015aad33e1aa10a","type":"ui_group","name":"Dashboard Temperature & Humidity","tab":"84308f73a723df19","order":1,"disp":true,"width":24,"collapse":false,"className":""},{"id":"31f4229f4c4a5c39","type":"mqtt-broker","name":"","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":"84308f73a723df19","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false},{"id":"75e33e3527a5bfb6","type":"global-config","env":[],"modules":{"node-red-dashboard":"3.6.6"}}]

Flow Info

Created 3 months, 1 week ago
Rating: not yet rated

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x2)
  • file (x2)
  • function (x2)
  • mqtt in (x2)
  • mqtt-broker (x1)
Other
  • global-config (x1)
  • ui_chart (x2)
  • ui_gauge (x2)
  • ui_group (x1)
  • ui_tab (x1)

Tags

  • DHT11-Humidity-and-Temperature-with-extract-csv-data
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option