Aquesta pràctica està destinada a veure com es pot comunicar node-red i la nodeMCU mitjançant el servidor de blynk sense necessitat d'utilitzar l'aplicació del mòbil si no volem. Farem servir l'sketch i si l'app de la pràctica IoT-nodeMCU(II).

Primer importeu aquest flow, modifiqueu el token i les credencials d'email:

[{"id":"3a21e791.3ce8c","type":"inject","z":"a194a393.1ff608","name":"ON","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":233,"y":124,"wires":[["e6a30cea.4153d"]]},{"id":"e6a30cea.4153d","type":"http request","z":"a194a393.1ff608","name":"ON-Q0","method":"GET","ret":"txt","url":"http://vps249990.ovh.net:8080/5ea599c87c164f74b6f93d14247e4059/update/D0?value=0","tls":"","x":456,"y":125,"wires":[[]]},{"id":"74095bcb.4b937c","type":"inject","z":"a194a393.1ff608","name":"OFF","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":233,"y":164,"wires":[["3f35266c.dbd49a"]]},{"id":"3f35266c.dbd49a","type":"http request","z":"a194a393.1ff608","name":"OFF-Q0","method":"GET","ret":"txt","url":"http://vps249990.ovh.net:8080/5ea599c87c164f74b6f93d14247e4059/update/D0?value=1","tls":"","x":455,"y":162,"wires":[[]]},{"id":"b6c2c6b8.c0a9e","type":"comment","z":"a194a393.1ff608","name":"ON-OFF Q0","info":"","x":231.5,"y":84,"wires":[]},{"id":"b16c204f.fceb1","type":"function","z":"a194a393.1ff608","name":"headers","func":" msg.headers = \n {\n \"Content-type\" : \"application/json\" \n };\n //msg.payload=\"[ \\\"0\\\"]\"\n return msg;","outputs":1,"noerr":0,"x":556.2222290039062,"y":261,"wires":[["40ba316f.41313"]]},{"id":"c41f4127.fc13e8","type":"trigger","z":"a194a393.1ff608","op1":"[ \"0\"]","op2":"[ \"1\"]","op1type":"str","op2type":"str","duration":"5","extend":false,"units":"s","reset":"","name":"","x":398.88885498046875,"y":260.88885498046875,"wires":[["b16c204f.fceb1"]]},{"id":"794bc640.c6e83","type":"inject","z":"a194a393.1ff608","name":"","topic":"","payload":"","payloadType":"date","repeat":"10","crontab":"","once":false,"x":241,"y":260.6666259765625,"wires":[["c41f4127.fc13e8"]]},{"id":"40ba316f.41313","type":"http request","z":"a194a393.1ff608","name":"ON-OFF Q0","method":"PUT","ret":"txt","url":"http://vps249990.ovh.net:8080/5ea599c87c164f74b6f93d14247e4059/pin/D0","tls":"","x":740.8333129882812,"y":260.83331298828125,"wires":[[]]},{"id":"194815ff.17c3a2","type":"comment","z":"a194a393.1ff608","name":"INTERMITÈNCIA  Q0, 5'' ON, 5'' OFF","info":"","x":303,"y":220,"wires":[]},{"id":"bba701ff.502958","type":"inject","z":"a194a393.1ff608","name":"ON 11h","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 11 * * *","once":false,"x":231,"y":372,"wires":[["429997b0.6d7158"]]},{"id":"429997b0.6d7158","type":"http request","z":"a194a393.1ff608","name":"ON-Q2","method":"GET","ret":"txt","url":"http://vps249990.ovh.net:8080/5ea599c87c164f74b6f93d14247e4059/update/D2?value=0","tls":"","x":444,"y":373,"wires":[[]]},{"id":"87043ea5.46b698","type":"inject","z":"a194a393.1ff608","name":"OFF 12h","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"00 12 * * *","once":false,"x":238,"y":413,"wires":[["6cd78ebf.242f98"]]},{"id":"6cd78ebf.242f98","type":"http request","z":"a194a393.1ff608","name":"OFF-Q2","method":"GET","ret":"txt","url":"http://vps249990.ovh.net:8080/5ea599c87c164f74b6f93d14247e4059/update/D2?value=1","tls":"","x":443,"y":410,"wires":[[]]},{"id":"bb51123f.d10b48","type":"comment","z":"a194a393.1ff608","name":"ON Q2 DE 11h A 12h","info":"","x":249.5,"y":332,"wires":[]},{"id":"5d5f47d0.72d6a8","type":"inject","z":"a194a393.1ff608","name":"Comprova cada 5' I14","topic":"","payload":"","payloadType":"date","repeat":"5","crontab":"","once":false,"x":281,"y":520.4444274902344,"wires":[["336c0ce6.11c82c"]]},{"id":"336c0ce6.11c82c","type":"http request","z":"a194a393.1ff608","name":"GET I14","method":"GET","ret":"txt","url":"http://vps249990.ovh.net:8080/5ea599c87c164f74b6f93d14247e4059/get/V14","tls":"","x":474,"y":520.4444580078125,"wires":[["7c25bdf6.ce55f4"]]},{"id":"7c25bdf6.ce55f4","type":"function","z":"a194a393.1ff608","name":"Si I14==255","func":"if (msg.payload=='[\"255\"]'){\n msg.payload =\"Alarma I14!\";\n return msg;\n}\n","outputs":1,"noerr":0,"x":656.5,"y":521.4444580078125,"wires":[["42eb0312.b9a04c"]]},{"id":"4b403aef.658cec","type":"comment","z":"a194a393.1ff608","name":"ALARMA I14","info":"","x":218.66665649414062,"y":480,"wires":[]},{"id":"42eb0312.b9a04c","type":"e-mail","z":"a194a393.1ff608","server":"smtp.gmail.com","port":"465","secure":true,"name":"jnogues@gmail.com","dname":"","x":885.5,"y":521,"wires":[]}]

Comproveu el funcionament.