iot-camp-lab-advance-example

iot-camp-lab-advance-example

[{"id":"72c56269.18407c","type":"netpie-out","z":"e45d1581.2fce98","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"outgear","targetGearName":"lab1/","x":975.8957977294922,"y":884.3888473510742,"wires":[]},{"id":"b6521e4.97cf5e","type":"netpie-in","z":"e45d1581.2fce98","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"lab1/Humidity","x":192.5625,"y":178.7222137451172,"wires":[["1c84af1b.ce5641","6ac6c0de.ac707"]]},{"id":"c4fe1b64.c1db48","type":"netpie-in","z":"e45d1581.2fce98","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"lab1/Temperature","x":191.5625,"y":370.72222900390625,"wires":[["2139d7b0.7269a8","2dd6a53a.fe21aa"]]},{"id":"4e5f1918.252cb8","type":"debug","z":"e45d1581.2fce98","name":"","active":false,"console":"false","complete":"payload","x":719.5624847412109,"y":182.7222137451172,"wires":[]},{"id":"1c84af1b.ce5641","type":"http request","z":"e45d1581.2fce98","name":"","method":"GET","ret":"txt","url":"https://api.thingspeak.com/update?api_key=SUNFVTRM64CP5CMI&field1={{{payload}}}","tls":"","x":495.56248474121094,"y":179.7222137451172,"wires":[["4e5f1918.252cb8"]]},{"id":"2139d7b0.7269a8","type":"http request","z":"e45d1581.2fce98","name":"","method":"GET","ret":"txt","url":"https://api.thingspeak.com/update?api_key=SUNFVTRM64CP5CMI&field2={{{payload}}}","tls":"","x":498.56248474121094,"y":374.72222900390625,"wires":[["af3e192f.ed5798"]]},{"id":"af3e192f.ed5798","type":"debug","z":"e45d1581.2fce98","name":"","active":false,"console":"false","complete":"false","x":729.5624847412109,"y":373.72222900390625,"wires":[]},{"id":"2dd6a53a.fe21aa","type":"file","z":"e45d1581.2fce98","name":"","filename":"/home/sensor/testTemp.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":552.5624847412109,"y":461.72222900390625,"wires":[]},{"id":"6ac6c0de.ac707","type":"file","z":"e45d1581.2fce98","name":"","filename":"/home/sensor/testHumi.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":544.3957977294922,"y":269.0555725097656,"wires":[]},{"id":"5c96f72.2259708","type":"netpie-in","z":"e45d1581.2fce98","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"lab1/Humidity","x":175.3958282470703,"y":908.055534362793,"wires":[["733db02b.4b8d"]]},{"id":"733db02b.4b8d","type":"function","z":"e45d1581.2fce98","name":"Str2Float","func":"msg.payload = parseFloat(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":400.89573669433594,"y":906.2222213745117,"wires":[["f1e2faf3.dde4e8"]]},{"id":"f1e2faf3.dde4e8","type":"switch","z":"e45d1581.2fce98","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"70","vt":"num"},{"t":"lte","v":"35","vt":"str"}],"checkall":"true","outputs":2,"x":555.8957672119141,"y":901.555534362793,"wires":[["779dc2c2.7fff3c"],["997459f9.ada8f8"]]},{"id":"17a4de9b.bd0951","type":"comment","z":"e45d1581.2fce98","name":"Lab1","info":"สำหรับการส่งค่าขึ้นกราฟบน Thingspeak และ บันทึกไฟล์ลง txt file","x":106.89582824707031,"y":79.55555725097656,"wires":[]},{"id":"f2eefd99.9d82c","type":"comment","z":"e45d1581.2fce98","name":"Lab2","info":"ส่ง Notification ผ่าน espert.io","x":108.89582824707031,"y":540.555549621582,"wires":[]},{"id":"779dc2c2.7fff3c","type":"function","z":"e45d1581.2fce98","name":"Make On","func":"msg.payload = \"ON\"\nreturn msg;","outputs":1,"noerr":0,"x":731.8957977294922,"y":883.2222213745117,"wires":[["72c56269.18407c"]]},{"id":"e87d50d.2b3ebb","type":"comment","z":"e45d1581.2fce98","name":"Lab3","info":"เปิดเมื่อ Humidity มากกว่า 80 ให้สั่ง On","x":102.89582824707031,"y":819.555549621582,"wires":[]},{"id":"997459f9.ada8f8","type":"function","z":"e45d1581.2fce98","name":"Make OFF","func":"msg.payload = \"OFF\"\nreturn msg;","outputs":1,"noerr":0,"x":738.3957977294922,"y":944.055534362793,"wires":[["99ee3e1c.6c4ca"]]},{"id":"99ee3e1c.6c4ca","type":"netpie-out","z":"e45d1581.2fce98","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"outgear","targetGearName":"lab1/","x":972.3957977294922,"y":947.055534362793,"wires":[]},{"id":"16f3e834.b2fd08","type":"switch","z":"e45d1581.2fce98","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"35","vt":"num"},{"t":"lte","v":"25","vt":"str"}],"checkall":"true","outputs":2,"x":457.39581298828125,"y":665.055534362793,"wires":[["99391911.b505e8"],["9adcc3c7.677e3"]]},{"id":"40165744.c4c878","type":"inject","z":"e45d1581.2fce98","name":"","topic":"","payload":"50","payloadType":"num","repeat":"","crontab":"","once":false,"x":129.8958282470703,"y":630.555549621582,"wires":[["16f3e834.b2fd08"]]},{"id":"5d77d32e.70d53c","type":"inject","z":"e45d1581.2fce98","name":"","topic":"20","payload":"20","payloadType":"num","repeat":"","crontab":"","once":false,"x":131.8958282470703,"y":685.555534362793,"wires":[["16f3e834.b2fd08"]]},{"id":"99391911.b505e8","type":"function","z":"e45d1581.2fce98","name":"Hot","func":"msg.payload = \"Hot\"\nreturn msg;","outputs":1,"noerr":0,"x":637.8958282470703,"y":647.2222366333008,"wires":[["58527db5.8448d4"]]},{"id":"9adcc3c7.677e3","type":"function","z":"e45d1581.2fce98","name":"Cold","func":"msg.payload = \"COLD\"\nreturn msg;","outputs":1,"noerr":0,"x":637.8958129882812,"y":696.2222213745117,"wires":[["58527db5.8448d4"]]},{"id":"58527db5.8448d4","type":"http request","z":"e45d1581.2fce98","name":"","method":"GET","ret":"txt","url":"http://www.espert.io/MySmartphone/send?key=5290877769482240&message={{{payload}}}","tls":"","x":843.8957977294922,"y":664.8888473510742,"wires":[[]]}]

Flow Info

Created 8 years, 3 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x3)
  • debug (x2)
  • file (x2)
  • function (x5)
  • http request (x3)
  • inject (x2)
  • switch (x2)
Other
  • netpie-in (x3)
  • netpie-out (x2)

Tags

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