Local weather group for Dashboard

Sadly it only has a forecast, not current conditions (I'm assuming the node uses the XML data) and the forecast is quite limited in data. No humidity for example which is important to me.

Hi Paul,
Always smart to live near an AirPort if you want good environment data. I am also that lucky person living close to an AirPort. :wink:

1 Like

Hi Paul, I'm very new to Node-red and I've been trying to modify your excellent weather group for use with darksky only. Is there any way you would share your newer weather flow without the WU. I do have a METAR dashboard working now but I really like your weather group. I've spent two days trying to modify the weather group for Darksky only, just trying to learn that's all.

Thanks
Craig

I've also just switched to Darksky, but not got around to fully complete it. However, this is what I've got so far.
The only changes I think you'll need to make is to set up the Darksky node with your own credentials & location.

[{"id":"16739c3e.cad3d4","type":"function","z":"a444a9ff.e7a408","name":"Rain intensity","func":"const i = msg.payload.precipIntensity*25.4;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":750,"y":170,"wires":[["3f48dcc5.211744"]]},{"id":"868f4534.3b4098","type":"function","z":"a444a9ff.e7a408","name":"Rain chance","func":"const i = msg.payload.precipProbability*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":740,"y":130,"wires":[["d99bdb85.c74af8"]]},{"id":"4b5672c4.924c9c","type":"function","z":"a444a9ff.e7a408","name":"Summary","func":"const i = (msg.data.minutely.summary);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":90,"wires":[["d18fadda.36ac7"]]},{"id":"35b2a800.b01218","type":"function","z":"a444a9ff.e7a408","name":"Ozone","func":"const i = msg.payload.ozone;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":210,"wires":[["624a642a.8f42dc"]]},{"id":"66adc6b5.bffaa8","type":"function","z":"a444a9ff.e7a408","name":"Cloud","func":"const i = msg.payload.cloudCover*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":250,"wires":[["37ad0f29.672f4"]]},{"id":"3ed4777c.0d2dc8","type":"inject","z":"a444a9ff.e7a408","name":"every 10 mins","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"*/10 0-23 * * *","once":true,"onceDelay":"","x":130,"y":1470,"wires":[["e3dc75c7.1fe5a8"]]},{"id":"3d353aea.fda316","type":"function","z":"a444a9ff.e7a408","name":"high temp","func":"const i = msg.temperatureHigh;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":880,"wires":[["bbcf51d4.571d2"]]},{"id":"fefc2d58.acbba","type":"function","z":"a444a9ff.e7a408","name":"low temp","func":"const i = msg.temperatureLow;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":920,"wires":[["cc017128.08002"]]},{"id":"65974f5.65af7b","type":"function","z":"a444a9ff.e7a408","name":"icon","func":"let i = msg.icon;\n\n// Fix for Darksky displaying partly-cloudy-night\n// error, hopefully fixed soon...\nif (i == \"partly-cloudy-night\") {\n    i = \"clear-day\";\n    }\n    \nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":840,"wires":[["e6caa906.ce5fc8"]]},{"id":"9dff34b9.9e3958","type":"function","z":"a444a9ff.e7a408","name":"date","func":"const i = (msg.time)*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":800,"wires":[["afc47cc3.dab22"]]},{"id":"e304dbfd.279578","type":"function","z":"a444a9ff.e7a408","name":"rain probability","func":"if (msg.hasOwnProperty(\"precipProbability\")) {\nconst i = msg.precipProbability*100;\nnode.send({payload:i});\n} else {\nnode.send({payload:0});\n}","outputs":1,"noerr":0,"x":750,"y":1200,"wires":[["aa8a2cde.84648"]]},{"id":"12593f3e.b6ec71","type":"function","z":"a444a9ff.e7a408","name":"rain Intensity","func":"if (msg.hasOwnProperty(\"precipIntensity\")) {\nconst i = msg.precipIntensity * 100;\nnode.send({payload:i});\n} else {\nnode.send({payload:0});\n}","outputs":1,"noerr":0,"x":740,"y":1240,"wires":[["2031fcea.49e464"]]},{"id":"772353fd.3b940c","type":"function","z":"a444a9ff.e7a408","name":"humidity","func":"const i = msg.humidity*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":960,"wires":[["d16948aa.b123c8"]]},{"id":"159eb656.324ada","type":"function","z":"a444a9ff.e7a408","name":"wind deg","func":"let i = msg.windBearing;\nif (i <= 180) {\n    i = (i + 180);\n}\nelse\ni = (i - 180);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":1040,"wires":[["b1f32bd5.527f28"]]},{"id":"b7278812.1dcab8","type":"function","z":"a444a9ff.e7a408","name":"wspeed","func":"const i = msg.windSpeed;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":1080,"wires":[["67eadd71.91a894"]]},{"id":"d4bd72a.dc5869","type":"link in","z":"a444a9ff.e7a408","name":"Wunderground forecast parser","links":["6bf9da4c.da8f34"],"x":95,"y":1010,"wires":[["e59277f0.f35818"]]},{"id":"6bf9da4c.da8f34","type":"link out","z":"a444a9ff.e7a408","name":"Forecast trigger","links":["d4bd72a.dc5869","49f07176.66759","bb49de0b.d1bc4","41024beb.41db14"],"x":665,"y":1450,"wires":[]},{"id":"9b1a0ef3.77528","type":"function","z":"a444a9ff.e7a408","name":"Dewpoint","func":"const i = msg.payload.dewPoint;\nnode.send({payload:i});\n","outputs":1,"noerr":0,"x":730,"y":520,"wires":[["e695380c.df7ab8"]]},{"id":"7f9ae0e5.9ce56","type":"function","z":"a444a9ff.e7a408","name":"Wind deg","func":"let i = msg.payload.windBearing;\n    if (i <= 180) {\n    i = (i + 180);\n    }\n    else\n    i = (i - 180);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":570,"wires":[["5d414aae.1c44f4"]]},{"id":"32bb3936.7aacd6","type":"function","z":"a444a9ff.e7a408","name":"Humidity","func":"const i = msg.payload.humidity*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":610,"wires":[["7ecf24ed.e5f57c"]]},{"id":"4934b52c.b442dc","type":"function","z":"a444a9ff.e7a408","name":"Pressure","func":"const i = msg.payload.pressure;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":650,"wires":[["7730383a.9fe0e8"]]},{"id":"952825ce.eef7a8","type":"function","z":"a444a9ff.e7a408","name":"Icon","func":"const i = msg.payload.icon;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":690,"wires":[["c78f398f.03efe8"]]},{"id":"957fa78d.240da8","type":"function","z":"a444a9ff.e7a408","name":"Reload","func":"//Load flow context to variable\nvar select = flow.get('dropdown')||1;\n\n//If dropdown option is changed\nif (msg.topic=='dropdown') {\n    flow.set('dropdown',msg.payload);\n    node.send ({topic:msg.payload});\n    }\n    \n//If http connection is made, or triggered by inject\nelse if (msg.payload=='connect') {\n    node.send ({topic:select});\n    }\n\n//Or do nothing\nelse {node.send (null);}\n","outputs":"1","noerr":0,"x":390,"y":1420,"wires":[["1ec993a1.f4342c"]]},{"id":"87cec386.9daaa","type":"inject","z":"a444a9ff.e7a408","name":"New day","topic":"","payload":"connect","payloadType":"str","repeat":"","crontab":"01 00 * * *","once":false,"x":150,"y":1380,"wires":[["957fa78d.240da8"]]},{"id":"f0546cf7.c293e","type":"function","z":"a444a9ff.e7a408","name":"Wind","func":"const w = msg.payload.windSpeed;\nlet g = msg.payload.windGust;\n\n// make sure gusts are never lower\n// than windspeed\nif (g < w) {g = w;}\n\nlet newMess1 = {topic:\"wind\",payload:w,};\nlet newMess2 = {topic:\"gust\",payload:g,};\n\nreturn [ newMess1, newMess2 ];\n","outputs":2,"noerr":0,"x":720,"y":470,"wires":[["b74e17f4.f6fe18","977d821d.9c2e2"],["b74e17f4.f6fe18","2036273f.0b5818"]]},{"id":"2ad10c01.af7f44","type":"comment","z":"a444a9ff.e7a408","name":"Current Conditions","info":"","x":140,"y":280,"wires":[]},{"id":"6b0d518d.cdfff","type":"comment","z":"a444a9ff.e7a408","name":"Darksky forecast","info":"","x":130,"y":950,"wires":[]},{"id":"bf190d4c.eb478","type":"inject","z":"a444a9ff.e7a408","name":"restore","topic":"","payload":"weatherTemp","payloadType":"flow","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":730,"y":290,"wires":[["aac4d164.28ba9"]]},{"id":"154a2925.96b187","type":"change","z":"a444a9ff.e7a408","name":"save context","rules":[{"t":"set","p":"weatherTemp","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":290,"wires":[[]]},{"id":"824e3b9d.f071a8","type":"inject","z":"a444a9ff.e7a408","name":"restore","topic":"","payload":"weatherWind","payloadType":"flow","repeat":"","crontab":"","once":true,"onceDelay":0.1,"x":730,"y":410,"wires":[["b74e17f4.f6fe18"]]},{"id":"247de8aa.2b1bf8","type":"change","z":"a444a9ff.e7a408","name":"save context","rules":[{"t":"set","p":"weatherWind","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1090,"y":410,"wires":[[]]},{"id":"35a0e994.665c66","type":"ui_ui_control","z":"a444a9ff.e7a408","name":"","x":90,"y":1340,"wires":[["957fa78d.240da8"]]},{"id":"e3dc75c7.1fe5a8","type":"ui_button","z":"a444a9ff.e7a408","name":"Dash Refresh","group":"304cf995.dc6556","order":18,"width":"1","height":"1","passthru":true,"label":"","color":"","bgcolor":"","icon":"fa-refresh fa-2x","payload":"","payloadType":"str","topic":"","x":370,"y":1470,"wires":[["1ec993a1.f4342c"]]},{"id":"28f7ee85.c6a102","type":"ui_dropdown","z":"a444a9ff.e7a408","name":"Select","label":"","place":"","group":"a9c0b162.e0664","order":8,"width":"3","height":"1","passthru":true,"options":[{"label":"today","value":"0","type":"str"},{"label":"today + 1","value":"1","type":"str"},{"label":"today + 2","value":"2","type":"str"},{"label":"today + 3","value":"3","type":"str"},{"label":"today + 4","value":"4","type":"str"},{"label":"today + 5","value":"5","type":"str"},{"label":"today + 6","value":"6","type":"str"},{"label":"today + 7","value":"7","type":"str"}],"payload":"","topic":"dropdown","x":210,"y":1420,"wires":[["957fa78d.240da8"]]},{"id":"e6caa906.ce5fc8","type":"ui_template","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","name":"icon Image","order":1,"width":"2","height":"2","format":"<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-darksky-{{msg.payload}}\"></i>\n</div>","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":920,"y":840,"wires":[[]]},{"id":"c78f398f.03efe8","type":"ui_template","z":"a444a9ff.e7a408","group":"304cf995.dc6556","name":"icon image","order":1,"width":"2","height":"2","format":"<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-darksky-{{msg.payload}}\"></i>\n</div>","storeOutMessages":false,"fwdInMessages":true,"templateScope":"local","x":920,"y":690,"wires":[[]]},{"id":"6da56493.0c874c","type":"ui_template","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","name":"weather summary","order":16,"width":"6","height":"9","format":"<div><font size=\"+1.5\">Weather Forecast Summary</font></div><br>\n<div ng-bind-html=\"msg.payload\"></div>\n","storeOutMessages":false,"fwdInMessages":false,"templateScope":"local","x":940,"y":1160,"wires":[[]]},{"id":"5d414aae.1c44f4","type":"ui_gauge","z":"a444a9ff.e7a408","name":"wind direction","group":"304cf995.dc6556","order":10,"width":"3","height":"3","gtype":"compass","title":"wind direction","label":"degrees","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":930,"y":570,"wires":[]},{"id":"b1f32bd5.527f28","type":"ui_gauge","z":"a444a9ff.e7a408","name":"Wind compass","group":"a9c0b162.e0664","order":7,"width":"3","height":"3","gtype":"compass","title":"wind direction","label":"degrees","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"x":930,"y":1040,"wires":[]},{"id":"aac4d164.28ba9","type":"ui_chart","z":"a444a9ff.e7a408","name":"temp chart","group":"304cf995.dc6556","order":2,"width":0,"height":0,"label":"Temperature","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#00ff80","#0080c0","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":920,"y":290,"wires":[["154a2925.96b187"],[]]},{"id":"b74e17f4.f6fe18","type":"ui_chart","z":"a444a9ff.e7a408","name":"wind chart","group":"304cf995.dc6556","order":14,"width":0,"height":0,"label":"Wind","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#00ff80","#0080c0","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":920,"y":410,"wires":[["247de8aa.2b1bf8"],[]]},{"id":"bbcf51d4.571d2","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":4,"width":"2","height":"1","name":"","label":"temp ā–²","format":"{{msg.payload}}Ā°C","layout":"col-center","x":910,"y":880,"wires":[]},{"id":"cc017128.08002","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":5,"width":"2","height":"1","name":"","label":"temp ā–¼","format":"{{msg.payload}}Ā°C","layout":"col-center","x":910,"y":920,"wires":[]},{"id":"db5b3dc1.a0973","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":17,"width":"2","height":"1","name":"","label":"time now","format":"{{msg.payload | date:\"HH':'mm\"}}","layout":"col-center","x":420,"y":1530,"wires":[]},{"id":"aa8a2cde.84648","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":2,"width":"2","height":"1","name":"Rain prob","label":"rain prob","format":"{{msg.payload | number:0}}%","layout":"col-center","x":910,"y":1200,"wires":[]},{"id":"67eadd71.91a894","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":9,"width":"3","height":"1","name":"","label":"w/speed","format":"{{msg.payload | number:1}}mph","layout":"col-center","x":910,"y":1080,"wires":[]},{"id":"afc47cc3.dab22","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":6,"width":"6","height":"1","name":"Date","label":"forecast for","format":"{{msg.payload | date:\"EEEE, MMMM d\"}}","layout":"col-center","x":900,"y":800,"wires":[]},{"id":"d18fadda.36ac7","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":9,"width":"6","height":"1","name":"for the hour","label":" ","format":"{{msg.payload}}","layout":"row-left","x":920,"y":90,"wires":[]},{"id":"2036273f.0b5818","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":12,"width":"3","height":"1","name":"","label":"gusts","format":"{{msg.payload}}mph","layout":"row-spread","x":900,"y":490,"wires":[]},{"id":"7730383a.9fe0e8","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":6,"width":"2","height":"1","name":"","label":"pressure","format":"{{msg.payload | number:0}}mb","layout":"col-center","x":910,"y":650,"wires":[]},{"id":"624a642a.8f42dc","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":16,"width":"2","height":"1","name":"","label":"ozone","format":"{{msg.payload | number:1}}du","layout":"col-center","x":900,"y":210,"wires":[]},{"id":"89c76554.bc4ed8","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":19,"width":"5","height":"1","name":"Last updated","label":"","format":"Last Updated - {{msg.payload | date:\"HH':'mm\"}}","layout":"row-left","x":920,"y":730,"wires":[]},{"id":"e695380c.df7ab8","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":15,"width":"2","height":"1","name":"dewpoint","label":"dewpoint","format":"{{msg.payload}}Ā°C","layout":"col-center","x":910,"y":530,"wires":[]},{"id":"7ecf24ed.e5f57c","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":5,"width":"2","height":"1","name":"","label":"humidity","format":"{{msg.payload | number:1}}%","layout":"col-center","x":910,"y":610,"wires":[]},{"id":"d99bdb85.c74af8","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":3,"width":"2","height":"1","name":"","label":"rain prob","format":"{{msg.payload | number:1}}%","layout":"col-center","x":910,"y":130,"wires":[]},{"id":"3f48dcc5.211744","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":4,"width":"2","height":"1","name":"","label":"rain intense","format":"{{msg.payload | number:1}}ml/hr","layout":"col-center","x":920,"y":170,"wires":[]},{"id":"1d762d93.be4822","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":7,"width":"3","height":"1","name":"","label":"temperature","format":"{{msg.payload}}Ā°C","layout":"col-center","x":920,"y":330,"wires":[]},{"id":"977d821d.9c2e2","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":11,"width":"3","height":"1","name":"","label":"w/spd","format":"{{msg.payload}}mph","layout":"row-spread","x":900,"y":450,"wires":[]},{"id":"37ad0f29.672f4","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":13,"width":"3","height":"1","name":"cloud cover","label":"clouds","format":"{{msg.payload | number:1}}%","layout":"row-spread","x":920,"y":250,"wires":[]},{"id":"42cb8696.e24cc8","type":"ui_text","z":"a444a9ff.e7a408","group":"304cf995.dc6556","order":8,"width":"3","height":"1","name":"","label":"feelslike","format":"{{msg.payload}}Ā°C","layout":"col-center","x":910,"y":370,"wires":[]},{"id":"2031fcea.49e464","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":3,"width":"2","height":"1","name":"Rain - intensity","label":"rain intense","format":"{{msg.payload | number:1}}ml/hr","layout":"col-center","x":930,"y":1240,"wires":[]},{"id":"d16948aa.b123c8","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":11,"width":"3","height":"1","name":"","label":"humidity","format":"{{msg.payload | number:1}}%","layout":"col-center","x":910,"y":960,"wires":[]},{"id":"2f71f773.785d38","type":"function","z":"a444a9ff.e7a408","name":"Temp","func":"const t = msg.payload.temperature;\nconst f = msg.payload.apparentTemperature;\n\nlet m1 = {topic:\"temperature\",payload:t,};\nlet m2 = {topic:\"feelslike\",payload:f,};\n\nreturn [ m1, m2 ];","outputs":2,"noerr":0,"x":720,"y":340,"wires":[["aac4d164.28ba9","1d762d93.be4822"],["aac4d164.28ba9","42cb8696.e24cc8"]]},{"id":"d5b8f156.91db4","type":"function","z":"a444a9ff.e7a408","name":"Obs time","func":"const i = msg.payload.time*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":730,"wires":[["89c76554.bc4ed8"]]},{"id":"e59277f0.f35818","type":"function","z":"a444a9ff.e7a408","name":"Forecast","func":"const t = msg.topic;\nconst i = msg.data.daily.data[t];\nnode.send(i);","outputs":1,"noerr":0,"x":340,"y":1010,"wires":[["9dff34b9.9e3958","65974f5.65af7b","3d353aea.fda316","fefc2d58.acbba","772353fd.3b940c","159eb656.324ada","b7278812.1dcab8","882810d2.13c64","5bad0c3e.429434","339a7290.4047be","e304dbfd.279578","12593f3e.b6ec71","4110db4c.b4a4e4","db5e2039.b9b8b"]]},{"id":"882810d2.13c64","type":"function","z":"a444a9ff.e7a408","name":"Summary","func":"const i = msg.summary;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":1160,"wires":[["6da56493.0c874c"]]},{"id":"5bad0c3e.429434","type":"function","z":"a444a9ff.e7a408","name":"gusts","func":"const i = msg.windGust;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":1120,"wires":[["cd9f115e.8ec96"]]},{"id":"cd9f115e.8ec96","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":10,"width":"3","height":"1","name":"","label":"gusts","format":"{{msg.payload | number:1}}mph","layout":"col-center","x":900,"y":1120,"wires":[]},{"id":"339a7290.4047be","type":"function","z":"a444a9ff.e7a408","name":"clouds","func":"const i = msg.cloudCover * 100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":1000,"wires":[["c3cf491a.c87538"]]},{"id":"c3cf491a.c87538","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":12,"width":"3","height":"1","name":"","label":"Cloud cover","format":"{{msg.payload | number:1}}%","layout":"col-center","x":920,"y":1000,"wires":[]},{"id":"41024beb.41db14","type":"link in","z":"a444a9ff.e7a408","name":"Wunderground forecast parser","links":["6bf9da4c.da8f34"],"x":95,"y":370,"wires":[["4b5672c4.924c9c","19415225.f263ce"]]},{"id":"19415225.f263ce","type":"function","z":"a444a9ff.e7a408","name":"Current","func":"const i = msg.data.currently;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":350,"y":370,"wires":[["16739c3e.cad3d4","868f4534.3b4098","35b2a800.b01218","66adc6b5.bffaa8","9b1a0ef3.77528","7f9ae0e5.9ce56","32bb3936.7aacd6","4934b52c.b442dc","952825ce.eef7a8","d5b8f156.91db4","2f71f773.785d38","f0546cf7.c293e"]]},{"id":"1ec993a1.f4342c","type":"darksky","z":"a444a9ff.e7a408","darksky":"","name":"","lon":"-1.052777","lat":"53.473438","date":"","time":"","mode":"node","lang":"en","units":"uk2","x":550,"y":1450,"wires":[["6bf9da4c.da8f34"]]},{"id":"4110db4c.b4a4e4","type":"function","z":"a444a9ff.e7a408","name":"Sunrise","func":"const i = msg.sunriseTime*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":1280,"wires":[["96408c18.a782f"]]},{"id":"db5e2039.b9b8b","type":"function","z":"a444a9ff.e7a408","name":"Sunset","func":"const i = msg.sunsetTime*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":730,"y":1320,"wires":[["2830c31c.be67dc"]]},{"id":"96408c18.a782f","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":13,"width":"3","height":"1","name":"Sunrise","label":"Sunrise","format":"{{msg.payload | date:\"HH':'mm\"}}","layout":"col-center","x":910,"y":1280,"wires":[]},{"id":"2830c31c.be67dc","type":"ui_text","z":"a444a9ff.e7a408","group":"a9c0b162.e0664","order":14,"width":"3","height":"1","name":"Sunset","label":"Sunset","format":"{{msg.payload | date:\"HH':'mm\"}}","layout":"col-center","x":910,"y":1320,"wires":[]},{"id":"fa8c052c.fb7ec8","type":"inject","z":"a444a9ff.e7a408","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"onceDelay":"","x":120,"y":1530,"wires":[["db5b3dc1.a0973"]]},{"id":"304cf995.dc6556","type":"ui_group","z":"a444a9ff.e7a408","name":"Current Conditions","tab":"49e5ad81.6d6e24","order":1,"disp":true,"width":"6"},{"id":"a9c0b162.e0664","type":"ui_group","z":"","name":"Forecast","tab":"49e5ad81.6d6e24","order":2,"disp":true,"width":"6","collapse":false},{"id":"49e5ad81.6d6e24","type":"ui_tab","z":"a444a9ff.e7a408","name":"weather","icon":"cloud","order":2,"disabled":false,"hidden":false}]

I understand that Darksky are in the process of changing their api, so it may need tweaking when they do.

1 Like

@Paul-Reed The display of the forcast humidity shows a lot of zeros. I changed the ui_text node from {{msg.payload}}% to {{msg.payload | number:1}}% as you have in the other humidity ui_text node and that fixed it.

2 Likes

Yes, I missed that!
The flow above has been updated.

Paul

I really miss the Wunderground Forecast Summary, which was really detailed, whilst the Darksky summary is poor, and barely a few words strung together....

My Wunderground API key still seems to work fine with the node-red-node-weather-underground node. I know you can't get a new key but my old one seems fine. Have they cut something out?

Thank you Paul,

I worked on your original flow today and did manage to get all the ā€œcurrentā€ values displaying correctly. The forecast side of things really messed me up. The last coding I did was in 1992 and it was in machine code on an 8086!. Yes, all I had to do is change the API Key and location, thanks again for your help. Iā€™m going through the old and the new to try and learn more. Iā€™ve also changed from deg C to F, Iā€™m a Canadian living in the US so they still largely use the imperial units.

Cheers

Craig

The WU folks sent out a mail in the last month that on 12/31 the API will be retired.

I like this weather widget very much. Good work! I only have one error message in the function mode for current summary (for the hour) which I don't understand: "TypeError: Cannot read property 'summary' of undefined". What is wrong?

I corrected this using 'hourly' instead of 'minutely'.

Here's my dashboard I have working with the exception of the weather icons in the Current conditions and Forecast, I've tried to get them working but just can't seem to do it.

Node-red and this dashboard is running on a Siemens iot2040 through wifi to my lan.

The Current conditions and forecast are the Darksky API
The Inside Temp is pulled from my Siemens S7-1200 PLC with a RTD in the house.
The Local weather station is data I receive over the air from my neighbours new weather station with a USB SDR and RTL_433 sent through MQTT.

Thanks in advance for any help.

1 Like

it would help if you included your flow so pleople could see what you have done so far.
see this thread about including flows: How to share code or flow json

My apologies, I should have done that. Here are my flows, I followed the instructions "How to share flows"

[{"id":"39250d97.b35f92","type":"tab","label":"Flow 1"},{"id":"e40b13c8.733b4","type":"ui_base","theme":{"name":"theme-light","lightTheme":{"default":"#0094CE","baseColor":"#0094CE","baseFont":"Helvetica Neue","edited":true,"reset":false},"darkTheme":{"default":"#097479","baseColor":"#097479","baseFont":"Helvetica Neue","edited":false},"customTheme":{"name":"Untitled Theme 1","default":"#4B7930","baseColor":"#4B7930","baseFont":"Helvetica Neue"},"themeState":{"base-color":{"default":"#0094CE","value":"#0094CE","edited":false},"page-titlebar-backgroundColor":{"value":"#0094CE","edited":false},"page-backgroundColor":{"value":"#fafafa","edited":false},"page-sidebar-backgroundColor":{"value":"#ffffff","edited":false},"group-textColor":{"value":"#1bbfff","edited":false},"group-borderColor":{"value":"#ffffff","edited":false},"group-backgroundColor":{"value":"#ffffff","edited":false},"widget-textColor":{"value":"#111111","edited":false},"widget-backgroundColor":{"value":"#0094ce","edited":false},"widget-borderColor":{"value":"#ffffff","edited":false}}},"site":{"name":"Node-RED Dashboard","hideToolbar":"false","allowSwipe":"false","dateFormat":"DD/MM/YYYY","sizes":{"sx":48,"sy":48,"gx":6,"gy":6,"cx":6,"cy":6,"px":0,"py":0}}},{"id":"c8256d1d.52953","type":"ui_group","z":"39250d97.b35f92","name":"Current Conditions","tab":"914bbef4.8df0f","order":1,"disp":true,"width":"6"},{"id":"834fa4e5.1c2a08","type":"ui_group","z":"","name":"Forecast","tab":"914bbef4.8df0f","order":2,"disp":true,"width":"6"},{"id":"7354e271.08c74c","type":"s7 endpoint","z":"","address":"10.0.1.10","port":"102","rack":"0","slot":"1","localtsaphi":"01","localtsaplo":"00","remotetsaphi":"01","remotetsaplo":"00","connmode":"rack-slot","cycletime":"60000","timeout":"1500","verbose":"on","name":"","vartable":[{"addr":"MR12","name":"Temp Ā°F"},{"addr":"MR4","name":"Temp Ā°C"}]},{"id":"4073b161.90ac1","type":"ui_group","z":"","name":"Inside temp","tab":"914bbef4.8df0f","disp":true,"width":"8"},{"id":"f2a6d983.107f48","type":"persist-store","z":"","filename":"/usr/lib/node_modules/node-red/nodes/24htemp.json","interval":"60"},{"id":"36c9db09.030b94","type":"mqtt-broker","z":"","broker":"10.0.1.3","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willPayload":"","birthTopic":"","birthQos":"0","birthPayload":""},{"id":"dd8d8e33.e84f7","type":"ui_group","z":"","name":"Local weather station","tab":"914bbef4.8df0f","disp":true,"width":"6"},{"id":"914bbef4.8df0f","type":"ui_tab","z":"39250d97.b35f92","name":"weather","icon":"cloud","order":2},{"id":"7199204d.73ffe","type":"darksky-credentials","z":"","key_identifier":"DS_Key"},{"id":"9f9931a7.1eb51","type":"function","z":"39250d97.b35f92","name":"Rain intensity","func":"const i = msg.payload.precipIntensity*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":725,"y":109,"wires":[["22026442.cf03bc"]]},{"id":"24885055.91284","type":"function","z":"39250d97.b35f92","name":"Rain chance","func":"const i = msg.payload.precipProbability*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":715,"y":69,"wires":[["8674ffea.f6622"]]},{"id":"463e15fb.1814fc","type":"function","z":"39250d97.b35f92","name":"Summary","func":"const i = (msg.data.minutely.summary);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":29,"wires":[["c1a7bd41.c15c5"]]},{"id":"2451be8e.ab4312","type":"function","z":"39250d97.b35f92","name":"Ozone","func":"const i = msg.payload.ozone;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":695,"y":149,"wires":[["79c8a9ea.283918"]]},{"id":"773a9c2b.32d224","type":"function","z":"39250d97.b35f92","name":"Cloud","func":"const i = msg.payload.cloudCover*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":695,"y":189,"wires":[["6077f430.89259c"]]},{"id":"f6b8574b.b00028","type":"inject","z":"39250d97.b35f92","name":"every 10 mins","topic":"","payload":"","payloadType":"str","repeat":"","crontab":"*/10 0-23 * * *","once":true,"x":105,"y":1409,"wires":[["cac896c7.c79278"]]},{"id":"9493fc2a.8e5b6","type":"function","z":"39250d97.b35f92","name":"high temp","func":"const i = msg.temperatureHigh.toFixed(1);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":819,"wires":[["b25c3c59.1e6db"]]},{"id":"5c299a7c.a7d6b4","type":"function","z":"39250d97.b35f92","name":"low temp","func":"const i = msg.temperatureLow.toFixed(1);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":859,"wires":[["e7020ed6.2a3cd"]]},{"id":"298a41c3.36fd6e","type":"function","z":"39250d97.b35f92","name":"icon","func":"let i = msg.icon;\n\n// Fix for Darksky displaying partly-cloudy-night\n// error, hopefully fixed soon...\nif (i == \"partly-cloudy-night\") {\n    i = \"clear-day\";\n    }\n    \nnode.send({payload:i});","outputs":1,"noerr":0,"x":293,"y":791,"wires":[[]]},{"id":"9c3873d3.9aecf","type":"function","z":"39250d97.b35f92","name":"date","func":"const i = (msg.time)*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":695,"y":739,"wires":[["9fcc7c6f.f2044"]]},{"id":"a6c88c27.4f01","type":"function","z":"39250d97.b35f92","name":"rain probability","func":"if (msg.hasOwnProperty(\"precipProbability\")) {\nconst i = msg.precipProbability*100;\nnode.send({payload:i});\n} else {\nnode.send({payload:0});\n}","outputs":1,"noerr":0,"x":725,"y":1139,"wires":[["56aeb382.3575ac"]]},{"id":"15002c60.cc9dc4","type":"function","z":"39250d97.b35f92","name":"rain Intensity","func":"if (msg.hasOwnProperty(\"precipIntensity\")) {\nconst i = msg.precipIntensity;\nnode.send({payload:i});\n} else {\nnode.send({payload:0});\n}","outputs":1,"noerr":0,"x":715,"y":1179,"wires":[["41632c4b.ab61e4"]]},{"id":"a60cf02b.e2067","type":"function","z":"39250d97.b35f92","name":"humidity","func":"const i = msg.humidity.toFixed(1)*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":899,"wires":[["b16403e9.19a7a"]]},{"id":"8d4baa7d.011398","type":"function","z":"39250d97.b35f92","name":"wind deg","func":"let i = msg.windBearing;\nif (i <= 180) {\n    i = (i + 180);\n}\nelse\ni = (i - 180);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":979,"wires":[["74a468f5.70cf28"]]},{"id":"935ce970.a3f058","type":"function","z":"39250d97.b35f92","name":"wspeed","func":"const i = msg.windSpeed;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":1019,"wires":[["feaa73b2.ddc4a"]]},{"id":"618610ff.c133a","type":"link in","z":"39250d97.b35f92","name":"Wunderground forecast parser","links":["fb244614.026988"],"x":70,"y":949,"wires":[["53aa302.98222d"]]},{"id":"fb244614.026988","type":"link out","z":"39250d97.b35f92","name":"Forecast trigger","links":["618610ff.c133a","49f07176.66759","bb49de0b.d1bc4","d7bae4e9.6e7c98"],"x":701,"y":1428,"wires":[]},{"id":"43fd29b3.7a6738","type":"function","z":"39250d97.b35f92","name":"Dewpoint","func":"const i = msg.payload.dewPoint.toFixed(1);\nnode.send({payload:i});\n","outputs":1,"noerr":0,"x":705,"y":459,"wires":[["f7c4b419.b46548"]]},{"id":"5ffd57b.47cd6a8","type":"function","z":"39250d97.b35f92","name":"Wind deg","func":"let i = msg.payload.windBearing;\n    if (i <= 180) {\n    i = (i + 180);\n    }\n    else\n    i = (i - 180);\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":509,"wires":[["e5011815.1d74f8"]]},{"id":"a2c643c9.e671c","type":"function","z":"39250d97.b35f92","name":"Humidity","func":"const i = msg.payload.humidity*100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":549,"wires":[["848e19e3.9d3608"]]},{"id":"b997763d.a3cef8","type":"function","z":"39250d97.b35f92","name":"Pressure","func":"const i = msg.payload.pressure*.02953;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":589,"wires":[["57a8569a.251678"]]},{"id":"99f56505.aec578","type":"function","z":"39250d97.b35f92","name":"Parse Icon","func":"msg.payload = (msg.payload.weather);\n    node.status({text:msg.payload});\nreturn msg;","outputs":1,"noerr":0,"x":715,"y":629,"wires":[["4579a9c.e67d758"]]},{"id":"2c778a18.fe9ad6","type":"function","z":"39250d97.b35f92","name":"Reload","func":"//Load flow context to variable\nvar select = flow.get('dropdown')||1;\n\n//If dropdown option is changed\nif (msg.topic=='dropdown') {\n    flow.set('dropdown',msg.payload);\n    node.send ({topic:msg.payload});\n    }\n    \n//If http connection is made, or triggered by inject\nelse if (msg.payload=='connect') {\n    node.send ({topic:select});\n    }\n\n//Or do nothing\nelse {node.send (null);}\n","outputs":"1","noerr":0,"x":365,"y":1359,"wires":[["3ee3fafb.6e0786"]]},{"id":"70ffda71.7d4394","type":"inject","z":"39250d97.b35f92","name":"New day","topic":"","payload":"connect","payloadType":"str","repeat":"","crontab":"01 00 * * *","once":false,"x":125,"y":1319,"wires":[["2c778a18.fe9ad6"]]},{"id":"147d8eb5.ae94c1","type":"function","z":"39250d97.b35f92","name":"Wind","func":"const w = msg.payload.windSpeed.toFixed(1);\nlet g = msg.payload.windGust.toFixed(1);\n\n// make sure gusts are never lower\n// than windspeed\nif (g < w) {g = w;}\n\nlet newMess1 = {topic:\"wind\",payload:w,};\nlet newMess2 = {topic:\"gust\",payload:g,};\n\nreturn [ newMess1, newMess2 ];\n","outputs":2,"noerr":0,"x":695,"y":409,"wires":[["3e56ebd5.e1d324","16838aab.ec0665"],["3e56ebd5.e1d324","dab1b909.d9fc88"]]},{"id":"86421fc5.fab06","type":"comment","z":"39250d97.b35f92","name":"Current Conditions","info":"","x":115,"y":219,"wires":[]},{"id":"9a8e7811.c8b238","type":"comment","z":"39250d97.b35f92","name":"Darksky forecast","info":"","x":105,"y":889,"wires":[]},{"id":"54921a91.6853e4","type":"inject","z":"39250d97.b35f92","name":"restore","topic":"","payload":"weatherTemp","payloadType":"flow","repeat":"","crontab":"","once":true,"x":705,"y":229,"wires":[["a062fc63.ef259"]]},{"id":"581cb32c.a950ac","type":"change","z":"39250d97.b35f92","name":"save context","rules":[{"t":"set","p":"weatherTemp","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1065,"y":229,"wires":[[]]},{"id":"ac0a4741.5dc708","type":"inject","z":"39250d97.b35f92","name":"restore","topic":"","payload":"weatherWind","payloadType":"flow","repeat":"","crontab":"","once":true,"x":705,"y":349,"wires":[["3e56ebd5.e1d324"]]},{"id":"20fcbed.307b742","type":"change","z":"39250d97.b35f92","name":"save context","rules":[{"t":"set","p":"weatherWind","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1065,"y":349,"wires":[[]]},{"id":"ab0e240a.6cf118","type":"ui_ui_control","z":"39250d97.b35f92","name":"","x":65,"y":1279,"wires":[["2c778a18.fe9ad6"]]},{"id":"cac896c7.c79278","type":"ui_button","z":"39250d97.b35f92","name":"Dash Refresh","group":"c8256d1d.52953","order":18,"width":"1","height":"1","passthru":true,"label":"","color":"","bgcolor":"","icon":"fa-refresh fa-2x","payload":"","payloadType":"str","topic":"","x":345,"y":1409,"wires":[["3ee3fafb.6e0786"]]},{"id":"9a20c5f8.326f08","type":"ui_dropdown","z":"39250d97.b35f92","name":"Select","label":"","place":"","group":"834fa4e5.1c2a08","order":8,"width":"3","height":"1","passthru":true,"options":[{"label":"today","value":"0","type":"str"},{"label":"today + 1","value":"1","type":"str"},{"label":"today + 2","value":"2","type":"str"},{"label":"today + 3","value":"3","type":"str"},{"label":"today + 4","value":"4","type":"str"},{"label":"today + 5","value":"5","type":"str"},{"label":"today + 6","value":"6","type":"str"},{"label":"today + 7","value":"7","type":"str"}],"payload":"","topic":"dropdown","x":185,"y":1359,"wires":[["2c778a18.fe9ad6"]]},{"id":"d3821107.0152b","type":"ui_template","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","name":"icon Image","order":1,"width":"2","height":"2","format":"<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-darksky-{{msg.payload}}\"></i>\n</div>","storeOutMessages":false,"fwdInMessages":false,"x":292,"y":713,"wires":[[]]},{"id":"4579a9c.e67d758","type":"ui_template","z":"39250d97.b35f92","group":"c8256d1d.52953","name":"icon image","order":1,"width":"2","height":"2","format":"<link rel=\"stylesheet\" href=\"/usr/lib/node_modules/node-red/public/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-forecast-io-{{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"x":895,"y":629,"wires":[[]]},{"id":"ebd7ce78.18844","type":"ui_template","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","name":"weather summary","order":16,"width":"6","height":"9","format":"<div><font size=\"+1.5\">Weather Forecast Summary</font></div><br>\n<div ng-bind-html=\"msg.payload\"></div>\n","storeOutMessages":false,"fwdInMessages":false,"x":915,"y":1099,"wires":[[]]},{"id":"e5011815.1d74f8","type":"ui_gauge","z":"39250d97.b35f92","name":"wind direction","group":"c8256d1d.52953","order":10,"width":"3","height":"3","gtype":"compass","title":"wind direction","label":"degrees","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":905,"y":509,"wires":[]},{"id":"74a468f5.70cf28","type":"ui_gauge","z":"39250d97.b35f92","name":"Wind compass","group":"834fa4e5.1c2a08","order":7,"width":"3","height":"3","gtype":"compass","title":"wind direction","label":"degrees","format":"{{value}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"x":905,"y":979,"wires":[]},{"id":"a062fc63.ef259","type":"ui_chart","z":"39250d97.b35f92","name":"temp chart","group":"c8256d1d.52953","order":2,"width":0,"height":0,"label":"Temperature","chartType":"line","legend":"true","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#00ff80","#0080c0","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":895,"y":229,"wires":[["581cb32c.a950ac"],[]]},{"id":"3e56ebd5.e1d324","type":"ui_chart","z":"39250d97.b35f92","name":"wind chart","group":"c8256d1d.52953","order":14,"width":0,"height":0,"label":"Wind","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#00ff80","#0080c0","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":895,"y":349,"wires":[["20fcbed.307b742"],[]]},{"id":"b25c3c59.1e6db","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":4,"width":"2","height":"1","name":"","label":"temp ā–²","format":"{{msg.payload}}Ā°F","layout":"col-center","x":885,"y":819,"wires":[]},{"id":"e7020ed6.2a3cd","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":5,"width":"2","height":"1","name":"","label":"temp ā–¼","format":"{{msg.payload}}Ā°F","layout":"col-center","x":885,"y":859,"wires":[]},{"id":"716ae448.f88dbc","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":17,"width":"2","height":"1","name":"","label":"time now","format":"{{msg.payload | date:\"HH':'mm\"}}","layout":"col-center","x":395,"y":1469,"wires":[]},{"id":"56aeb382.3575ac","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":2,"width":"2","height":"1","name":"Rain prob","label":"rain prob","format":"{{msg.payload | number:0}}%","layout":"col-center","x":885,"y":1139,"wires":[]},{"id":"feaa73b2.ddc4a","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":9,"width":"3","height":"1","name":"","label":"w/speed","format":"{{msg.payload | number:1}}mph","layout":"col-center","x":885,"y":1019,"wires":[]},{"id":"9fcc7c6f.f2044","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":6,"width":"6","height":"1","name":"Date","label":"forecast for","format":"{{msg.payload | date:\"EEEE, MMMM d\"}}","layout":"col-center","x":875,"y":739,"wires":[]},{"id":"c1a7bd41.c15c5","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":9,"width":"6","height":"1","name":"for the hour","label":" ","format":"{{msg.payload}}","layout":"row-left","x":895,"y":29,"wires":[]},{"id":"dab1b909.d9fc88","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":12,"width":"3","height":"1","name":"","label":"gusts","format":"{{msg.payload}}mph","layout":"row-spread","x":875,"y":429,"wires":[]},{"id":"57a8569a.251678","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":6,"width":"2","height":"1","name":"","label":"pressure","format":"{{msg.payload | number:2}}in/hg","layout":"col-center","x":885,"y":589,"wires":[]},{"id":"79c8a9ea.283918","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":16,"width":"2","height":"1","name":"","label":"ozone","format":"{{msg.payload | number:1}}du","layout":"col-center","x":875,"y":149,"wires":[]},{"id":"82da7559.f25f88","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":19,"width":"5","height":"1","name":"Last updated","label":"","format":"Last Updated - {{msg.payload | date:\"HH':'mm\"}}","layout":"row-left","x":895,"y":669,"wires":[]},{"id":"f7c4b419.b46548","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":15,"width":"2","height":"1","name":"dewpoint","label":"dewpoint","format":"{{msg.payload}}Ā°F","layout":"col-center","x":885,"y":469,"wires":[]},{"id":"848e19e3.9d3608","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":5,"width":"2","height":"1","name":"","label":"humidity","format":"{{msg.payload | number:1}}%","layout":"col-center","x":885,"y":549,"wires":[]},{"id":"8674ffea.f6622","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":3,"width":"2","height":"1","name":"","label":"rain prob","format":"{{msg.payload | number:1}}%","layout":"col-center","x":885,"y":69,"wires":[]},{"id":"22026442.cf03bc","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":4,"width":"2","height":"1","name":"","label":"rain intense","format":"{{msg.payload | number:1}} in/hr","layout":"col-center","x":895,"y":109,"wires":[]},{"id":"61008b8b.8b8394","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":7,"width":"3","height":"1","name":"","label":"temperature","format":"{{msg.payload}}Ā°F","layout":"col-center","x":895,"y":269,"wires":[]},{"id":"16838aab.ec0665","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":11,"width":"3","height":"1","name":"","label":"w/spd","format":"{{msg.payload}}mph","layout":"row-spread","x":875,"y":389,"wires":[]},{"id":"6077f430.89259c","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":13,"width":"3","height":"1","name":"cloud cover","label":"clouds","format":"{{msg.payload | number:1}}%","layout":"row-spread","x":895,"y":189,"wires":[]},{"id":"46288e6.293777","type":"ui_text","z":"39250d97.b35f92","group":"c8256d1d.52953","order":8,"width":"3","height":"1","name":"","label":"feelslike","format":"{{msg.payload}}Ā°F","layout":"col-center","x":885,"y":309,"wires":[]},{"id":"41632c4b.ab61e4","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":3,"width":"2","height":"1","name":"Rain - intensity","label":"rain intense","format":"{{msg.payload | number:1}} in/hr","layout":"col-center","x":905,"y":1179,"wires":[]},{"id":"b16403e9.19a7a","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":11,"width":"3","height":"1","name":"","label":"humidity","format":"{{msg.payload}}%","layout":"col-center","x":885,"y":899,"wires":[]},{"id":"1cc313da.6bc58c","type":"function","z":"39250d97.b35f92","name":"Temp","func":"const t = msg.payload.temperature.toFixed(1);\nconst f = msg.payload.apparentTemperature.toFixed(1);\n\nlet m1 = {topic:\"temperature\",payload:t,};\nlet m2 = {topic:\"feelslike\",payload:f,};\n\nreturn [ m1, m2 ];","outputs":2,"noerr":0,"x":703,"y":279,"wires":[["a062fc63.ef259","61008b8b.8b8394"],["a062fc63.ef259","46288e6.293777"]]},{"id":"99375c69.86fdb","type":"function","z":"39250d97.b35f92","name":"Obs time","func":"const i = msg.payload.time*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":669,"wires":[["82da7559.f25f88"]]},{"id":"53aa302.98222d","type":"function","z":"39250d97.b35f92","name":"Forecast","func":"const t = msg.topic;\nconst i = msg.data.daily.data[t];\nnode.send(i);","outputs":1,"noerr":0,"x":315,"y":949,"wires":[["9c3873d3.9aecf","9493fc2a.8e5b6","5c299a7c.a7d6b4","a60cf02b.e2067","8d4baa7d.011398","935ce970.a3f058","8e284a24.bdce48","1c839330.05fbad","e6ec6867.0e5598","a6c88c27.4f01","15002c60.cc9dc4","c83b73fe.dcbc4","28270100.d7233","40f1aea9.4011c"]]},{"id":"8e284a24.bdce48","type":"function","z":"39250d97.b35f92","name":"Summary","func":"const i = msg.summary;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":1099,"wires":[["ebd7ce78.18844"]]},{"id":"1c839330.05fbad","type":"function","z":"39250d97.b35f92","name":"gusts","func":"const i = msg.windGust;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":695,"y":1059,"wires":[["c91530b7.b42ca"]]},{"id":"c91530b7.b42ca","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":10,"width":"3","height":"1","name":"","label":"gusts","format":"{{msg.payload | number:1}}mph","layout":"col-center","x":875,"y":1059,"wires":[]},{"id":"e6ec6867.0e5598","type":"function","z":"39250d97.b35f92","name":"clouds","func":"const i = msg.cloudCover * 100;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":695,"y":939,"wires":[["45f5c6d4.d31db8"]]},{"id":"45f5c6d4.d31db8","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":12,"width":"3","height":"1","name":"","label":"Cloud cover","format":"{{msg.payload | number:1}}%","layout":"col-center","x":895,"y":939,"wires":[]},{"id":"d7bae4e9.6e7c98","type":"link in","z":"39250d97.b35f92","name":"Wunderground forecast parser","links":["fb244614.026988"],"x":70,"y":309,"wires":[["463e15fb.1814fc","a88aee75.e27fc"]]},{"id":"a88aee75.e27fc","type":"function","z":"39250d97.b35f92","name":"Current","func":"const i = msg.data.currently;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":325,"y":309,"wires":[["9f9931a7.1eb51","24885055.91284","2451be8e.ab4312","773a9c2b.32d224","43fd29b3.7a6738","5ffd57b.47cd6a8","a2c643c9.e671c","b997763d.a3cef8","99f56505.aec578","99375c69.86fdb","1cc313da.6bc58c","147d8eb5.ae94c1"]]},{"id":"c83b73fe.dcbc4","type":"function","z":"39250d97.b35f92","name":"Sunrise","func":"const i = msg.sunriseTime*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":1219,"wires":[["a49fbc89.62df5"]]},{"id":"28270100.d7233","type":"function","z":"39250d97.b35f92","name":"Sunset","func":"const i = msg.sunsetTime*1000;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":705,"y":1259,"wires":[["78d8d7e9.4782f8"]]},{"id":"a49fbc89.62df5","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":13,"width":"3","height":"1","name":"Sunrise","label":"Sunrise","format":"{{msg.payload | date:\"HH':'mm\"}}","layout":"col-center","x":885,"y":1219,"wires":[]},{"id":"78d8d7e9.4782f8","type":"ui_text","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","order":14,"width":"3","height":"1","name":"Sunset","label":"Sunset","format":"{{msg.payload | date:\"HH':'mm\"}}","layout":"col-center","x":885,"y":1259,"wires":[]},{"id":"b11e1adb.0120e8","type":"inject","z":"39250d97.b35f92","name":"","topic":"","payload":"","payloadType":"date","repeat":"60","crontab":"","once":true,"x":95,"y":1469,"wires":[["716ae448.f88dbc"]]},{"id":"2f2794.d2eda86c","type":"s7 in","z":"39250d97.b35f92","endpoint":"7354e271.08c74c","mode":"single","variable":"Temp Ā°F","diff":false,"name":"Interior temp F","x":98,"y":1626,"wires":[["87e33cd0.a32d3","804c7e1c.6ad92"]]},{"id":"efd9e4bd.e128e8","type":"s7 in","z":"39250d97.b35f92","endpoint":"7354e271.08c74c","mode":"single","variable":"Temp Ā°C","diff":false,"name":"Interior temp C","x":97,"y":1683,"wires":[["a5a96c5.b69a89","804c7e1c.6ad92"]]},{"id":"87e33cd0.a32d3","type":"ui_gauge","z":"39250d97.b35f92","name":"","group":"4073b161.90ac1","order":15,"width":"8","height":"4","gtype":"gage","title":"Inside temp Ā°F","label":"Ā°F","format":"{{value | number: 1}}","min":"40","max":"80","colors":["#00ffff","#00ff00","#ca3838"],"seg1":"60","seg2":"73","x":678,"y":1613,"wires":[]},{"id":"a5a96c5.b69a89","type":"ui_gauge","z":"39250d97.b35f92","name":"","group":"4073b161.90ac1","order":16,"width":"8","height":"4","gtype":"gage","title":"Inside temp Ā°C","label":"Ā°C","format":"{{value | number: 1}}","min":"15","max":"30","colors":["#80ffff","#00ff40","#ca3838"],"seg1":"17","seg2":"23","x":678,"y":1691,"wires":[]},{"id":"804c7e1c.6ad92","type":"ui_chart","z":"39250d97.b35f92","name":"","group":"4073b161.90ac1","order":2,"width":"8","height":"6","label":"Interior temp","chartType":"line","legend":"true","xformat":"HH:mm","interpolate":"linear","nodata":"","ymin":"","ymax":"","removeOlder":"24","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"colors":["#ff0000","#0000ff","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"x":403,"y":1760,"wires":[["3e33b769.0c0178"],[]]},{"id":"3e33b769.0c0178","type":"persist in","z":"39250d97.b35f92","name":"Int_temp_24h","storageNode":"f2a6d983.107f48","x":571,"y":1749,"wires":[]},{"id":"b371f81a.696ab8","type":"persist out","z":"39250d97.b35f92","name":"Int_temp_24h","storageNode":"f2a6d983.107f48","x":225,"y":1808,"wires":[["804c7e1c.6ad92"]]},{"id":"6006fddb.29e144","type":"comment","z":"39250d97.b35f92","name":"Int temp from PLC","info":"","x":98,"y":1565,"wires":[]},{"id":"6567316c.bb52e","type":"mqtt in","z":"39250d97.b35f92","name":"","topic":"sensors/rtl_433","qos":"1","broker":"36c9db09.030b94","x":272,"y":2100,"wires":[["b741478c.c4a968"]]},{"id":"ed1a24a3.a61d28","type":"function","z":"39250d97.b35f92","name":"Local Temp","func":"const i = msg.payload.temperature_F;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":723,"y":2083,"wires":[["9c66aeeb.31b7a"]]},{"id":"9c66aeeb.31b7a","type":"ui_gauge","z":"39250d97.b35f92","name":"","group":"dd8d8e33.e84f7","order":0,"width":0,"height":0,"gtype":"gage","title":"local outside temp","label":"Ā°F","format":"{{value | number: 1}}","min":"-30","max":"110","colors":["#0cfff5","#0de60a","#ca3838"],"seg1":"32","seg2":"75","x":958,"y":2106,"wires":[]},{"id":"b741478c.c4a968","type":"json","z":"39250d97.b35f92","name":"","x":473,"y":2098,"wires":[["ed1a24a3.a61d28","1545d87d.af0368","1e6c14b0.fafffb","6b975255.850cec"]]},{"id":"1545d87d.af0368","type":"function","z":"39250d97.b35f92","name":"Wind Speed","func":"const i = msg.payload.wind_speed_kph*0.621371;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":738,"y":2127,"wires":[["532559e2.f008c8"]]},{"id":"532559e2.f008c8","type":"ui_text","z":"39250d97.b35f92","group":"dd8d8e33.e84f7","order":1,"width":0,"height":0,"name":"","label":"Wind speed MPH","format":"{{value | number: 1}}","layout":"row-spread","x":963,"y":2181,"wires":[]},{"id":"1e6c14b0.fafffb","type":"function","z":"39250d97.b35f92","name":"Wind direction","func":"const i = msg.payload.wind_dir_deg;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":732,"y":2177,"wires":[["5f833426.353c6c"]]},{"id":"5f833426.353c6c","type":"ui_gauge","z":"39250d97.b35f92","name":"","group":"dd8d8e33.e84f7","order":2,"width":0,"height":0,"gtype":"compass","title":"Wind direction","label":"Deg Ā°","format":"{{value | number: 0}}","min":0,"max":"360","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":960,"y":2265,"wires":[]},{"id":"6b975255.850cec","type":"function","z":"39250d97.b35f92","name":"Accumulated rain","func":"const i = msg.payload.rain_inch;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":743,"y":2028,"wires":[["ec8583b1.377a2","987fda3f.4210f8"]]},{"id":"ec8583b1.377a2","type":"ui_text","z":"39250d97.b35f92","group":"dd8d8e33.e84f7","order":19,"width":0,"height":0,"name":"","label":"Rain inches","format":"{{value | number: 2}}","layout":"row-left","x":972,"y":1960,"wires":[]},{"id":"987fda3f.4210f8","type":"ui_gauge","z":"39250d97.b35f92","name":"","group":"dd8d8e33.e84f7","order":4,"width":0,"height":0,"gtype":"gage","title":"Rain past 24h","label":"inches","format":"{{value | number: 2}}","min":0,"max":"5","colors":["#00b500","#e6e600","#ca3838"],"seg1":"","seg2":"","x":968,"y":2032,"wires":[]},{"id":"3ee3fafb.6e0786","type":"darksky","z":"39250d97.b35f92","darksky":"7199204d.73ffe","name":"","lon":"-92.399148","lat":"40.936976","date":"","time":"","mode":"message","lang":"en","units":"us","x":569,"y":1385,"wires":[["fb244614.026988"]]},{"id":"40f1aea9.4011c","type":"function","z":"39250d97.b35f92","name":"Parse Icon","func":"msg.payload = (msg.payload);\n    node.status({text:msg.payload});\nreturn msg;\n","outputs":1,"noerr":0,"x":709,"y":779,"wires":[["2c00d6fa.dc7e2a"]]},{"id":"2c00d6fa.dc7e2a","type":"ui_template","z":"39250d97.b35f92","group":"834fa4e5.1c2a08","name":"wi","order":0,"width":0,"height":0,"format":"<link rel=\"stylesheet\" href=\"/usr/lib/node_modules/node-red/public/weather-icons/mycss/weather-icons.min.css\">\n<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-forecast-io-{{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"x":865,"y":779,"wires":[[]]}]
1 Like

Put a debug node (display complete msg object) on the

  1. output of the darksky node,
  2. output of the function node Current
  3. the output of the function Parse Icon

press one of the injects and see what comes out of each of the debug nodes starting at (3), then (2) and then (1) and explain what you see.

Here's what I get following your instructions, This is the (3) first as instructed. Thank you for your help.

Response of Forecast Parse Icon

object

time: 1550210400

summary: "Mostly cloudy throughout the day."

icon: "partly-cloudy-day"

sunriseTime: 1550235913

sunsetTime: 1550274302

moonPhase: 0.36

precipIntensity: 0.0005

precipIntensityMax: 0.002

precipIntensityMaxTime: 1550275200

precipProbability: 0.08

precipAccumulation: 0.238

precipType: "snow"

temperatureHigh: 16.03

temperatureHighTime: 1550271600

temperatureLow: 5.2

temperatureLowTime: 1550318400

apparentTemperatureHigh: 3.93

apparentTemperatureHighTime: 1550271600

apparentTemperatureLow: -5.5

apparentTemperatureLowTime: 1550307600

dewPoint: 2.29

humidity: 0.68

pressure: 1019.75

windSpeed: 11.12

windGust: 29.09

windGustTime: 1550210400

windBearing: 329

cloudCover: 0.62

uvIndex: 3

uvIndexTime: 1550253600

visibility: 6.97

ozone: 322.48

temperatureMin: 5.33

temperatureMinTime: 1550239200

temperatureMax: 16.03

temperatureMaxTime: 1550271600

apparentTemperatureMin: -11.67

apparentTemperatureMinTime: 1550239200

apparentTemperatureMax: 3.93

apparentTemperatureMaxTime: 1550271600

_msgid: "13ac9527.0ffc3b"

Response from Current Parse Icon

msg : Object

object

_msgid: "13ac9527.0ffc3b"

This is the response for Current (2)

object

payload: object

time: 1550254652

summary: "Light Snow"

icon: "snow"

nearestStormDistance: 0

precipIntensity: 0.005

precipIntensityError: 0.001

precipProbability: 1

precipType: "snow"

temperature: 9.35

apparentTemperature: -3.97

dewPoint: 0.1

humidity: 0.65

pressure: 1021.22

windSpeed: 9.5

windGust: 12.43

windBearing: 338

cloudCover: 0.7

uvIndex: 3

visibility: 3.91

ozone: 319.87

_msgid: "d99e9151.c229f"

Darksy debug output (1)

object

topic: "0"

_msgid: "12fca3ea.01656c"

payload: object

weather: "snow"

detail: "Heavy snow (2ā€“5 in.) starting in the evening."

humidity: 0.78

maxtemp: 26.65

mintemp: 5.2

windspeed: 6.61

winddirection: 67

lat: 40.936976

lon: -92.399148

clouds: 0.51

precipitation: 0.25

sunrise: 1550322234

sunset: 1550360775

units: "us"

location: object

data: object

latitude: 40.936976

longitude: -92.399148

timezone: "America/Chicago"

currently: object

time: 1550254827

summary: "Light Snow"

icon: "snow"

nearestStormDistance: 0

precipIntensity: 0.006

precipIntensityError: 0

precipProbability: 1

precipType: "snow"

temperature: 9.44

apparentTemperature: -3.87

dewPoint: 0.18

humidity: 0.65

pressure: 1021.19

windSpeed: 9.51

windGust: 12.46

windBearing: 338

cloudCover: 0.71

uvIndex: 3

visibility: 3.98

ozone: 319.8

minutely: object

summary: "Light snow stopping in 35 min."

icon: "snow"

data: array[61]

hourly: object

summary: "Light snow later this afternoon."

icon: "snow"

data: array[49]

daily: object

summary: "Snow (6ā€“10 in.) today through Wednesday, with high temperatures rising to 36Ā°F next Friday."

icon: "snow"

data: array[8]

flags: object

offset: -6

time: "2019-02-16T06:00:00.000Z"

title: "Weather Forecast Information"

description: "Weather forecast information for: Sat Feb 16 2019 06:00:00 GMT+0000 (UTC) at coordinates

ok, so the response from the parse Icon node is fed into the ui_template node.

What part of the msg you are sending to the ui_template node are you trying to work with?

I'm not sure how this all works but shouldn't the flow be parsing the icon: "partly-cloudy-day" field. Then displaying the * wi-forecast-io-partly-cloudy-day: day-cloudy

Inside your ui_template node, you need something like;

<div style="display: flex;height: 100%;justify-content: center;align-items: center;">
<i class="fa-4x wi wi-darksky-{{msg.payload}}"></i>
</div>

...assuming that the icon field is parsed, and fed into the ui_template node as a msg.payload.

[{"id":"952825ce.eef7a8","type":"function","z":"a444a9ff.e7a408","name":"Icon","func":"const i = msg.payload.icon;\nnode.send({payload:i});","outputs":1,"noerr":0,"x":720,"y":690,"wires":[["c78f398f.03efe8"]]},{"id":"c78f398f.03efe8","type":"ui_template","z":"a444a9ff.e7a408","group":"304cf995.dc6556","name":"icon image","order":1,"width":"2","height":"2","format":"<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-4x wi wi-darksky-{{msg.payload}}\"></i>\n</div>","storeOutMessages":false,"fwdInMessages":true,"templateScope":"local","x":920,"y":690,"wires":[[]]},{"id":"304cf995.dc6556","type":"ui_group","z":"a444a9ff.e7a408","name":"Current Conditions","tab":"49e5ad81.6d6e24","order":1,"disp":true,"width":"6"},{"id":"49e5ad81.6d6e24","type":"ui_tab","z":"a444a9ff.e7a408","name":"weather","icon":"cloud","order":2,"disabled":false,"hidden":false}]