Openweather Dashboard Flow - Work in Progress

This is coming along nicely. I am working to add the openweather alerts too. I have copied from a couple other flows and want to thank them too. I love the clock and still working on that. The openweather One Call came from another flow but using it for the update is cool. I wish I could ass the dashboard picture here. I added 2 pictures in the comments on the github page. It looks really great. And the graph section pulls in the save data on reboot.

4/5/2021 Corrected a few mistakes and added the openweather Air Polution data in gauges but not graphs yet.

4/6/2021 Fixed the C/F conversion in the forcast. Its all changable but imperial until I can figure out a good initialization method to set these.

[{"id":"35ad4fe4.069a3","type":"subflow","name":"SaveChart","info":"","category":"","in":[{"x":80,"y":60,"wires":[{"id":"f4457c36.28ce1"}]}],"out":[{"x":820,"y":80,"wires":[{"id":"cf553dbd.50f9a","port":0}]}]},{"id":"db9cbd5c.fb547","type":"file","z":"35ad4fe4.069a3","name":"","filename":"","appendNewline":true,"createDir":true,"overwriteFile":"true","x":690,"y":40,"wires":[[]]},{"id":"f7f46486.9881a8","type":"file in","z":"35ad4fe4.069a3","name":"","filename":"","format":"utf8","sendError":true,"x":530,"y":80,"wires":[["cf553dbd.50f9a"]]},{"id":"ac2168dc.ee28f8","type":"json","z":"35ad4fe4.069a3","name":"","x":530,"y":40,"wires":[["db9cbd5c.fb547"]]},{"id":"cf553dbd.50f9a","type":"json","z":"35ad4fe4.069a3","name":"","property":"payload","action":"","pretty":false,"x":690,"y":80,"wires":[[]]},{"id":"f4457c36.28ce1","type":"function","z":"35ad4fe4.069a3","name":"LoadSave","func":"var strSafe=msg.topic;\nif(strSafe)\n{\n    strSafe=strSafe.replace(/[^a-z0-9]/gi, '_').toLowerCase();\n    var loaded=context.get(strSafe)||0;\n    msg.filename =\"/home/pi/charts/\"+strSafe+\".dat\";\n    //node.warn(loaded);\n    if(0===loaded)\n    {\n        //load chart!! \n        msg.payload=\"load\";\n        context.set(strSafe,1);\n        \n        //node.warn(\"Loading \" +strSafe);\n    }\n    else if ( msg.command == \"delete\")\n    {\n        //node.warn(\"Writing \" +strSafe);\n        return msg1;\n    }\n    return msg;    \n}\nreturn null;\n\n","outputs":2,"noerr":0,"initialize":"","finalize":"","x":210,"y":60,"wires":[["99a5d40b.95d618"],["5f54b289.5fe174"]]},{"id":"99a5d40b.95d618","type":"switch","z":"35ad4fe4.069a3","name":"Load data","property":"payload","propertyType":"msg","rules":[{"t":"neq","v":"load","vt":"str"},{"t":"eq","v":"load","vt":"str"}],"checkall":"false","repair":false,"outputs":2,"x":380,"y":60,"wires":[["ac2168dc.ee28f8"],["f7f46486.9881a8"]]},{"id":"5f54b289.5fe174","type":"debug","z":"35ad4fe4.069a3","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":540,"y":260,"wires":[]},{"id":"6acc9db.7a04264","type":"tab","label":"Weather","disabled":false,"info":""},{"id":"777b03c9.e1a804","type":"function","z":"6acc9db.7a04264","name":"Openweather Zabbix Function","func":"var payload=msg.payload;\nmsg.payload = [\n    ['Zabbix server', 'openweather.tempk', payload.tempk ],\n    ['Zabbix server', 'openweather.maxtemp', payload.maxtemp ],\n    ['Zabbix server', 'openweather.mintemp', payload.mintemp ],\n    ['Zabbix server', 'openweather.tempc', payload.tempc ],\n    ['Zabbix server', 'openweather.temp_maxc', payload.temp_maxc ],\n    ['Zabbix server', 'openweather.temp_minc', payload.temp_minc ],\n    ['Zabbix server', 'openweather.humidity', payload.humidity ],\n    ['Zabbix server', 'openweather.pressure', payload.pressure ],\n    ['Zabbix server', 'openweather.windspeed', payload.windspeed ],\n    ['Zabbix server', 'openweather.winddirection', payload.winddirection ],\n    ['Zabbix server', 'openweather.sunrise', payload.sunrise ],\n    ['Zabbix server', 'openweather.sunset', payload.sunset ],\n    ['Zabbix server', 'openweather.clouds', payload.clouds ]\n]    \nreturn msg;","outputs":1,"noerr":0,"x":450,"y":220,"wires":[[]]},{"id":"58bdc1c1.c8c78","type":"function","z":"6acc9db.7a04264","name":"Openweather Dashboard Function","func":"function 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}\nvar iconString = 'wi-owm-' + msg.payload.current.weather[0].icon + ' wi-5x';\nicon = {\n    ui_control: {\n        icon: iconString\n    }\n}; \nvar msg1 = { payload:msg.payload.current.temp };\n    msg1.topic = \"Max\";\nvar msg2 = { payload:msg.payload.current.temp };\n    msg2.topic = \"Current\";\nvar msg3 = { payload:msg.payload.current.temp };\n    msg3.topic = \"Min\";\nvar msg4 = { payload:msg.payload.current.weather[0].description};\n    msg4.topic = \"description\";\nvar msg5 = { icon };\nvar msg6 = { payload:msg.payload.current.pressure};\n    msg6.topic = \"pressure\";\nvar msg7 = { payload:msg.payload.current.humidity};\n    msg7.topic = \"humidity\";\nvar msg8 = { payload:msg.payload.current.clouds};\n    msg8.topic = \"clouds\";\nvar msg9 = { payload:msg.payload.current.wind_speed};\n    msg9.topic = \"windspeed\";\nvar msg10 = { payload:msg.payload.current.wind_deg};\n    msg10.topic = \"winddirection\";\nvar msg11 = { payload:timeConvert(msg.payload.current.sunrise)};\n    msg11.topic = \"sunrise\";\nvar msg12 = { payload:timeConvert(msg.payload.current.sunset)};\n    msg12.topic = \"sunset\";\nvar msg13 = { payload:msg.payload.current.visibility};\n    msg13.topic = \"visibility\";\nvar msg14 = { payload:msg.location};\n    msg14.topic = \"location\";\nvar msg15 = { payload:msg.payload.current.feels_like};\n    msg15.topic = \"feels_like\";\nvar msg16 = { payload:msg.payload.current.dew_point};\n    msg16.topic = \"dew_point\";\nvar msg17 = { payload:msg.payload.current.uvi};\n    msg17.topic = \"uvi\";\nreturn [ msg1, msg2, msg3, msg4, icon, msg6, msg7, msg8, msg9, msg10, msg11, msg12, msg13, msg14, msg15, msg16, msg17 ];","outputs":17,"noerr":0,"initialize":"","finalize":"","x":460,"y":460,"wires":[["9265232f.4b8e3","d527af0.1df57d"],["9265232f.4b8e3","d527af0.1df57d"],["9265232f.4b8e3","d527af0.1df57d"],["7fa57eb5.3ce29"],["6d91997c.9fe118"],["30720f6d.cc00b","fca87095.0adfc"],["383c6806.493288","41070f1f.5a77e8"],["7721052c.889044","e8be6823.2e7978"],["4dc13725.0a2d28"],["8a47c24c.a5be78","699d9e82.bec68"],["ef7d0ae5.9e0da8"],["773587f9.986fd"],["4c6aad39.8b9994","3eee7a.a8cca986"],["2f771755.c3e0d8","91c2df3a.0f028"],["1e5e118d.0c3ee6"],["38e0377d.bcb26"],["d440839c.ff7e8","3fcf556d.8a3ac2"]],"outputLabels":["Temp Max","Current Temp","Temp Min","Description","Weather icon","Pressure","Humidity","Clouds","Wind Speed","Wind Direction","Sunrise","Sunset","Visibility","Location","Feels Like","Dew Point","UV Index"]},{"id":"9557f682.c2d048","type":"ui_gauge","z":"6acc9db.7a04264","name":"Max Temp","group":"1bebc031.176c08","order":2,"width":"4","height":"4","gtype":"gage","title":"Max Temp","label":"","format":"{{value | number:2}} ºF","min":"-15","max":"120","colors":["#0080ff","#008040","#ca3838"],"seg1":"60","seg2":"80","x":980,"y":80,"wires":[]},{"id":"9d3a2b43.a1bbc8","type":"ui_gauge","z":"6acc9db.7a04264","name":"Current Temperature","group":"1bebc031.176c08","order":3,"width":"4","height":"4","gtype":"gage","title":"Current Temperature","label":"","format":"{{value | number:2}} ºF","min":"-15","max":"120","colors":["#0080ff","#008040","#ca3838"],"seg1":"60","seg2":"80","x":1020,"y":160,"wires":[]},{"id":"caca4a17.cfd48","type":"ui_gauge","z":"6acc9db.7a04264","name":"Min Temp","group":"1bebc031.176c08","order":5,"width":"4","height":"4","gtype":"gage","title":"Min Temp","label":"","format":"{{value | number:2}} ºF","min":"-15","max":"120","colors":["#0080ff","#008040","#ca3838"],"seg1":"60","seg2":"80","x":980,"y":200,"wires":[]},{"id":"fca87095.0adfc","type":"ui_gauge","z":"6acc9db.7a04264","name":"Pressure","group":"1bebc031.176c08","order":6,"width":"4","height":"4","gtype":"gage","title":"Pressure","label":"MBAR","format":"{{value | number:2}}","min":"900","max":"1050","colors":["#ff0000","#e6e600","#008040"],"seg1":"1015","seg2":"1022","x":980,"y":400,"wires":[]},{"id":"41070f1f.5a77e8","type":"ui_gauge","z":"6acc9db.7a04264","name":"Humidity","group":"1bebc031.176c08","order":7,"width":"4","height":"4","gtype":"gage","title":"Humidity","label":"","format":"{{value | number:2}}%","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"45","seg2":"55","x":980,"y":480,"wires":[]},{"id":"583d26ff.d270e8","type":"ui_gauge","z":"6acc9db.7a04264","name":"Windspeed","group":"1bebc031.176c08","order":9,"width":"4","height":"4","gtype":"donut","title":"Windspeed","label":"Miles per Hour","format":"{{value | number:2}}","min":0,"max":"110","colors":["#00b500","#e6e600","#ca3838"],"seg1":"5","seg2":"7","x":990,"y":640,"wires":[]},{"id":"8a47c24c.a5be78","type":"ui_gauge","z":"6acc9db.7a04264","name":"Wind Direction","group":"1bebc031.176c08","order":1,"width":"4","height":"4","gtype":"compass","title":"Wind Direction","label":"Degrees","format":"{{value}}","min":0,"max":"359","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":1000,"y":720,"wires":[]},{"id":"e8be6823.2e7978","type":"ui_gauge","z":"6acc9db.7a04264","name":"Clouds","group":"1bebc031.176c08","order":8,"width":"4","height":"4","gtype":"gage","title":"Clouds","label":"","format":"{{value | number:2}}%","min":0,"max":"100","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":980,"y":560,"wires":[]},{"id":"e08f590.57f33a8","type":"ui_chart","z":"6acc9db.7a04264","name":"Temperature - Celcius","group":"b1429252.2a088","order":2,"width":30,"height":6,"label":"Temperature - Celcius","chartType":"line","legend":"true","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1020,"y":240,"wires":[["c68e5000.93a4b8"]]},{"id":"30720f6d.cc00b","type":"ui_chart","z":"6acc9db.7a04264","name":"Pressure","group":"a46941f4.c5aae","order":1,"width":30,"height":6,"label":"Pressure","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":980,"y":360,"wires":[["bd8bce63.89b87"]]},{"id":"383c6806.493288","type":"ui_chart","z":"6acc9db.7a04264","name":"Humidity","group":"b595fe17.5c088","order":1,"width":30,"height":6,"label":"Humidity","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":980,"y":440,"wires":[["356ebde8.088eea"]]},{"id":"7721052c.889044","type":"ui_chart","z":"6acc9db.7a04264","name":"Clouds","group":"d9f5d97.e65a328","order":1,"width":30,"height":6,"label":"Clouds","chartType":"line","legend":"false","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"0","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":980,"y":520,"wires":[["3329dad5.7f681e"]]},{"id":"2cec0989.5a6ade","type":"ui_chart","z":"6acc9db.7a04264","name":"Temperature -  Fahrenheit","group":"b1429252.2a088","order":1,"width":30,"height":6,"label":"Temperature -  Fahrenheit","chartType":"line","legend":"true","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":1030,"y":120,"wires":[["661bd97d.efd978"]]},{"id":"fa3f6c4a.f43d58","type":"ui_chart","z":"6acc9db.7a04264","name":"Windspeed","group":"e6495e20.3bb068","order":1,"width":30,"height":6,"label":"Windspeed","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":990,"y":600,"wires":[["9e481d1f.8fc5f8"]]},{"id":"57dff58e.8ec274","type":"unit-converter","z":"6acc9db.7a04264","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":false,"outputFieldDecimals":"","name":"","x":520,"y":120,"wires":[["649c76ed.1d9a88"]]},{"id":"4dc13725.0a2d28","type":"unit-converter","z":"6acc9db.7a04264","category":"speed","inputUnit":"m/s","outputUnit":"m/h","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":true,"outputFieldDecimals":"1","name":"Windspeed","x":790,"y":600,"wires":[["583d26ff.d270e8","fa3f6c4a.f43d58","526748f9.b230a"]]},{"id":"661bd97d.efd978","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","env":[],"x":1230,"y":120,"wires":[["2cec0989.5a6ade"]]},{"id":"c68e5000.93a4b8","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","env":[],"x":1210,"y":240,"wires":[["e08f590.57f33a8"]]},{"id":"bd8bce63.89b87","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","x":1190,"y":360,"wires":[["30720f6d.cc00b"]]},{"id":"356ebde8.088eea","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","env":[],"x":1190,"y":440,"wires":[["383c6806.493288"]]},{"id":"9e481d1f.8fc5f8","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","x":1190,"y":600,"wires":[["fa3f6c4a.f43d58"]]},{"id":"3329dad5.7f681e","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","x":1190,"y":520,"wires":[["7721052c.889044"]]},{"id":"6d91997c.9fe118","type":"ui_button","z":"6acc9db.7a04264","name":"Forcast Refresh","group":"7deea95c.2f9c2","order":1,"width":3,"height":3,"passthru":false,"label":"","tooltip":"Forcast Refresh","color":"","bgcolor":"","icon":"fa-refresh fa-4x","payload":"true","payloadType":"bool","topic":"","topicType":"str","x":1000,"y":320,"wires":[["7691f338.b2eb44"]]},{"id":"1aee92c.8adf7ed","type":"ui_text","z":"6acc9db.7a04264","group":"7deea95c.2f9c2","order":3,"width":3,"height":1,"name":"Wind","label":"","format":"{{msg.payload.wind_speed}}&nbsp;&nbsp;<i class=\"wi wi-darksky-wind\"></i>&nbsp;&nbsp;{{msg.payload.wind_cardinal}}","layout":"col-center","x":1230,"y":660,"wires":[]},{"id":"ef7d0ae5.9e0da8","type":"ui_text","z":"6acc9db.7a04264","group":"7deea95c.2f9c2","order":4,"width":3,"height":1,"name":"SunriseTime","label":"","format":"<i class=\"wi wi-owm-01d\"></i>&nbsp;<i class=\"fa fa-arrow-up\"></i>&nbsp;&nbsp;{{msg.payload}}","layout":"row-center","x":990,"y":840,"wires":[]},{"id":"773587f9.986fd","type":"ui_text","z":"6acc9db.7a04264","group":"7deea95c.2f9c2","order":5,"width":3,"height":1,"name":"SunsetTime","label":"","format":"<i class=\"wi wi-wu-sunny\"></i>&nbsp;<i class=\"fa fa-arrow-down\"></i>&nbsp;&nbsp;{{msg.payload}}","layout":"row-center","x":990,"y":880,"wires":[]},{"id":"240a4ac8.aa1536","type":"comment","z":"6acc9db.7a04264","name":"OpenWeatherMap Node and One Call API for Weather and Forecast","info":"","x":270,"y":60,"wires":[]},{"id":"a97ec6f3.67f15","type":"ui_template","z":"6acc9db.7a04264","group":"7deea95c.2f9c2","name":"Forecast2","order":2,"width":10,"height":3,"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: #0080FF;text-align: center\"><i class=\"wi wi-owm-{{data.cell07}}\"></i></span>\n  <span flex style=\"color: #0080FF;text-align: center\"><i class=\"wi wi-owm-{{data.cell08}}\"></i></span>\n  <span flex style=\"color: #0080FF;text-align: center\"><i class=\"wi wi-owm-{{data.cell09}}\"></i></span>\n  <span flex style=\"color: #0080FF;text-align: center\"><i class=\"wi wi-owm-{{data.cell10}}\"></i></span>\n  <span flex style=\"color: #0080FF;text-align: center\"><i class=\"wi wi-owm-{{data.cell11}}\"></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: #0080FF;text-align: center\">{{data.cell07}}</span>\n  <span flex style=\"color: #0080FF;text-align: center\">{{data.cell08}}</span>\n  <span flex style=\"color: #0080FF;text-align: center\">{{data.cell09}}</span>\n  <span flex style=\"color: #0080FF;text-align: center\">{{data.cell10}}</span>\n  <span flex style=\"color: #0080FF;text-align: center\">{{data.cell11}}</span>\n </div>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":false,"templateScope":"local","x":670,"y":180,"wires":[[]]},{"id":"cea58bc8.5ed748","type":"function","z":"6acc9db.7a04264","name":"Openweather Forecast","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            high = ((high * 9/5) + 32);\n             low = ((low * 9/5) + 32);\n          temp = parseFloat(high).toFixed() + '/' + parseFloat(low).toFixed()\n        }\n        else {\n            high = ((high * 9/5) + 32);\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      cell11: dayName(msg.payload.daily[5].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       cell11: formatTemp(msg.payload.daily[5].temp.max, msg.payload.daily[5].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\tcell11: msg.payload.daily[5].weather[0].icon,\n  \t}\n  }\n}\n\nreturn fcdata;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":430,"y":180,"wires":[["a97ec6f3.67f15","5c8b6cb6.b71bfc"]]},{"id":"dcf9aa1.88411d8","type":"inject","z":"6acc9db.7a04264","name":"Trigger","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"900","crontab":"","once":true,"onceDelay":0.1,"topic":"","payload":"true","payloadType":"bool","x":100,"y":120,"wires":[["495dcbe6.7e1604"]]},{"id":"7ef8a052.c5ccb8","type":"ui_ui_control","z":"6acc9db.7a04264","name":"Update tab","events":"all","x":90,"y":160,"wires":[["22738ee.d66ae72","b0c71222.0bb15"]]},{"id":"7691f338.b2eb44","type":"link out","z":"6acc9db.7a04264","name":"Refresh","links":["d2e4b517.f3e3a8"],"x":1115,"y":320,"wires":[]},{"id":"d2e4b517.f3e3a8","type":"link in","z":"6acc9db.7a04264","name":"","links":["495dcbe6.7e1604","7691f338.b2eb44","de897181.5fd0e8"],"x":15,"y":380,"wires":[["b0c71222.0bb15","7b5e73dd.d91464"]]},{"id":"22738ee.d66ae72","type":"switch","z":"6acc9db.7a04264","name":"tab focus","property":"tab","propertyType":"msg","rules":[{"t":"eq","v":"1","vt":"num"}],"checkall":"true","repair":false,"outputs":1,"x":160,"y":320,"wires":[["b0c71222.0bb15"]]},{"id":"5439cd84.a88ae4","type":"ui_template","z":"6acc9db.7a04264","group":"1e03a2b2.83a61d","name":"Time and Temp","order":1,"width":8,"height":2,"format":"<script>\n    var icon=\"T\";\n\n        \n    var colours={\n    \"blackOnOrange\": {items:[\"#222\",\"#fb7c00\"]},    \n    \"blackOnGreen\" : {items:[\"#222\",\"#66ac66\"]},\n    \"blackOnBlue\" : {items:[\"#222\",\"#8888ff\"]},\n    \"blackOnYellow\" : {items:[\"#222\",\"#bbbb44\"]},\n    \"blackOnWhite\" : {items:[\"#222\",\"#aaaaaa\"]},\n    \"blackOnPink\" : {items:[\"#222\",\"#ff8888\"]},\n    \"yellowOnRed\" : {items:[\"#ccaa22\",\"#aa2222\"]},\n    \"whiteOnCyan\" : {items:[\"#dddddd\",\"#227777\"]},\n    \"orangeOnBlack\" : {items:[\"#ff8800\",\"#000000\"]},  \n    \"limeOnBlack\" : {items:[\"#00cc55\",\"#000000\"]},  \n    }  \n    \n    var daylist = [\"sun\", \"mon\", \"tue\", \"wed\", \"thu\", \"fri\", \"sat\"];\n    (function(scope){ \n            scope.$watch('msg', function(msg) {\n               if (typeof(msg.type) != \"undefined\") icon=msg.type;\n    \n               if (icon==\"t\")\n                    {\n                        $(\"#DSEGWEATHER-BACK\").text(\" \");\n                        $(\"#DSEGWEATHER-ICON\").text(\" \");\n                        $(\"#DSEGTempcF\").text(\"C\");\n                        $(\"#DSEGTempcB\").text(\"8\");                        \n                        if (typeof(msg.payload) != \"undefined\") { $(\"#DSEGTempF\").text(msg.payload);  $(\"#DSEGTempB\").text(\"88\"); }\n                    }\n                else\n                    {\n                        $(\"#DSEGTempF\").text(\"\");\n                        $(\"#DSEGTempcF\").text(\"\");\n                        $(\"#DSEGTempB\").text(\"\");\n                        $(\"#DSEGTempcB\").text(\"\");\n                        $(\"#DSEGWEATHER-BACK\").text(\"0\");\n                        if (typeof(msg.payload) != \"undefined\") $(\"#DSEGWEATHER-ICON\").text(msg.payload);\n                        \n                    }\n               if (typeof(msg.colour) != \"undefined\") {\n                              $(\".Clock-Wrapper\").css('background-color', colours[msg.colour].items[1]);  $(\".lcdClock\").css('color', colours[msg.colour].items[0]); \n                              if (colours[msg.colour].items[1]==\"#000000\") $(\".background\").css('color',\"rgba(255,255,255,0.15)\"); else  $(\".background\").css('color',\"rgba(0,0,0,0.1)\");\n                        }\n            });\n    })(scope);\n\n    function genTimerStrings(tm, num){\n    \n    \tvar i;\n    \tvar ret = tm.toString(10);\n    \tvar left = ret.length;\n    \n    \tif( left < num){\n    \t\tfor(i=0; i<( num - left ); i++ ){\n    \t\t\tret = String(0) + ret;\n    \t\t}\n    \t}\n    \treturn ret;\n    }\n\n    function updateTimer(){\n    \tvar ret;\n    \tvar date = new Date();\n    \tvar tm_year, tm_mon, tm_date, tm_hour, tm_min, tm_sec, tm_msec,tm_day;\n    \tvar colon;\n    \ttm_year = date.getFullYear();\n    \ttm_mon = date.getMonth()+1;\n    \ttm_date = date.getDate();\n    \ttm_day = date.getDay();\n    \ttm_hour = date.getHours();\n    \ttm_min = date.getMinutes();\n    \ttm_sec = date.getSeconds();\n    \ttm_msec = date.getMilliseconds();\n    \n    \ttm_mon = genTimerStrings(tm_mon, 2);\n    \ttm_date = genTimerStrings(tm_date, 2);\n    \ttm_hour = genTimerStrings(tm_hour, 2);\n    \ttm_min = genTimerStrings(tm_min, 2);\n    \ttm_sec = genTimerStrings(tm_sec, 2);\n    \ttm_day = daylist[tm_day];\n    \n    \tif( tm_msec > 499 ){\n    \t\tcolon = ' ';\n    \t}else{\n    \t\tcolon = ':';\n    \t}\n    \n    \tdocument.getElementById(\"DSEGClock\").innerHTML = tm_hour + colon + tm_min + \"<span style=\\\"font-size:30px;\\\">\"  + tm_sec + \"</span>\";\n    \tdocument.getElementById(\"DSEGClock-Year\").innerHTML = \"<span class=\\\"D7MI\\\">\" + tm_year + \"-\" + tm_mon + \"-\" + tm_date + ' ' + \"</span><span class=\\\"D14MI\\\">\" + tm_day  +  \".\" + \"</span>\";\n    \n    \tsetTimeout(\"updateTimer()\", 500 - date.getMilliseconds()%500 );\n    }\n\n    updateTimer();\n    \n</script>\n\n<style type=\"text/css\">\n.lcdClock {\n\tbackground-color:#fbfbfb;\n\tfont-size:100%;\n\tpadding-left:10px;\n\tpadding-right:10px;\n\tpadding-bottom:10px;\n\tmax-width:400px;\n\tline-height:160%;\n\tcolor:#222;\n\tfont-family:Meiryo, 'Lucida Grande','Hiragino Kaku Gothic ProN', sans-serif;\n}\n\[email protected] {\n  font-family: \"D7MI\";\n  src: url(\"/myfonts/DSEG7Modern-Italic.woff\") format('woff');\n}\n\[email protected] {\n  font-family: \"D14MI\";\n  src: url(\"/myfonts/DSEG14Modern-Italic.woff\") format('woff');\n}\n\[email protected] {\n  font-family: \"D7MBI\";\n  src: url(\"/myfonts/DSEG7Modern-BoldItalic.woff\") format('woff');\n}\n\[email protected] {\n  font-family: \"DWEATHER\";\n  src: url(\"/myfonts/DSEGWeather.woff\") format('woff');\n}\n\n.Weather-Background{\n\tz-index:50;\n\tposition:absolute;\n\ttop:24px;\n\tleft:226px;\n\tfont-size:68px;\n}\n\n.Weather-Front{\n\tz-index:51;\n\tposition:absolute;\n\ttop:24px;\n\tleft:226px;\n\tfont-size:68px;\n}\n\n.D7MI {\nfont-family: \"D7MI\";\n}\n\n.D7MBI {\nfont-family: \"D7MBI\";\n}\n\n.D14MI {\nfont-family: \"D14MI\";\n}\n\n.DWEATHER {\nfont-family: \"DWEATHER\";\nfont-size:68px;\nheight:68px;\n}\n\n.Clock-Wrapper{\n\tposition:relative;\n\tborder:6px solid #000;\n\tborder-radius:9px;\n\theight:68px;\n\twidth:340px;\n\tbackground-color:#fb7c00;\n\tbackground-color:#66ac66;\n\tbox-shadow: 4px 4px 28px 0px rgba(0,0,0,0.3) inset; \n}\n\n.Clock-Time-Background{\n\tz-index:50;\n}\n\n.Clock-Time-Front{\n\tz-index:51;\n}\n\n.Clock-Time-Background,.Clock-Time-Front {\n   \tposition:absolute;\n\ttop:38px;\n\tleft:5px; \n\tfont-size:42px;\n}\n\n.background { color:rgba(0,0,0,0.1); }\n\n.Clock-Year-Background{\n\tz-index:50;\n\tfont-size:18px;\n}\n\n.Clock-Year-Front{\n\tz-index:51;\n}\n\n.Clock-Year-Background,.Clock-Year-Front {\n   \tposition:absolute;\n\ttop:2px;\n\tleft:5px; \n\tfont-size:18px;\n}\n\n.temp { z-index:51; }\n.tempBack { z-index:50; color:rgba(0,0,0,0.1); }\n.temp,.tempBack {\n   \tposition:absolute;\n\ttop:28px;\n\tleft:210px; \n\tfont-size:42px;\n}\n\n.tempc { z-index:51; }\n.tempcBack { z-index:50;  }\n.tempc,.tempcBack {\n   \tposition:absolute;\n\ttop:36px;\n\tleft:278px; \n\tfont-size:24px;\n}\n\n#DSEG7_OUTPUT{\n\tfont-family: \"D7MI\";\n}\n\n#DSEG14_OUTPUT{\n\tfont-family: \"D14MI\";\n}\n\n#DSEG14_OUTPUT, #DSEG7_OUTPUT{\n\tfont-size:18px;\n\tmargin-top:2px;\n\tmargin-bottom:10px;\n}\n\n</style>\n\n\n<div class=\"Clock-Wrapper center lcdClock\">\n\t<span class=\"Clock-Time-Background background  D7MBI\">88:88<span style=\"font-size:30px;\">88</span></span>\n\t<span id=\"DSEGClock\" class=\"Clock-Time-Front D7MBI\"></span>\n\t<span class=\"Clock-Year-Background background\"><span class=\"D7MI\">2088-88-88</span><span class=\"D14MI\"> ~~~</span></span>\n\t<span id=\"DSEGClock-Year\" class=\"Clock-Year-Front\"></span>\n\t\n\t<span id=\"DSEGTempF\" class=\"temp D7MBI\">00</span>\n\t<span id=\"DSEGTempB\" class=\"tempBack background D7MBI\">88</span>\t\n\t<span id=\"DSEGTempcF\" class=\"tempc D7MI\">C</span>\n\t<span id=\"DSEGTempcB\" class=\"tempcBack background D7MI\">8</span>\n\t\n\t\n\t<span id=\"DSEGWEATHER-BACK\" class=\"Weather-Background background DWEATHER\"></span>\n\t<span id=\"DSEGWEATHER-ICON\" class=\"Weather-Front DWEATHER\"></span>\n\t\t\n</div>\n\n","storeOutMessages":true,"fwdInMessages":false,"resendOnRefresh":false,"templateScope":"local","x":1020,"y":1700,"wires":[[]]},{"id":"6d378317.dd743c","type":"inject","z":"6acc9db.7a04264","name":"green","repeat":"","crontab":"","once":false,"topic":"","payload":"blackOnGreen","payloadType":"str","x":210,"y":1740,"wires":[["a23865de.5f59b8"]]},{"id":"24a314bf.90927c","type":"inject","z":"6acc9db.7a04264","name":"orange","repeat":"","crontab":"","once":false,"topic":"","payload":"blackOnOrange","payloadType":"str","x":210,"y":1780,"wires":[["a23865de.5f59b8"]]},{"id":"a23865de.5f59b8","type":"function","z":"6acc9db.7a04264","name":"","func":"msg.colour=msg.payload;\nmsg.payload=undefined;\nreturn msg;","outputs":1,"noerr":0,"x":400,"y":1740,"wires":[["5439cd84.a88ae4"]]},{"id":"c8edfc9b.be6ce","type":"inject","z":"6acc9db.7a04264","name":"blue","repeat":"","crontab":"","once":false,"topic":"","payload":"blackOnBlue","payloadType":"str","x":210,"y":1820,"wires":[["a23865de.5f59b8"]]},{"id":"18a1c3a.b9c283c","type":"inject","z":"6acc9db.7a04264","name":"yellow","repeat":"","crontab":"","once":false,"topic":"","payload":"blackOnYellow","payloadType":"str","x":210,"y":1860,"wires":[["a23865de.5f59b8"]]},{"id":"a5c4dd24.4b6ff","type":"inject","z":"6acc9db.7a04264","name":"white","repeat":"","crontab":"","once":false,"topic":"","payload":"blackOnWhite","payloadType":"str","x":210,"y":1900,"wires":[["a23865de.5f59b8"]]},{"id":"83e6ddc0.ec7bd","type":"inject","z":"6acc9db.7a04264","name":"pink","repeat":"","crontab":"","once":false,"topic":"","payload":"blackOnPink","payloadType":"str","x":210,"y":1940,"wires":[["a23865de.5f59b8"]]},{"id":"ebfd33d8.c8b13","type":"inject","z":"6acc9db.7a04264","name":"red and light text","repeat":"","crontab":"","once":false,"topic":"","payload":"yellowOnRed","payloadType":"str","x":180,"y":1980,"wires":[["a23865de.5f59b8"]]},{"id":"26972f6.8af94d","type":"inject","z":"6acc9db.7a04264","name":"cyan and white","repeat":"","crontab":"","once":false,"topic":"","payload":"whiteOnCyan","payloadType":"str","x":180,"y":2020,"wires":[["a23865de.5f59b8"]]},{"id":"10449ff5.d9588","type":"inject","z":"6acc9db.7a04264","name":"Type t for TEXT","props":[{"p":"payload","v":"t","vt":"str"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"t","payloadType":"str","x":180,"y":2100,"wires":[["fe927255.d2e2a"]]},{"id":"3e44785a.6181b8","type":"inject","z":"6acc9db.7a04264","name":"Type w for weather","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"","topic":"","payload":"w","payloadType":"str","x":170,"y":2140,"wires":[["fe927255.d2e2a"]]},{"id":"fe927255.d2e2a","type":"function","z":"6acc9db.7a04264","name":"","func":"msg.type=msg.payload;\nmsg.payload=undefined;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":2100,"wires":[["5439cd84.a88ae4"]]},{"id":"30c75186.ef732e","type":"inject","z":"6acc9db.7a04264","name":"lime on black","repeat":"","crontab":"","once":false,"topic":"","payload":"limeOnBlack","payloadType":"str","x":190,"y":2060,"wires":[["a23865de.5f59b8"]]},{"id":"af1caab9.afb5a8","type":"link out","z":"6acc9db.7a04264","name":"Temp F Out","links":["e33a2f0b.3c9b7","29ac3d74.372dea"],"x":955,"y":40,"wires":[]},{"id":"ee222e3f.260d68","type":"function","z":"6acc9db.7a04264","name":"","func":"var buf = msg.payload;\n    buf = parseFloat((buf).toFixed(0));\n    buf = (buf.toString()); \nmsg.payload = buf + \"°F\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":400,"y":1697,"wires":[["5439cd84.a88ae4"]]},{"id":"e33a2f0b.3c9b7","type":"link in","z":"6acc9db.7a04264","name":"Temp F In","links":["af1caab9.afb5a8"],"x":295,"y":1700,"wires":[["ee222e3f.260d68"]]},{"id":"699d9e82.bec68","type":"function","z":"6acc9db.7a04264","name":"Degrees To Cardinal","func":"var degreesToCardinal = function(deg){\nif (deg>11.25 && deg<=33.75){\nreturn \"NNE\";\n  }else if (deg>33.75 && deg<56.25){\nreturn \"NE\";\n  }else if (deg>56.25 && deg<78.75){\nreturn \"ENE\";\n  }else if (deg>78.75 && deg<101.25){\nreturn \"E\";\n  }else if (deg>101.25 && deg<123.75){\nreturn \"ESE\";\n  }else if (deg>123.75 && deg<146.25){\nreturn \"SE\";\n  }else if (deg>146.25 && deg<168.75){\nreturn \"SSE\";\n  }else if (deg>168.75 && deg<191.25){\nreturn \"S\";\n  }else if (deg>191.25 && deg<213.75){\nreturn \"SSW\";\n  }else if (deg>213.75 && deg<236.25){\nreturn \"SW\";\n  }else if (deg>236.25 && deg<258.75){\nreturn \"WSW\";\n  }else if (deg>258.75 && deg<281.25){\nreturn \"W\";\n  }else if (deg>281.25 && deg<303.75){\nreturn \"WNW\";\n  }else if (deg>303.75 && deg<326.25){\nreturn \"NW\";\n  }else if (deg>326.25 && deg<348.75){\nreturn \"NNW\";\n  }else{\nreturn \"N\"; \n  }\n}\nmsg = { payload:degreesToCardinal(msg.payload)};\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1020,"y":800,"wires":[["71d2efb5.97b5e"]]},{"id":"71d2efb5.97b5e","type":"change","z":"6acc9db.7a04264","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.wind_cardinal","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":760,"wires":[["6ba11ae5.ee5294"]]},{"id":"526748f9.b230a","type":"change","z":"6acc9db.7a04264","name":"","rules":[{"t":"move","p":"payload","pt":"msg","to":"payload.wind_speed","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1010,"y":680,"wires":[["6ba11ae5.ee5294"]]},{"id":"6ba11ae5.ee5294","type":"join","z":"6acc9db.7a04264","name":"","mode":"custom","build":"merged","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":1210,"y":720,"wires":[["1aee92c.8adf7ed"]]},{"id":"b0c71222.0bb15","type":"openweathermap","z":"6acc9db.7a04264","name":"San Andreas","wtype":"onecall","lon":"-120.6804872","lat":"38.1960298","city":"","country":"","language":"en","x":150,"y":380,"wires":[["777b03c9.e1a804","58bdc1c1.c8c78","cea58bc8.5ed748","5323816.5cadb","5c8b6cb6.b71bfc"]]},{"id":"495dcbe6.7e1604","type":"link out","z":"6acc9db.7a04264","name":"Trigger","links":["ed1fa498.3d65a","d2e4b517.f3e3a8"],"x":195,"y":120,"wires":[]},{"id":"649c76ed.1d9a88","type":"switch","z":"6acc9db.7a04264","name":"Topic F","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"MaxF","vt":"str"},{"t":"eq","v":"CurrentF","vt":"str"},{"t":"eq","v":"MinF","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":680,"y":120,"wires":[["2cec0989.5a6ade","9557f682.c2d048"],["2cec0989.5a6ade","af1caab9.afb5a8","9d3a2b43.a1bbc8"],["2cec0989.5a6ade","caca4a17.cfd48"]]},{"id":"7fa57eb5.3ce29","type":"ui_text","z":"6acc9db.7a04264","group":"c4a5fdd8.b6c848","order":2,"width":11,"height":2,"name":"","label":"Alerts","format":"{{msg.payload}}","layout":"col-center","x":970,"y":280,"wires":[]},{"id":"4c6aad39.8b9994","type":"ui_chart","z":"6acc9db.7a04264","name":"Visibility","group":"72158dc7.afeae4","order":1,"width":30,"height":6,"label":"Visibility","chartType":"line","legend":"true","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":980,"y":920,"wires":[["60330c91.579844"]]},{"id":"60330c91.579844","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","x":1190,"y":920,"wires":[["4c6aad39.8b9994"]]},{"id":"3eee7a.a8cca986","type":"ui_gauge","z":"6acc9db.7a04264","name":"Visibility","group":"1bebc031.176c08","order":10,"width":"4","height":"4","gtype":"gage","title":"Visibility","label":"","format":"{{value | number:0}} m","min":0,"max":"10000","colors":["#ff0000","#e6e600","#008040"],"seg1":"5000","seg2":"","x":980,"y":960,"wires":[]},{"id":"1dca0449.1c0874","type":"ui_gauge","z":"6acc9db.7a04264","name":"Feels Like","group":"1bebc031.176c08","order":4,"width":"4","height":"4","gtype":"gage","title":"Feels Like","label":"","format":"{{value | number:2}} ºF","min":"-15","max":"120","colors":["#0080ff","#008040","#ca3838"],"seg1":"60","seg2":"80","x":990,"y":1000,"wires":[]},{"id":"1e5e118d.0c3ee6","type":"unit-converter","z":"6acc9db.7a04264","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":false,"outputFieldDecimals":"","name":"","x":720,"y":1000,"wires":[["1dca0449.1c0874"]]},{"id":"d440839c.ff7e8","type":"ui_gauge","z":"6acc9db.7a04264","name":"UV Index","group":"1bebc031.176c08","order":12,"width":"4","height":"4","gtype":"gage","title":"UV Index","label":"","format":"{{value | number:0}}","min":"0","max":"11","colors":["#008040","#ffff80","#ca3838"],"seg1":"3","seg2":"8","x":980,"y":1160,"wires":[]},{"id":"55c1b501.f08184","type":"ui_gauge","z":"6acc9db.7a04264","name":"Dew Point","group":"1bebc031.176c08","order":11,"width":"4","height":"4","gtype":"gage","title":"Dew Point","label":"","format":"{{value | number:2}} ºF","min":"0","max":"90","colors":["#008040","#00ff00","#ca3838"],"seg1":"50","seg2":"64","x":980,"y":1080,"wires":[]},{"id":"51dfdbe.bf11e24","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","x":1190,"y":1120,"wires":[["3fcf556d.8a3ac2"]]},{"id":"719b138e.9c1204","type":"subflow:35ad4fe4.069a3","z":"6acc9db.7a04264","name":"","x":1190,"y":1040,"wires":[["d658bb67.7344b"]]},{"id":"3fcf556d.8a3ac2","type":"ui_chart","z":"6acc9db.7a04264","name":"UV Index","group":"207f15df.d6c57a","order":1,"width":30,"height":6,"label":"UV Index","chartType":"line","legend":"true","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":980,"y":1120,"wires":[["51dfdbe.bf11e24"]]},{"id":"d658bb67.7344b","type":"ui_chart","z":"6acc9db.7a04264","name":"Dew Point","group":"8744e60c.b345c","order":1,"width":30,"height":6,"label":"Dew Point","chartType":"line","legend":"true","xformat":"dd HH:mm","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"52","removeOlderPoints":"","removeOlderUnit":"604800","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"x":980,"y":1040,"wires":[["719b138e.9c1204"]]},{"id":"9265232f.4b8e3","type":"change","z":"6acc9db.7a04264","name":"Topic C","rules":[{"t":"change","p":"topic","pt":"msg","from":"Max","fromt":"str","to":"MaxC","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"Current","fromt":"str","to":"CurrentC","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"Min","fromt":"str","to":"MinC","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":720,"y":260,"wires":[["e08f590.57f33a8"]]},{"id":"d527af0.1df57d","type":"change","z":"6acc9db.7a04264","name":"Topic F","rules":[{"t":"change","p":"topic","pt":"msg","from":"Max","fromt":"str","to":"MaxF","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"Current","fromt":"str","to":"CurrentF","tot":"str"},{"t":"change","p":"topic","pt":"msg","from":"Min","fromt":"str","to":"MinF","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":340,"y":120,"wires":[["57dff58e.8ec274"]]},{"id":"9ddca9c9.ecf28","type":"ui_worldmap","z":"6acc9db.7a04264","group":"2430ac10.d126ec","order":0,"width":"35","height":"15","name":"","lat":"","lon":"","zoom":"","layer":"Esri Satellite","cluster":"","maxage":"","usermenu":"hide","layers":"hide","panit":"false","panlock":"false","zoomlock":"false","hiderightclick":"true","coords":"none","showgrid":"false","allowFileDrop":"false","path":"/worldmap","x":540,"y":980,"wires":[]},{"id":"2f771755.c3e0d8","type":"change","z":"6acc9db.7a04264","name":"","rules":[{"t":"set","p":"payload.name","pt":"msg","to":"San Andreas","tot":"str"},{"t":"set","p":"payload.label","pt":"msg","to":"San Andreas","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":820,"wires":[["9ddca9c9.ecf28"]]},{"id":"91c2df3a.0f028","type":"change","z":"6acc9db.7a04264","name":"","rules":[{"t":"set","p":"payload.name","pt":"msg","to":"Home","tot":"str"},{"t":"set","p":"payload.label","pt":"msg","to":"Home","tot":"str"},{"t":"set","p":"payload.lat","pt":"msg","to":"38.18872","tot":"str"},{"t":"set","p":"payload.lon","pt":"msg","to":"-120.65611","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":480,"y":860,"wires":[["9ddca9c9.ecf28"]]},{"id":"38e0377d.bcb26","type":"unit-converter","z":"6acc9db.7a04264","category":"temperature","inputUnit":"C","outputUnit":"F","inputField":"payload","outputField":"payload","inputFieldType":"msg","outputFieldType":"msg","roundOutputField":false,"outputFieldDecimals":"","name":"","x":720,"y":1060,"wires":[["d658bb67.7344b","55c1b501.f08184"]]},{"id":"5323816.5cadb","type":"Message Counter","z":"6acc9db.7a04264","name":"Openweather Calls","units":"hours","interval":"24","alignToClock":true,"generator":"internal","x":410,"y":300,"wires":[[],[]]},{"id":"3be41351.d4e92c","type":"ui_text","z":"6acc9db.7a04264","group":"1e03a2b2.83a61d","order":2,"width":8,"height":1,"name":"Openweather Calls","label":"Openweather Calls","format":"{{msg.payload}}","layout":"row-left","x":470,"y":1120,"wires":[]},{"id":"d74fc1d8.4a3878","type":"status","z":"6acc9db.7a04264","name":"","scope":["5323816.5cadb"],"x":80,"y":1120,"wires":[["c31d710a.7c328"]]},{"id":"c31d710a.7c328","type":"change","z":"6acc9db.7a04264","name":"","rules":[{"t":"move","p":"status.text","pt":"msg","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":260,"y":1120,"wires":[["3be41351.d4e92c"]]},{"id":"a21d8c9c.ffb06","type":"debug","z":"6acc9db.7a04264","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":750,"y":1520,"wires":[]},{"id":"922bb194.99f0f8","type":"http request","z":"6acc9db.7a04264","name":"Get OWM Air Polution data","method":"GET","ret":"obj","paytoqs":"query","url":"http://api.openweathermap.org/data/2.5/air_pollution","tls":"","persist":false,"proxy":"","authType":"","x":160,"y":620,"wires":[["33c47662.a0095a","5323816.5cadb"]]},{"id":"7b5e73dd.d91464","type":"change","z":"6acc9db.7a04264","name":"Set location, appid, units","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.lat","pt":"msg","to":"38.1960298","tot":"str"},{"t":"set","p":"payload.lon","pt":"msg","to":"-120.6804872","tot":"str"},{"t":"set","p":"payload.appid","pt":"msg","to":"1dff9676b957598abae7b3de084d1f3c","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":150,"y":560,"wires":[["922bb194.99f0f8"]]},{"id":"33c47662.a0095a","type":"function","z":"6acc9db.7a04264","name":"Openweather Air Pollution","func":"var msg1 = { payload:msg.payload.list[0].components.co};\n    msg1.topic = \"Carbon monoxide\";\nvar msg2 = { payload:msg.payload.list[0].components.no};\n    msg2.topic = \"Nitrogen monoxide\";\nvar msg3 = { payload:msg.payload.list[0].components.no2};\n    msg3.topic = \"Nitrogen dioxide\";\nvar msg4 = { payload:msg.payload.list[0].components.o3};\n    msg4.topic = \"Ozone\";\nvar msg5 = { payload:msg.payload.list[0].components.so2};\n    msg5.topic = \"Sulphur dioxide\";\nvar msg6 = { payload:msg.payload.list[0].components.pm2_5};\n    msg6.topic = \"Fine particles matter\";\nvar msg7 = { payload:msg.payload.list[0].components.pm10};\n    msg7.topic = \"Coarse particulate matter\";\nvar msg8 = { payload:msg.payload.list[0].components.nh3};\n    msg8.topic = \"Ammonia\";\nvar msg9 = { payload:msg.payload.list[0].main.aqi};\n    msg9.topic = \"Air Quality\";\nreturn [ msg1, msg2, msg3, msg4, msg5, msg6, msg7, msg8, msg9 ];","outputs":9,"noerr":0,"initialize":"","finalize":"","x":680,"y":1340,"wires":[["8f944237.e0b938"],["fe708d59.31f04"],["5112b334.455c1c"],["fd7b5729.e00618"],["9992a47e.07f1d"],["ebad501d.f2d61"],["fe5975b0.7c1b8"],["65ae118.a3950f"],["ea3c2853.095628"]],"inputLabels":["Openweather Air Pollution API"],"outputLabels":["Carbon monoxide","Nitrogen monoxide","Nitrogen dioxide","Ozone","Sulphur dioxide","Fine particles matter","Coarse particulate matter","Ammonia","Air Quality"]},{"id":"8f944237.e0b938","type":"ui_gauge","z":"6acc9db.7a04264","name":"Carbon monoxide","group":"ced58475.336d38","order":2,"width":"3","height":"3","gtype":"gage","title":"Carbon monoxide","label":"","format":"{{value | number:0}}","min":"0","max":"11","colors":["#008040","#ffff80","#ca3838"],"seg1":"3","seg2":"8","x":1010,"y":1200,"wires":[]},{"id":"fe708d59.31f04","type":"ui_gauge","z":"6acc9db.7a04264","name":"Nitrogen monoxide","group":"ced58475.336d38","order":3,"width":"3","height":"3","gtype":"gage","title":"Nitrogen monoxide","label":"","format":"{{value | number:0}}","min":"0","max":"11","colors":["#008040","#ffff80","#ca3838"],"seg1":"3","seg2":"8","x":1010,"y":1240,"wires":[]},{"id":"5112b334.455c1c","type":"ui_gauge","z":"6acc9db.7a04264","name":"Nitrogen dioxide","group":"ced58475.336d38","order":4,"width":"3","height":"3","gtype":"gage","title":"Nitrogen dioxide","label":"","format":"{{value | number:0}}","min":"0","max":"11","colors":["#008040","#ffff80","#ca3838"],"seg1":"3","seg2":"8","x":1000,"y":1280,"wires":[]},{"id":"fd7b5729.e00618","type":"ui_gauge","z":"6acc9db.7a04264","name":"Ozone","group":"ced58475.336d38","order":5,"width":"3","height":"3","gtype":"gage","title":"Ozone","label":"","format":"{{value | number:0}}","min":"0","max":"100","colors":["#008040","#ffff80","#ca3838"],"seg1":"18","seg2":"","x":970,"y":1320,"wires":[]},{"id":"9992a47e.07f1d","type":"ui_gauge","z":"6acc9db.7a04264","name":"Sulphur dioxide","group":"ced58475.336d38","order":6,"width":"3","height":"3","gtype":"gage","title":"Sulphur dioxide","label":"","format":"{{value | number:0}}","min":"0","max":"11","colors":["#008040","#ffff80","#ca3838"],"seg1":"3","seg2":"8","x":1000,"y":1360,"wires":[]},{"id":"ebad501d.f2d61","type":"ui_gauge","z":"6acc9db.7a04264","name":"Fine particles matter","group":"ced58475.336d38","order":7,"width":"3","height":"3","gtype":"gage","title":"Fine Particulates","label":"","format":"{{value | number:0}}","min":"0","max":"50","colors":["#008040","#ffff80","#ca3838"],"seg1":"15","seg2":"35","x":1020,"y":1400,"wires":[]},{"id":"fe5975b0.7c1b8","type":"ui_gauge","z":"6acc9db.7a04264","name":"Coarse particulate matter","group":"ced58475.336d38","order":8,"width":"3","height":"3","gtype":"gage","title":"Coarse Particulates","label":"","format":"{{value | number:0}}","min":"0","max":"200","colors":["#008040","#ffff80","#ca3838"],"seg1":"50","seg2":"150","x":1030,"y":1440,"wires":[]},{"id":"65ae118.a3950f","type":"ui_gauge","z":"6acc9db.7a04264","name":"Ammonia","group":"ced58475.336d38","order":9,"width":"3","height":"3","gtype":"gage","title":"Ammonia","label":"","format":"{{value | number:0}}","min":"0","max":"11","colors":["#008040","#ffff80","#ca3838"],"seg1":"3","seg2":"8","x":980,"y":1480,"wires":[]},{"id":"ea3c2853.095628","type":"ui_gauge","z":"6acc9db.7a04264","name":"Air Quality","group":"ced58475.336d38","order":1,"width":"3","height":"3","gtype":"gage","title":"Air Quality","label":"","format":"{{value | number:0}}","min":"0","max":"500","colors":["#008040","#ffff80","#ca3838"],"seg1":"101","seg2":"150","x":990,"y":1520,"wires":[]},{"id":"c6faed7c.efb91","type":"http request","z":"6acc9db.7a04264","name":"Get OWM Location","method":"GET","ret":"obj","paytoqs":"query","url":"http://api.openweathermap.org/geo/1.0/reverse","tls":"","persist":false,"proxy":"","authType":"","x":310,"y":1520,"wires":[["5323816.5cadb","a21d8c9c.ffb06","5f0dec6e.7daeac"]]},{"id":"91c0d386.9a8938","type":"change","z":"6acc9db.7a04264","name":"Set location, appid, units","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"payload.lat","pt":"msg","to":"38.1960298","tot":"str"},{"t":"set","p":"payload.lon","pt":"msg","to":"-120.6804872","tot":"str"},{"t":"set","p":"payload.appid","pt":"msg","to":"1dff9676b957598abae7b3de084d1f3c","tot":"str"},{"t":"set","p":"units","pt":"flow","to":"payload.units","tot":"msg"},{"t":"set","p":"payload.limit","pt":"msg","to":"10","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":170,"y":1460,"wires":[["c6faed7c.efb91"]]},{"id":"f5d19fb2.a40238","type":"inject","z":"6acc9db.7a04264","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":true,"onceDelay":"10","topic":"","payload":"","payloadType":"date","x":130,"y":1400,"wires":[["91c0d386.9a8938"]]},{"id":"5f0dec6e.7daeac","type":"ui_text","z":"6acc9db.7a04264","group":"c4a5fdd8.b6c848","order":1,"width":11,"height":1,"name":"Current Weather","label":"Current weather in ","format":"{{msg.payload[0].name}}","layout":"row-left","x":1010,"y":1560,"wires":[]},{"id":"5c8b6cb6.b71bfc","type":"debug","z":"6acc9db.7a04264","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":760,"y":220,"wires":[]},{"id":"1bebc031.176c08","type":"ui_group","name":"Gauges","tab":"785f8342.03c5b4","order":4,"disp":true,"width":"35","collapse":false},{"id":"b1429252.2a088","type":"ui_group","name":"Temperature","tab":"447cae93.693258","order":1,"disp":true,"width":30,"collapse":true},{"id":"a46941f4.c5aae","type":"ui_group","name":"Pressure","tab":"447cae93.693258","order":2,"disp":true,"width":30,"collapse":true},{"id":"b595fe17.5c088","type":"ui_group","name":"Humidity","tab":"447cae93.693258","order":3,"disp":true,"width":30,"collapse":true},{"id":"d9f5d97.e65a328","type":"ui_group","name":"Cloud Cover","tab":"447cae93.693258","order":4,"disp":true,"width":30,"collapse":true},{"id":"e6495e20.3bb068","type":"ui_group","name":"Windspeed","tab":"447cae93.693258","order":5,"disp":true,"width":"30","collapse":true},{"id":"7deea95c.2f9c2","type":"ui_group","name":"Description","tab":"785f8342.03c5b4","order":1,"disp":false,"width":16,"collapse":false},{"id":"1e03a2b2.83a61d","type":"ui_group","name":"Clock","tab":"785f8342.03c5b4","order":3,"disp":false,"width":8,"collapse":false},{"id":"c4a5fdd8.b6c848","type":"ui_group","name":"Alerts","tab":"785f8342.03c5b4","order":2,"disp":false,"width":"11","collapse":false},{"id":"72158dc7.afeae4","type":"ui_group","name":"Visibility","tab":"447cae93.693258","order":6,"disp":true,"width":"30","collapse":true},{"id":"207f15df.d6c57a","type":"ui_group","name":"UV Index","tab":"447cae93.693258","order":8,"disp":true,"width":"30","collapse":true},{"id":"8744e60c.b345c","type":"ui_group","name":"Dew Point","tab":"447cae93.693258","order":7,"disp":true,"width":"30","collapse":true},{"id":"2430ac10.d126ec","type":"ui_group","name":"Weather Map","tab":"67746a03.6e7084","order":1,"disp":true,"width":"35","collapse":true},{"id":"ced58475.336d38","type":"ui_group","name":"Air Polution","tab":"785f8342.03c5b4","order":5,"disp":true,"width":"35","collapse":true},{"id":"785f8342.03c5b4","type":"ui_tab","name":"Weather Dashboard","icon":"fa-thermometer-empty","order":1,"disabled":false,"hidden":false},{"id":"447cae93.693258","type":"ui_tab","name":"Weather Graphs","icon":"fa-thermometer-half","order":2,"disabled":false,"hidden":false},{"id":"67746a03.6e7084","type":"ui_tab","name":"Weather Map","icon":"fa-thermometer-full","order":3,"disabled":false,"hidden":false}]

Flow Info

Created 1 year, 6 months ago
Updated 1 year, 5 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x9)
  • comment (x1)
  • debug (x3)
  • file (x1)
  • file in (x1)
  • function (x9)
  • http request (x2)
  • inject (x13)
  • join (x1)
  • json (x2)
  • link in (x2)
  • link out (x3)
  • status (x1)
  • switch (x3)
Other
  • Message Counter (x1)
  • openweathermap (x1)
  • subflow (x1)
  • subflow:35ad4fe4.069a3 (x9)
  • tab (x1)
  • ui_button (x1)
  • ui_chart (x9)
  • ui_gauge (x21)
  • ui_group (x14)
  • ui_tab (x3)
  • ui_template (x2)
  • ui_text (x6)
  • ui_ui_control (x1)
  • ui_worldmap (x1)
  • unit-converter (x4)

Tags

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