iot-camp-004-lab-example

iot-camp-004-lab-thingspeak-espert-float-examples

  • thingspeak
  • espert
[{"id":"ae321494.51cde8","type":"netpie-out","z":"7f213de6.80dec4","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"outgear","targetGearName":"lab1","x":892,"y":755.8333129882812,"wires":[]},{"id":"33125839.cceda8","type":"netpie-in","z":"7f213de6.80dec4","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"lab1/Humidity","x":199.6666717529297,"y":164.16666412353516,"wires":[["d604998.f29fb68","7ad6b9fc.852948"]]},{"id":"a9c93552.5636c8","type":"netpie-in","z":"7f213de6.80dec4","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"lab1/Temperature","x":192.6666717529297,"y":344.16666412353516,"wires":[["82fd6fe5.7d029","3e125419.c1edac"]]},{"id":"30abe15b.cf541e","type":"debug","z":"7f213de6.80dec4","name":"","active":true,"console":"false","complete":"payload","x":737.6666717529297,"y":175.16666412353516,"wires":[]},{"id":"d604998.f29fb68","type":"http request","z":"7f213de6.80dec4","name":"thingspeak http request","method":"GET","ret":"txt","url":"https://api.thingspeak.com/update?api_key=SUNFVTRM64CP5CMI&field1={{{payload}}}","tls":"","x":522.6666870117188,"y":137.16665649414062,"wires":[["30abe15b.cf541e"]]},{"id":"82fd6fe5.7d029","type":"http request","z":"7f213de6.80dec4","name":"thingspeak http request","method":"GET","ret":"txt","url":"https://api.thingspeak.com/update?api_key=SUNFVTRM64CP5CMI&field2={{{payload}}}","tls":"","x":494.66668701171875,"y":343.1666564941406,"wires":[["2c485567.d3b7aa"]]},{"id":"2c485567.d3b7aa","type":"debug","z":"7f213de6.80dec4","name":"","active":true,"console":"false","complete":"false","x":752.6666870117188,"y":342.1666564941406,"wires":[]},{"id":"3e125419.c1edac","type":"file","z":"7f213de6.80dec4","name":"save to file","filename":"out.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":508.6667022705078,"y":450.16666412353516,"wires":[]},{"id":"7ad6b9fc.852948","type":"file","z":"7f213de6.80dec4","name":"save to file","filename":"out.txt","appendNewline":true,"createDir":false,"overwriteFile":"false","x":447.49998474121094,"y":247.50000762939453,"wires":[]},{"id":"5b90b0bc.a46f5","type":"netpie-in","z":"7f213de6.80dec4","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"lab1/Humidity","x":189.5,"y":867.4999771118164,"wires":[["ade14232.521ec"]]},{"id":"ade14232.521ec","type":"function","z":"7f213de6.80dec4","name":"Str2Float","func":"msg.payload = parseFloat(msg.payload);\nreturn msg;","outputs":1,"noerr":0,"x":410,"y":867.6666870117188,"wires":[["ed38d6b5.12c728"]]},{"id":"ed38d6b5.12c728","type":"switch","z":"7f213de6.80dec4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"70","vt":"num"},{"t":"lte","v":"35","vt":"str"}],"checkall":"true","outputs":2,"x":553,"y":869,"wires":[["56683b7d.a997c4"],["b80de980.47f218"]]},{"id":"6ef4ecc1.910b14","type":"comment","z":"7f213de6.80dec4","name":"Lab1","info":"สำหรับการส่งค่าขึ้นกราฟบน Thingspeak และ บันทึกไฟล์ลง txt file","x":122,"y":83,"wires":[]},{"id":"f3f55b3e.0c0aa8","type":"comment","z":"7f213de6.80dec4","name":"Lab2","info":"ส่ง Notification ผ่าน espert.io","x":125,"y":515.9999923706055,"wires":[]},{"id":"56683b7d.a997c4","type":"function","z":"7f213de6.80dec4","name":"Make On","func":"msg.payload = \"ON\"\nreturn msg;","outputs":1,"noerr":0,"x":698,"y":820.6666870117188,"wires":[["ae321494.51cde8"]]},{"id":"8d0ed96d.72f128","type":"comment","z":"7f213de6.80dec4","name":"Lab3","info":"เปิดเมื่อ Humidity มากกว่า 80 ให้สั่ง On","x":119,"y":794.9999923706055,"wires":[]},{"id":"b80de980.47f218","type":"function","z":"7f213de6.80dec4","name":"Make On","func":"msg.payload = \"OFF\"\nreturn msg;","outputs":1,"noerr":0,"x":702.5,"y":947.5,"wires":[["802efdff.7fd1"]]},{"id":"802efdff.7fd1","type":"netpie-out","z":"7f213de6.80dec4","appId":"HelloNETPIE","appKey":"5ifAnB7E3sva4ld","appSecret":"jijxisdhZuMLHnbH20KFtmG9V","name":"","gearName":"outgear","targetGearName":"lab1","x":894.5,"y":1022.5,"wires":[]},{"id":"14dcc41f.eb233c","type":"switch","z":"7f213de6.80dec4","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gt","v":"35","vt":"num"},{"t":"lte","v":"25","vt":"str"}],"checkall":"true","outputs":2,"x":341.4999694824219,"y":640.5,"wires":[["68e87251.97178c"],["2f4d150a.d0b2ea"]]},{"id":"efd91cec.1026e","type":"inject","z":"7f213de6.80dec4","name":"","topic":"","payload":"50","payloadType":"num","repeat":"","crontab":"","once":false,"x":146,"y":605.9999923706055,"wires":[["14dcc41f.eb233c"]]},{"id":"388014d5.c77fec","type":"inject","z":"7f213de6.80dec4","name":"","topic":"","payload":"20","payloadType":"num","repeat":"","crontab":"","once":false,"x":148,"y":660.9999771118164,"wires":[["14dcc41f.eb233c"]]},{"id":"68e87251.97178c","type":"function","z":"7f213de6.80dec4","name":"Hot","func":"msg.payload = \"Hot\"\nreturn msg;","outputs":1,"noerr":0,"x":567,"y":567.6666870117188,"wires":[["152f079.fead0f8"]]},{"id":"2f4d150a.d0b2ea","type":"function","z":"7f213de6.80dec4","name":"Cold","func":"msg.payload = \"COLD\"\nreturn msg;","outputs":1,"noerr":0,"x":566,"y":680.6666870117188,"wires":[["de14b2f7.21eb5"]]},{"id":"152f079.fead0f8","type":"http request","z":"7f213de6.80dec4","name":"espert http request","method":"GET","ret":"txt","url":"http://www.espert.io/MySmartphone/send?key=5290877769482240&message=hot","tls":"","x":770,"y":570.3333129882812,"wires":[[]]},{"id":"de14b2f7.21eb5","type":"http request","z":"7f213de6.80dec4","name":"espert http request","method":"GET","ret":"txt","url":"http://www.espert.io/MySmartphone/send?key=5290877769482240&message=cold","tls":"","x":762.5,"y":680.5,"wires":[[]]}]
NAzT

Flow Info

created 10 months ago

Node Types

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

Tags

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