Solcast Dashboard

Please download the first flow which downloads the Solcast forecast. This is part two for displaying that in a nice chart format.

DEPENDANCIES

node-red-contrib-moment – This is used on the dash to provide a nice human statement about when the last URL update was. You can remove this without impacting anything.

multi-device-gauge-demo

[{"id":"2cfbade2503fd8f9","type":"tab","label":"Solcast Dash","disabled":false,"info":"","env":[]},{"id":"35c380bdbb8f3eaf","type":"function","z":"2cfbade2503fd8f9","name":"","func":"var fvalues=global.get(\"DailyTotal\");\nvar P10values=global.get(\"DailyTotalP10\");\nvar sensor1={period:\"12 Hours\",P10:P10values[0].toFixed(1),forecast:fvalues[0].toFixed(1)};\nvar sensor2={period:\"Day 1\",P10:P10values[1].toFixed(1),forecast:fvalues[1].toFixed(1)};\nvar sensor3={period:\"Day 2\",P10:P10values[2].toFixed(1),forecast:fvalues[2].toFixed(1)};\n//Removed day 3 as it often a part day due to rolling 72 hours and is confusing for folks\n//var sensor4={period:\"Day 3\",P10:P10values[3].toFixed(1),forecast:fvalues[3].toFixed(1)};\n//var arr=[sensor1,sensor2,sensor3,sensor4];\nvar arr=[sensor1,sensor2,sensor3];\nmsg.payload = arr;\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":360,"y":140,"wires":[["4478bf4c87a9330d"]]},{"id":"4d76e71a1c510dda","type":"inject","z":"2cfbade2503fd8f9","name":"Forecast Table","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payloadType":"date","x":150,"y":140,"wires":[["35c380bdbb8f3eaf"]]},{"id":"4478bf4c87a9330d","type":"ui_template","z":"2cfbade2503fd8f9","group":"1aa228b75e9ff226","name":"Day forecast","order":1,"width":"6","height":"3","format":"<b>Solar Forecast in KWH</b>\n<table id=\"table\" border=\"1\" align=\"center\">\n    <tr>\n\t<td align=\"right\">Period</td>\n\t<td align=\"right\">Worst</td>\n\t<td align=\"right\">Expected</td>\n</tr>\n <tbody>\n <tr ng-repeat=\"row in msg.payload\">\n   <td align=\"right\" ng-repeat=\"item in row\" >{{item}}</td>\n </tr>\n </tbody>\n</table>\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","className":"","x":570,"y":140,"wires":[[]]},{"id":"aa99751636bf557b","type":"inject","z":"2cfbade2503fd8f9","name":"","props":[{"p":"payload"}],"repeat":"60","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"pvobject.forecasts","payloadType":"global","x":170,"y":220,"wires":[["fe043aa04eb26849","67c64707d12fda52"]]},{"id":"7c651e2eee3f4c3d","type":"ui_chart","z":"2cfbade2503fd8f9","name":"Solar Forecast Test","group":"1aa228b75e9ff226","order":2,"width":0,"height":0,"label":"Solar Forecast Test","chartType":"line","legend":"true","xformat":"auto","interpolate":"linear","nodata":"","dot":false,"ymin":"","ymax":"","removeOlder":"72","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"useUTC":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"outputs":1,"useDifferentColor":false,"className":"","x":570,"y":260,"wires":[[]]},{"id":"fe043aa04eb26849","type":"function","z":"2cfbade2503fd8f9","name":"graph generate","func":"pv0=[];\npv1=[];\npv2=[];\n\n\nfor (var i = 0; i < msg.payload.length; i++) {\n    var d={};\n    var pvtime=new Date(msg.payload[i].period_end);\n    d={\"x\":pvtime,\"y\":msg.payload[i].pv_estimate};\n    pv0.push(d);\n    d={\"x\":pvtime,\"y\":msg.payload[i].pv_estimate10};\n    pv1.push(d);\n    d={\"x\":pvtime,\"y\":msg.payload[i].pv_estimate90};\n    pv2.push(d);\n}\n\n\nmsg.payload=[{\n\"series\": [\"Expected\",\"Pessimistic\",\"Optimistic\"],\n\"data\": [pv0,pv1,pv2],\n\"labels\": [\"Expected\",\"Pessimistic\",\"Optimistic\"]\n}]\nreturn msg;\n\n","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":340,"y":320,"wires":[["7c651e2eee3f4c3d","af1058dfb161b2d9"]]},{"id":"af1058dfb161b2d9","type":"debug","z":"2cfbade2503fd8f9","name":"out","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":550,"y":360,"wires":[]},{"id":"67c64707d12fda52","type":"debug","z":"2cfbade2503fd8f9","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":560,"y":200,"wires":[]},{"id":"82236748db8e89dd","type":"ui_text","z":"2cfbade2503fd8f9","group":"1aa228b75e9ff226","order":3,"width":0,"height":0,"name":"","label":"Solcast Status:","format":"{{msg.payload}}","layout":"row-center","className":"","x":640,"y":60,"wires":[]},{"id":"42c36c2d0a6481fe","type":"inject","z":"2cfbade2503fd8f9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SolCastStatus","payloadType":"global","x":160,"y":60,"wires":[["82236748db8e89dd"]]},{"id":"87787ddb75ed95be","type":"ui_text","z":"2cfbade2503fd8f9","group":"1aa228b75e9ff226","order":4,"width":0,"height":0,"name":"","label":"Solcast Last Fetch:","format":"{{msg.payload}}","layout":"row-center","className":"","x":650,"y":100,"wires":[]},{"id":"3f479ca2e65b4a02","type":"inject","z":"2cfbade2503fd8f9","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"1","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"SolCastLastFetch","payloadType":"global","x":170,"y":100,"wires":[["57171ada8997c968"]]},{"id":"57171ada8997c968","type":"moment","z":"2cfbade2503fd8f9","name":"","topic":"","input":"payload","inputType":"msg","inTz":"Australia/Sydney","adjAmount":0,"adjType":"days","adjDir":"add","format":"fromNow","locale":"POSIX","output":"payload","outputType":"msg","outTz":"Australia/Sydney","x":420,"y":100,"wires":[["87787ddb75ed95be"]]},{"id":"1aa228b75e9ff226","type":"ui_group","name":"Forecast","tab":"f19325ee9c986d94","order":2,"disp":true,"width":"6","collapse":false,"className":""},{"id":"f19325ee9c986d94","type":"ui_tab","name":"Summary","icon":"dashboard","order":1,"disabled":false,"hidden":false}]

Flow Info

Created 3 years, 2 months ago
Rating: 5 3

Owner

Actions

Rate:

Node Types

Core
  • debug (x2)
  • function (x2)
  • inject (x4)
Other
  • moment (x1)
  • tab (x1)
  • ui_chart (x1)
  • ui_group (x1)
  • ui_tab (x1)
  • ui_template (x1)
  • ui_text (x2)

Tags

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