SenseHAT and OpenWeatherMap

This flow combines elements of a Raspberry Pi SenseHAT and two different sets of OpenWeatherMap data, one from a node and the other from a "one-call" API.

The one-call data is called every ten minutes and the SenseHAT messages are throttled to once per minute, then all combined to provide three comparison graphs of temperature, humidity and atmospheric pressure over a 12-hour period along with readouts of current conditions, a forecast table, an icon button for on-demand API data, and a convenience reading of CPU temperature - something to keep track of if the SenseHAT is mounted directly on top of the Pi.

Obtain an OpenWeatherMap API key, change the coordinates to reflect your current location, and adjust the temperature and pressure correction factor nodes to your needs.

If the graphed data values are zero for their beginning values, the graphs may apparently fail to display a satisfying "data granularity"; simply allow the flow to run until those zero data points "roll off" of the graphs, and the true dynamics of the data will display properly.

[{"id":"4270959d.eb439c","type":"tab","label":"WederPi","disabled":false,"info":""},{"id":"adafbaa4.1c8fd8","type":"delay","z":"4270959d.eb439c","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"minute","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":260,"y":60,"wires":[["da961cff.d1aca","99b1d9a5.84b558"]],"info":"When this project flow was first designed it also used MQTT as a demonstration of \"data fanout\" capability, so this node was added for MQTT server flood control and to prevent the charts from choking on too much data."},{"id":"99b1d9a5.84b558","type":"function","z":"4270959d.eb439c","name":"Parse Sensors","func":"var sensor = msg.payload;\nvar msg1 = {payload:sensor.temperature};\nvar msg2 = {payload:sensor.humidity};\nvar msg3 = {payload:sensor.pressure/33.86};\nreturn[msg1,msg2,msg3];","outputs":"3","noerr":0,"initialize":"","finalize":"","x":270,"y":140,"wires":[["93f56028.6b06c"],["8865a7aa.c96a08"],["ced6f5ad.b25b08"]],"inputLabels":["Sense Hat"],"outputLabels":["Temperature","Humidity","Pressure"],"info":"There are several datum coming from the senseHAT, but this node is coded to extract only the ones relative to this project."},{"id":"a917defe.fc6a5","type":"inject","z":"4270959d.eb439c","name":"Reset","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"[]","payloadType":"json","x":1140,"y":380,"wires":[["a4628d13.fb5f6"]]},{"id":"6430157a.a8340c","type":"inject","z":"4270959d.eb439c","name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"600","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":130,"y":310,"wires":[["d6748384.d8d73","c5731013.a5fc6"]],"info":"This injector is set to trigger a poll from a free weather service API every 10 minutes."},{"id":"4ea0d32c.8ecc0c","type":"function","z":"4270959d.eb439c","name":"Parse OWM","func":"var ow=msg.payload\nvar msg1 = {payload:ow.weather};\nvar msg2 = {payload:ow.clouds};\nvar msg3 = {payload:ow.tempc};\nvar msg4 = {payload:ow.humidity};\nvar msg5 = {payload:ow.pressure/33.86};\nvar msg6 = {payload:ow.winddirection};\nvar msg7 = {payload:ow.windspeed};\nvar msg8 = {payload:ow.description};\nreturn[msg1,msg2,msg3,msg4,msg5,msg6,msg7,msg8];","outputs":8,"noerr":0,"initialize":"","finalize":"","x":520,"y":310,"wires":[[],["6930390.92cafc8"],["dddd0b74.36ff78"],["82c3c0a9.4ea76"],["bb42ac5c.5b5da"],["7c5fe8f1.5f13b8"],[],["10547964.92eca7"]],"outputLabels":["weather","clouds","tempc","humidity","pressure","winddirection","windspeed","description"],"info":"This node is configured to access current JSON weather data for my location from different sources such as global and local weather models, satellites, radars and a vast network of weather stations.\n\nIf some of the parameters in the API response are not visible, it means that these weather phenomena just have not happened for the time of measurement for the city or location chosen. Only really measured or calculated data is displayed in API response."},{"id":"c1b7b9b6.5c4018","type":"link in","z":"4270959d.eb439c","name":"Chart Temps In","links":["d8208d78.3581","f69f4855.254b08","a4628d13.fb5f6"],"x":1045,"y":290,"wires":[["31f0ee20.4a2262"]]},{"id":"eb78161f.d1a108","type":"link out","z":"4270959d.eb439c","name":"SH Hum Out","links":["cb220c0a.cb36e"],"x":575,"y":140,"wires":[]},{"id":"cb220c0a.cb36e","type":"link in","z":"4270959d.eb439c","name":"Chart Hum In","links":["eb78161f.d1a108","178a767a.50e43a","9962693.ae76d98","a4628d13.fb5f6"],"x":1045,"y":320,"wires":[["23727226.b22d4e"]]},{"id":"8865a7aa.c96a08","type":"change","z":"4270959d.eb439c","name":"SH Hum Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Indoor %","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":140,"wires":[["eb78161f.d1a108"]],"info":"Since this data will be charted, this node adds the requisite message topic for the chart node."},{"id":"ced6f5ad.b25b08","type":"change","z":"4270959d.eb439c","name":"SH Press Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Indoor \"Hg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":170,"wires":[["bcb9a1a3.102b2","f1cc6c89.1325b"]],"info":"Since this data will be charted, this node adds the requisite message topic for the chart node."},{"id":"a9fd9431.5168c8","type":"change","z":"4270959d.eb439c","name":"OWM Temp Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Outdoor °F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":840,"y":290,"wires":[["f69f4855.254b08"]],"info":"Since this data will be charted, this node adds the requisite message topic for the chart node."},{"id":"82c3c0a9.4ea76","type":"change","z":"4270959d.eb439c","name":"OWM Hum Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Outdoor %","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":320,"wires":[["9962693.ae76d98"]],"info":"Since this data will be charted, this node adds the requisite message topic for the chart node."},{"id":"bb42ac5c.5b5da","type":"change","z":"4270959d.eb439c","name":"OWM Press Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Outdoor \"Hg","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":750,"y":350,"wires":[["a24caca6.83c2f"]],"info":"Since this data will be charted, this node adds the requisite message topic for the chart node."},{"id":"f1cc6c89.1325b","type":"change","z":"4270959d.eb439c","name":"Corr Factor","rules":[{"t":"set","p":"payload","pt":"msg","to":"0.5044","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":190,"wires":[["bcb9a1a3.102b2"]],"info":"This correction factor was added to inject an averaged pressure value extrapolated from several raw data values. For my particular senseHAT, the pressure correction factor value rounded to 0.5044 inches of mercury."},{"id":"bcb9a1a3.102b2","type":"join","z":"4270959d.eb439c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":910,"y":170,"wires":[["cecf67f3.493e58"]],"info":"This node combines the original data and the correction factor together for later calculation."},{"id":"93f56028.6b06c","type":"change","z":"4270959d.eb439c","name":"SH Temp Topic","rules":[{"t":"set","p":"topic","pt":"msg","to":"Indoor °F","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":460,"y":110,"wires":[["df38a966.76d328"]],"info":"Since this data will be charted, this node adds the requisite message topic for the chart node."},{"id":"d8208d78.3581","type":"link out","z":"4270959d.eb439c","name":"SH Temp Out","links":["c1b7b9b6.5c4018"],"x":1175,"y":110,"wires":[]},{"id":"f69f4855.254b08","type":"link out","z":"4270959d.eb439c","name":"OWM Temp Out","links":["c1b7b9b6.5c4018"],"x":965,"y":290,"wires":[]},{"id":"a4628d13.fb5f6","type":"link out","z":"4270959d.eb439c","name":"Chart Reset Out","links":["c1b7b9b6.5c4018","cb220c0a.cb36e","ed9d2fd3.90acd"],"x":1225,"y":380,"wires":[]},{"id":"9962693.ae76d98","type":"link out","z":"4270959d.eb439c","name":"OWM Hum Out","links":["cb220c0a.cb36e"],"x":965,"y":320,"wires":[]},{"id":"a24caca6.83c2f","type":"link out","z":"4270959d.eb439c","name":"OWM Press Out","links":["ed9d2fd3.90acd"],"x":965,"y":350,"wires":[]},{"id":"5d3ef19b.d13bc","type":"link out","z":"4270959d.eb439c","name":"SH Press Out","links":["ed9d2fd3.90acd"],"x":1175,"y":170,"wires":[]},{"id":"ed9d2fd3.90acd","type":"link in","z":"4270959d.eb439c","name":"Chart Press In","links":["5d3ef19b.d13bc","a24caca6.83c2f","a4628d13.fb5f6"],"x":1045,"y":350,"wires":[["eea00c5c.d83eb"]]},{"id":"9091f56d.1e7b08","type":"join","z":"4270959d.eb439c","name":"","mode":"custom","build":"array","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":910,"y":110,"wires":[["ed6ac732.5f6828"]],"info":"This node combines the original data and the correction factor together for later calculation."},{"id":"111f10d4.7257af","type":"change","z":"4270959d.eb439c","name":"Corr Factor","rules":[{"t":"set","p":"payload","pt":"msg","to":"-5","tot":"num"}],"action":"","property":"","from":"","to":"","reg":false,"x":760,"y":130,"wires":[["9091f56d.1e7b08"]],"info":"This correction factor was added to inject an averaged temperature value extrapolated from several raw data values. For my particular senseHAT, the temperature correction factor value rounded to -5 degrees."},{"id":"135d369.239f9c9","type":"comment","z":"4270959d.eb439c","name":"OpenWeatherMap One-Call API","info":"","x":520,"y":510,"wires":[]},{"id":"3f4af2b8.40421e","type":"function","z":"4270959d.eb439c","name":"Format forecast data","func":"var fcdata = {};\nvar units=flow.get('units');\nif (units===undefined)\n{\n  units=\"imperial\";\n}\n\nfunction formatTemp(high, low){\n    if (units == \"imperial\") {\n        if (low){\n          temp = parseFloat(high).toFixed() + '/' + parseFloat(low).toFixed()\n        }\n        else {\n          temp = parseFloat(high).toFixed() + '°F'\n        }\n    }\n    else { // metric\n//        temp = parseFloat(temp).toFixed(1) + '°C'\n        if (low){\n          temp = parseFloat(high).toFixed() + '/' + parseFloat(low).toFixed()\n        }\n        else {\n          temp = parseFloat(high).toFixed() + '°C'\n        }\n    }\n    return temp;\n}\nfunction dayName(unixTime){\n    var d = new Date(unixTime * 1000);\n    var weekday = new Array(7);\n        weekday[0] = \"Sun\";\n        weekday[1] = \"Mon\";\n        weekday[2] = \"Tue\";\n        weekday[3] = \"Wed\";\n        weekday[4] = \"Thu\";\n        weekday[5] = \"Fri\";\n        weekday[6] = \"Sat\";\n\n    return weekday[d.getDay()]\n}\nfunction timeConvert(UNIX_timestamp){\n  var a = new Date(UNIX_timestamp * 1000);\n  var hour = a.getHours();\n  var suffix = \" am\";\n  if (hour >= 12) {\n    hour = hour - 12;\n    suffix = \" pm\";\n  }\n  if (hour === 0) {\n    hour = 12;\n  }\n  var min = a.getMinutes();\n  if (min < 10) {min = \"0\" + min;}\n//  return hour + ':' + min + suffix;\n  return hour + suffix;\n}\n// prepare forecast data for CSS based ui widget\n\nfcdata.payload = {\n  rowtext: {\n  \tdata01: {\n      cell01: timeConvert(msg.payload.hourly[1].dt),\n      cell02: timeConvert(msg.payload.hourly[2].dt),\n      cell03: timeConvert(msg.payload.hourly[3].dt),\n      cell04: timeConvert(msg.payload.hourly[4].dt),\n      cell05: timeConvert(msg.payload.hourly[5].dt),\n      cell06: timeConvert(msg.payload.hourly[6].dt),\n      cell07: dayName(msg.payload.daily[1].dt),\n      cell08: dayName(msg.payload.daily[2].dt),\n      cell09: dayName(msg.payload.daily[3].dt),\n      cell10: dayName(msg.payload.daily[4].dt),\n  \t},\n  \tdata02: {\n       cell01: formatTemp(msg.payload.hourly[1].temp),\n       cell02: formatTemp(msg.payload.hourly[2].temp),\n       cell03: formatTemp(msg.payload.hourly[3].temp),\n       cell04: formatTemp(msg.payload.hourly[4].temp),\n       cell05: formatTemp(msg.payload.hourly[5].temp),\n       cell06: formatTemp(msg.payload.hourly[6].temp),\n       cell07: formatTemp(msg.payload.daily[1].temp.max, msg.payload.daily[0].temp.min),\n       cell08: formatTemp(msg.payload.daily[2].temp.max, msg.payload.daily[1].temp.min),\n       cell09: formatTemp(msg.payload.daily[3].temp.max, msg.payload.daily[2].temp.min),\n       cell10: formatTemp(msg.payload.daily[4].temp.max, msg.payload.daily[3].temp.min),\n  \t}\n  },\n  rowicons: {\n  \tdata01: {\n  \t\tcell01: msg.payload.hourly[1].weather[0].icon,\n  \t\tcell02: msg.payload.hourly[2].weather[0].icon,\n  \t\tcell03: msg.payload.hourly[3].weather[0].icon,\n  \t\tcell04: msg.payload.hourly[4].weather[0].icon,\n  \t\tcell05: msg.payload.hourly[5].weather[0].icon,\n  \t\tcell06: msg.payload.hourly[6].weather[0].icon,\n  \t\tcell07: msg.payload.daily[1].weather[0].icon,\n  \t\tcell08: msg.payload.daily[2].weather[0].icon,\n  \t\tcell09: msg.payload.daily[3].weather[0].icon,\n  \t\tcell10: msg.payload.daily[4].weather[0].icon,\n  \t}\n  }\n}\n\nreturn fcdata;","outputs":1,"noerr":0,"x":810,"y":560,"wires":[["65c0d538.89325c"]]},{"id":"acdac688.fa57d8","type":"http request","z":"4270959d.eb439c","name":"Get OWM data","method":"GET","ret":"obj","paytoqs":"query","url":"https://api.openweathermap.org/data/2.5/onecall","tls":"","persist":false,"proxy":"","authType":"","x":590,"y":470,"wires":[["359b7cc1.02bfe4","3f4af2b8.40421e"]],"info":"Use the new OpenWeatherMap One-Call API for Weather and Forecast information."},{"id":"359b7cc1.02bfe4","type":"function","z":"4270959d.eb439c","name":"Format current data","func":"var icon = {};\n\nvar units=flow.get('units');\nif (units===undefined) {units=\"imperial\";}\n\nfunction timeConvert(UNIX_timestamp)\n{\n  var a = new Date(UNIX_timestamp * 1000);\n  var hour = a.getHours();\n  var suffix = \" am\";\n  if (hour >= 12) {hour = hour - 12; suffix = \" pm\";}\n  if (hour === 0) {hour = 12;}\n  var min = a.getMinutes();\n  if (min < 10) {min = \"0\" + min;}\n  return hour + ':' + min + suffix;\n}\n\nvar degreesToCardinal = function(deg)\n{\n  if (deg>11.25 && deg<=33.75){return \"NNE\";}\n  else if (deg>33.75 && deg<56.25){return \"NE\";}\n  else if (deg>56.25 && deg<78.75){return \"ENE\";}\n  else if (deg>78.75 && deg<101.25){return \"E\";}\n  else if (deg>101.25 && deg<123.75){return \"ESE\";}\n  else if (deg>123.75 && deg<146.25){return \"SE\";}\n  else if (deg>146.25 && deg<168.75){return \"SSE\";}\n  else if (deg>168.75 && deg<191.25){return \"S\";}\n  else if (deg>191.25 && deg<213.75){return \"SSW\";}\n  else if (deg>213.75 && deg<236.25){return \"SW\";}\n  else if (deg>236.25 && deg<258.75){return \"WSW\";}\n  else if (deg>258.75 && deg<281.25){return \"W\";}\n  else if (deg>281.25 && deg<303.75){return \"WNW\";}\n  else if (deg>303.75 && deg<326.25){return \"NW\";}\n  else if (deg>326.25 && deg<348.75){return \"NNW\";}\n  else{return \"N\";}\n}\n\nif (units == \"imperial\")\n{\n  msg.payload.current.temp = msg.payload.current.temp.toFixed() + ' °F';\n  msg.payload.current.wind_speed = msg.payload.current.wind_speed.toFixed() + ' mph';\n}\nelse // metric units\n{\n  msg.payload.current.temp = msg.payload.current.temp.toFixed(1) + ' °C';\n  msg.payload.current.wind_speed = msg.payload.current.wind_speed.toFixed(1) + ' m/s';\n}\n\nmsg.payload.current.wind_cardinal = degreesToCardinal(msg.payload.current.wind_deg);\nmsg.payload.current.sunrise = timeConvert(msg.payload.current.sunrise);\nmsg.payload.current.sunset = timeConvert(msg.payload.current.sunset);\n\nvar iconString = 'wi-owm-' + msg.payload.current.weather[0].icon + ' wi-2x';\nicon = {\n    ui_control: {\n        icon: iconString\n    }\n}; \n\nreturn [msg, icon];","outputs":2,"noerr":0,"initialize":"","finalize":"","x":800,"y":470,"wires":[["d7c3d91a.bbe3c8","d9696949.ab7fe8"],["3c03b8eb.ccdaf8"]]},{"id":"c5731013.a5fc6","type":"change","z":"4270959d.eb439c","name":"Sanitize","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.lat","pt":"msg","to":"32.93","tot":"str"},{"t":"set","p":"payload.lon","pt":"msg","to":"-96.7","tot":"str"},{"t":"set","p":"payload.appid","pt":"msg","to":"b228af65c4a65a22413a1afd0537175f","tot":"str"},{"t":"set","p":"payload.units","pt":"msg","to":"imperial","tot":"str"},{"t":"set","p":"units","pt":"flow","to":"payload.units","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":420,"y":470,"wires":[["acdac688.fa57d8"]],"info":"A node to sanitize the payload, then sets the location, appid and units of measure."},{"id":"f3f6c091.e7915","type":"link out","z":"4270959d.eb439c","name":"Refresh","links":["1052d13c.87e9af"],"x":1105,"y":510,"wires":[]},{"id":"1052d13c.87e9af","type":"link in","z":"4270959d.eb439c","name":"","links":["f3f6c091.e7915"],"x":295,"y":510,"wires":[["c5731013.a5fc6"]]},{"id":"66713f0c.444da","type":"switch","z":"4270959d.eb439c","name":"tab focus","property":"tab","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":250,"y":470,"wires":[["c5731013.a5fc6"]]},{"id":"ce12d722.0595c8","type":"debug","z":"4270959d.eb439c","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":500,"y":390,"wires":[]},{"id":"3c03b8eb.ccdaf8","type":"ui_button","z":"4270959d.eb439c","name":"IconRefresh","group":"9445bd56.0fd19","order":1,"width":1,"height":1,"passthru":false,"label":"","tooltip":"Refresh","color":"","bgcolor":"","icon":"fa-refresh fa-2x","payload":"true","payloadType":"bool","topic":"","topicType":"str","x":1000,"y":510,"wires":[["f3f6c091.e7915"]]},{"id":"6930390.92cafc8","type":"ui_text","z":"4270959d.eb439c","group":"9445bd56.0fd19","order":6,"width":2,"height":1,"name":"OWM \"Cloudage\"","label":"<font size=\"1\"><i>Cloudage</i></font>","format":"<font size=\"4\">{{msg.payload}} %</font>","layout":"col-center","x":720,"y":260,"wires":[]},{"id":"10547964.92eca7","type":"ui_text","z":"4270959d.eb439c","group":"9445bd56.0fd19","order":2,"width":13,"height":1,"name":"Description","label":"","format":"<font size=\"2\">{{msg.payload}}</font>","layout":"col-center","x":730,"y":410,"wires":[]},{"id":"d9696949.ab7fe8","type":"ui_text","z":"4270959d.eb439c","group":"9445bd56.0fd19","order":7,"width":3,"height":1,"name":"Wind","label":"","format":"{{msg.payload.current.wind_speed}}&nbsp;&nbsp;<i class=\"wi wi-darksky-wind\"></i>&nbsp;&nbsp;{{msg.payload.current.wind_cardinal}}","layout":"col-center","x":980,"y":480,"wires":[]},{"id":"d7c3d91a.bbe3c8","type":"ui_text","z":"4270959d.eb439c","group":"9445bd56.0fd19","order":8,"width":2,"height":1,"name":"Temperature","label":"","format":"<p style=\"font-size: 200%\">{{msg.payload.current.temp}}</p>","layout":"row-left","x":1000,"y":450,"wires":[]},{"id":"7c5fe8f1.5f13b8","type":"ui_gauge","z":"4270959d.eb439c","name":"OWM \"Compass\"","group":"9445bd56.0fd19","order":5,"width":2,"height":2,"gtype":"compass","title":"<font size=\"1\"><i>Direction</i></font>","label":"MAGNETIC","format":"{{value}}°","min":0,"max":"359","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":750,"y":380,"wires":[]},{"id":"eea00c5c.d83eb","type":"ui_chart","z":"4270959d.eb439c","name":"Charted Pressures","group":"9445bd56.0fd19","order":12,"width":17,"height":4,"label":"","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#7afaeb","#6489b9","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1180,"y":350,"wires":[[]]},{"id":"23727226.b22d4e","type":"ui_chart","z":"4270959d.eb439c","name":"Charted Humidities","group":"9445bd56.0fd19","order":11,"width":17,"height":4,"label":"","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#00fa00","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1180,"y":320,"wires":[[]]},{"id":"31f0ee20.4a2262","type":"ui_chart","z":"4270959d.eb439c","name":"Charted Temperatures","group":"9445bd56.0fd19","order":10,"width":17,"height":4,"label":"","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"12","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#ff3232","#ff9633","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1190,"y":290,"wires":[[]]},{"id":"7e68491d.8252c8","type":"ui_ui_control","z":"4270959d.eb439c","name":"Update tab","events":"all","x":100,"y":470,"wires":[["66713f0c.444da"]]},{"id":"65c0d538.89325c","type":"ui_template","z":"4270959d.eb439c","group":"9445bd56.0fd19","name":"Forecast2","order":4,"width":10,"height":2,"format":"<div style=\"height: 100%; justify-content: center; align-items: center;\">\n <div layout=\"rowicons\" layout-align=\"space-around start\" ng-repeat=\"data in msg.payload.rowicons\" style=\"font-size:150%;padding-top: 5px;padding-bottom: 5px\">\n  <span flex style=\"color: white;text-align: center\"><i class=\"wi wi-owm-{{data.cell01}}\"></i></span>\n  <span flex style=\"color: white;text-align: center\"><i class=\"wi wi-owm-{{data.cell02}}\"></i></span>\n  <span flex style=\"color: white;text-align: center\"><i class=\"wi wi-owm-{{data.cell03}}\"></i></span>\n  <span flex style=\"color: white;text-align: center\"><i class=\"wi wi-owm-{{data.cell04}}\"></i></span>\n  <span flex style=\"color: white;text-align: center\"><i class=\"wi wi-owm-{{data.cell05}}\"></i></span>\n  <span flex style=\"color: white;text-align: center\"><i class=\"wi wi-owm-{{data.cell06}}\"></i></span>\n  <span flex style=\"color: #097479;text-align: center\"><i class=\"wi wi-owm-{{data.cell07}}\"></i></span>\n  <span flex style=\"color: #097479;text-align: center\"><i class=\"wi wi-owm-{{data.cell08}}\"></i></span>\n  <span flex style=\"color: #097479;text-align: center\"><i class=\"wi wi-owm-{{data.cell09}}\"></i></span>\n  <span flex style=\"color: #097479;text-align: center\"><i class=\"wi wi-owm-{{data.cell10}}\"></i></span>\n </div>\n <div layout=\"rowtext\" layout-align=\"space-around start\" ng-repeat=\"data in msg.payload.rowtext\" style=\"line-height: 150%\">\n  <span flex style=\"color: white;text-align: center;\">{{data.cell01}}</span>\n  <span flex style=\"color: white;text-align: center\">{{data.cell02}}</span>\n  <span flex style=\"color: white;text-align: center\">{{data.cell03}}</span>\n  <span flex style=\"color: white;text-align: center\">{{data.cell04}}</span>\n  <span flex style=\"color: white;text-align: center\">{{data.cell05}}</span>\n  <span flex style=\"color: white;text-align: center\">{{data.cell06}}</span>\n  <span flex style=\"color: #097479;text-align: center\">{{data.cell07}}</span>\n  <span flex style=\"color: #097479;text-align: center\">{{data.cell08}}</span>\n  <span flex style=\"color: #097479;text-align: center\">{{data.cell09}}</span>\n  <span flex style=\"color: #097479;text-align: center\">{{data.cell10}}</span>\n </div>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":990,"y":560,"wires":[[]]},{"id":"d6748384.d8d73","type":"openweathermap","z":"4270959d.eb439c","name":"","wtype":"current","lon":"-96.70","lat":"32.93","city":"","country":"","language":"en","credentials":{},"x":320,"y":310,"wires":[["4ea0d32c.8ecc0c","ce12d722.0595c8"]],"info":"A contributed node to poll openweathermap.org for current outdoor weather data."},{"id":"fd440b4e.bc4a68","type":"ui_level","z":"4270959d.eb439c","group":"9445bd56.0fd19","order":3,"width":3,"height":1,"name":"RasPi CPU Temp","label":"RasPi CPU °F","colorHi":"#e60000","colorWarn":"#ff9900","colorNormal":"#00b33c","colorOff":"#595959","min":0,"max":"200","segWarn":"","segHigh":"","unit":"","layout":"sh","channelA":"","channelB":"","decimals":0,"animations":"soft","shape":"1","colorschema":"fixed","textoptions":"custom","colorText":"#eeeeee","fontLabel":"0.65","fontValue":"","fontSmall":"","colorFromTheme":true,"textAnimations":false,"hideValue":false,"tickmode":"off","peakmode":false,"property":"payload","peaktime":3000,"x":780,"y":60,"wires":[],"info":"I enjoy the look of this particular gauge against my design."},{"id":"82b396e6.a6dea8","type":"rpi-sensehat in","z":"4270959d.eb439c","name":"","motion":false,"env":true,"stick":false,"x":100,"y":60,"wires":[["adafbaa4.1c8fd8"]],"info":"For this project, an official Raspberry Pi SenseHAT provides me with the three requisite sensor data sources. My SenseHAT came with a large PC project kit, so to be fair, a BME280-type sensor should do roughly the same job for about $9.00 as compared to a $35.00 SenseHAT."},{"id":"da961cff.d1aca","type":"vcgencmd","z":"4270959d.eb439c","name":"CPU Temp","fullPath":"/opt/vc/bin/vcgencmd","command":"measure_temp","codec":"H264","clock":"arm","voltage":"core","memory":"arm","videoOutput":"0","separateMsg":false,"x":450,"y":60,"wires":[["2076a38d.027f1c"]],"info":"Any output nessage from the senseHAT is used by to trigger this node into coaxing the RasPi into reporting its CPU temperature. Originally necessary to help extrapolate the actual senseHAT temperature from parasitic CPU heating, it remains as a vestigial monitor since I have physically seperated the RsPi and the senseHAT PCB's with a ribbon cable."},{"id":"df38a966.76d328","type":"unit-converter","z":"4270959d.eb439c","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","name":"C > F","x":610,"y":110,"wires":[["9091f56d.1e7b08","111f10d4.7257af"]],"info":"I was born and raised under the Imperial world measurement systems, so this node was added simply for my own convenience."},{"id":"2076a38d.027f1c","type":"unit-converter","z":"4270959d.eb439c","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","name":"C > F","x":610,"y":60,"wires":[["fd440b4e.bc4a68"]],"info":"I was born and raised under the Imperial world measurement systems, so this node was added simply for my own convenience."},{"id":"dddd0b74.36ff78","type":"unit-converter","z":"4270959d.eb439c","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","name":"C > F","x":680,"y":290,"wires":[["a9fd9431.5168c8"]],"info":"I was born and raised under the Imperial world measurement systems, so this node was added simply for my own convenience."},{"id":"cecf67f3.493e58","type":"calculator","z":"4270959d.eb439c","name":"SH Press Corr","inputMsgField":"payload","outputMsgField":"payload","operation":"sum","constant":"","x":1060,"y":170,"wires":[["5d3ef19b.d13bc"]],"info":"The SenseHAT sensor correlating equation found by recording the actual pressure and solving for its average, forming a scaling factor to calculate a calibrated pressure:\n\n**_[press cal = SH press + factor]_**  \n**press cal = SH press + 0.5044**\n\n_Not too accurate, but gets pressure readings in the ballpark._"},{"id":"ed6ac732.5f6828","type":"calculator","z":"4270959d.eb439c","name":"SH Temp Corr","inputMsgField":"payload","outputMsgField":"payload","operation":"sum","constant":"","x":1060,"y":110,"wires":[["d8208d78.3581"]],"info":"The SenseHAT sensor correlating equation found by recording the actual temperature and solving for its average, forming a scaling factor to calculate a calibrated temperature:\n\n**_[temp cal = SH temp + factor]_**  \n**temp cal = SH temp - 5**\n\n_Not too accurate, but gets temperature readings in the ballpark._"},{"id":"9445bd56.0fd19","type":"ui_group","name":"Default","tab":"863f394dc3813eac","order":1,"disp":false,"width":"17","collapse":false},{"id":"863f394dc3813eac","type":"ui_tab","name":"Home","icon":"dashboard","disabled":false,"hidden":false}]

Flow Info

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

Owner

Actions

Rate:

Node Types

Core
  • change (x9)
  • comment (x1)
  • debug (x1)
  • delay (x1)
  • function (x4)
  • http request (x1)
  • inject (x2)
  • join (x2)
  • link in (x4)
  • link out (x8)
  • switch (x1)
Other

Tags

  • Raspberry
  • Pi
  • weather
  • temperature
  • pressure
  • SenseHAT
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option