node-red-Openweathermap-frost-warn-via-mail-and-twitter

this node sends A warning if the temperature is beyound or above a setted value as double. setting up:

  • you need an API-Key from Openweathermap.org register and aquire an Key for free.
  • edit the openweahtermap-node, insert your API-key and City and Country-Iso-code eg. London and UK
  • edit the function-node the condition term values and the comparision statement
  • edit the Twitter-node
  • and the email-node for notifying.

than you can click on the button of the injection-input node and see the result in your email or on debug-window. and/or on your twitter-account.

[{"id":"77de7965.5acf58","type":"inject","z":"95e961b4.a68258","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"","once":false,"x":202,"y":72,"wires":[["b4081dd5.2586"]]},{"id":"b4081dd5.2586","type":"openweathermap","z":"95e961b4.a68258","name":"Weather ","wtype":"forecast","lon":"","lat":"","city":"","country":"","language":"de","x":488,"y":110,"wires":[["9509f59.6cbbf88","21b4a54f.ebd7fa"]]},{"id":"45d650c6.75116","type":"inject","z":"95e961b4.a68258","name":"","topic":"","payload":"true","payloadType":"bool","repeat":"","crontab":"00 12 * * *","once":false,"x":204,"y":127,"wires":[["b4081dd5.2586"]]},{"id":"9509f59.6cbbf88","type":"debug","z":"95e961b4.a68258","name":"","active":true,"console":"false","complete":"payload","x":787,"y":131,"wires":[]},{"id":"21b4a54f.ebd7fa","type":"function","z":"95e961b4.a68258","name":"createWarning","func":"for (i=0;i<msg.payload.length;i++){\n    if (msg.payload[i].main.temp_min < 3.0){\n        var msg1 ={payload: \"Achtung! am \" +msg.payload[i].dt_txt  + \"\\nTemperatur min. :\" + msg.payload[i].main.temp_min};\n        break;\n        }\n    }    \nreturn msg1;","outputs":1,"noerr":0,"x":644,"y":233,"wires":[["b2776f3d.bb4ea8","8dfbdd2f.592b","b617eb9a.1cb81"]]},{"id":"b2776f3d.bb4ea8","type":"e-mail","z":"95e961b4.a68258","server":"smtp.google.com","port":"465","secure":true,"name":"Mail","dname":"","x":915,"y":295,"wires":[]},{"id":"8dfbdd2f.592b","type":"twitter out","z":"95e961b4.a68258","twitter":"","name":"Twitter","x":818,"y":366,"wires":[]},{"id":"b617eb9a.1cb81","type":"debug","z":"95e961b4.a68258","name":"","active":true,"console":"false","complete":"payload","x":842,"y":231,"wires":[]}]
ChrSchultz

Flow Info

created 10 months, 3 weeks ago

Node Types

Core
  • debug (x2)
  • e-mail (x1)
  • function (x1)
  • inject (x2)
  • twitter out (x1)
Other
  • openweathermap (x1)

Tags

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