Dashboard 2.0 Webinar - Chart - FlowFuse

Flows from Dashboard 2.0 Webinar

Weather API to Chart for last 5 days

https://flowfuse.com/webinars/2023/dashboard-20/

[{"id":"0373dc403343d1e9","type":"inject","z":"40139fbc5192f74c","name":"","props":[{"p":"payload.lat","v":"34.8406","vt":"str"},{"p":"payload.lon","v":"-85.0427","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":90,"y":260,"wires":[["cd645d8ad0816f6b","b1fafb2a5f6a3eac"]]},{"id":"cd645d8ad0816f6b","type":"function","z":"40139fbc5192f74c","name":"function 1","func":"var lat = msg.payload.lat;\nvar lon = msg.payload.lon;\nconst days = 5\nmsg.url = `https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${lon}&hourly=temperature_2m,relativehumidity_2m,surface_pressure&temperature_unit=fahrenheit&windspeed_unit=mph&precipitation_unit=inch&timezone=America%2FNew_York&past_days=${days}&forecast_days=1`;\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":250,"y":260,"wires":[["6d7abaf088410600"]]},{"id":"6d7abaf088410600","type":"http request","z":"40139fbc5192f74c","name":"","method":"GET","ret":"obj","paytoqs":"ignore","url":"","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":410,"y":260,"wires":[["e3c72a9e84392ebd"]]},{"id":"e3c72a9e84392ebd","type":"function","z":"40139fbc5192f74c","name":"function 2","func":"var time = msg.payload.hourly.time;\n\nvar temp = msg.payload.hourly.temperature_2m;\nvar humidity = msg.payload.hourly.relativehumidity_2m;\nvar pressure = msg.payload.hourly.surface_pressure;\n\nvar data = [];\n\nfor (var i = 0; i < time.length; i++) {\n    data.push({\n        time: time[i],\n        temp: temp[i],\n        humidity: humidity[i],\n        pressure: pressure[i],\n    });\n}\n\nmsg.payload = data\n\nreturn msg;","outputs":1,"timeout":0,"noerr":0,"initialize":"","finalize":"","libs":[],"x":560,"y":260,"wires":[["41ef64f714b62abc","435503a904936e5c"]]},{"id":"41ef64f714b62abc","type":"debug","z":"40139fbc5192f74c","name":"debug 1","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":710,"y":180,"wires":[]},{"id":"81975d40eb6b2568","type":"change","z":"40139fbc5192f74c","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"[]","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":310,"y":400,"wires":[["f74e6e92619c4784"]]},{"id":"435503a904936e5c","type":"ui-chart","z":"40139fbc5192f74c","group":"e71a3317c8aaa474","name":"","label":"Historic Temperature","order":9007199254740991,"chartType":"line","category":"Temperature","categoryType":"msg","xAxisProperty":"time","xAxisPropertyType":"msg","yAxisProperty":"temp","xAxisType":"time","showLegend":true,"removeOlder":1,"removeOlderUnit":"3600","removeOlderPoints":"","colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"width":"6","height":"6","className":"","x":770,"y":260,"wires":[[]]},{"id":"b1fafb2a5f6a3eac","type":"junction","z":"40139fbc5192f74c","x":200,"y":400,"wires":[["81975d40eb6b2568"]]},{"id":"f74e6e92619c4784","type":"junction","z":"40139fbc5192f74c","x":520,"y":400,"wires":[["435503a904936e5c"]]},{"id":"e71a3317c8aaa474","type":"ui-group","name":"Sensors","page":"e4db8a5958754a61","width":"6","height":"1","order":-1,"disp":true,"className":""},{"id":"e4db8a5958754a61","type":"ui-page","name":"Data Visualiztion","ui":"20ae73d735a60fbc","path":"/","layout":"grid","theme":"074b315414230834","order":-1,"className":""},{"id":"20ae73d735a60fbc","type":"ui-base","name":"UI Name","path":"/dashboard"},{"id":"074b315414230834","type":"ui-theme","name":"Theme Name","colors":{"surface":"#ffffff","primary":"#0094ce","bgPage":"#eeeeee","groupBg":"#ffffff","groupOutline":"#cccccc"}}]

Flow Info

Created 1 year, 7 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • change (x1)
  • debug (x1)
  • function (x2)
  • http request (x1)
  • inject (x1)
Other

Tags

  • node-grey
  • Dashboard2.0
  • FlowFuse
  • ChartUI
  • HistoricWeather
  • Weather
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option