How to connect openweathermap with the dashboard-gauge?


#1

I installed openweathermap and the dashboard for node-red, But the gauge display 0.
I want to display the current temperature from openweathermap with the dashboard-gauge.
I need to use the following objects from openweathermap: tempc, tempk, humidity, windspeed ...


#2

take a look at flows.nodered.org there are example flows there you can import


#3

Here's a flow one of my students created.
You will need to adjust some of the JavaScript (in the function block) to filter out the objects YOU need.

[{"id":"7756040a.e4dcc4","type":"inject","z":"223ea3e3.036484","name":"","topic":"","payload":"1","payloadType":"num","repeat":"900","crontab":"","once":true,"onceDelay":0.1,"x":270,"y":220,"wires":[["6483c1f5.92db"]]},{"id":"6483c1f5.92db","type":"openweathermap","z":"223ea3e3.036484","name":"","wtype":"current","lon":"","lat":"","city":"london","country":"UK","language":"en","x":450,"y":220,"wires":[["e1f8eb74.8c0cc8"]]},{"id":"e1f8eb74.8c0cc8","type":"function","z":"223ea3e3.036484","name":"","func":"var msg1 = { payload:msg.payload.temp_maxc };\nvar msg2 = { payload:msg.payload.tempc };\nvar msg3 = { payload:msg.payload.temp_minc };\nvar msg4 = { payload:msg.payload.description};\nvar msg5 = { payload:msg.payload.icon};\n\n\nreturn [ msg1, msg2, msg3, msg4, msg5 ];","outputs":5,"noerr":0,"x":630,"y":220,"wires":[["80648643.7eb57"],["e4405ef6.8c72c","26beab8e.19427c"],["840712d7.9039a8"],["2b6581e6.803236"],["4875ad8f.b1cf5c"]],"outputLabels":["Temp Max","Current Temp","Temp Min","Description","Weather icon"]},{"id":"80648643.7eb57","type":"ui_gauge","z":"223ea3e3.036484","name":"","group":"73138b98.ae8a04","order":11,"width":"4","height":"4","gtype":"gage","title":"Max temp","label":"units","format":"{{value}}","min":"-5","max":"40","colors":["#0080ff","#008080","#ca3838"],"seg1":"5","seg2":"25","x":840,"y":100,"wires":[]},{"id":"e4405ef6.8c72c","type":"ui_gauge","z":"223ea3e3.036484","name":"","group":"73138b98.ae8a04","order":11,"width":"4","height":"4","gtype":"gage","title":"Current temp","label":"units","format":"{{value}}","min":"-5","max":"40","colors":["#0080ff","#008040","#ca3838"],"seg1":"5","seg2":"25","x":850,"y":160,"wires":[]},{"id":"840712d7.9039a8","type":"ui_gauge","z":"223ea3e3.036484","name":"","group":"73138b98.ae8a04","order":11,"width":"4","height":"4","gtype":"gage","title":"Min temp","label":"units","format":"{{value}}","min":"-5","max":"40","colors":["#0080ff","#008080","#ca3838"],"seg1":"5","seg2":"25","x":840,"y":220,"wires":[]},{"id":"26beab8e.19427c","type":"ui_chart","z":"223ea3e3.036484","name":"","group":"c77f1dce.efe768","order":1,"width":"14","height":"8","label":"Temp in degrees C","chartType":"line","legend":"false","xformat":"HH:mm:ss","interpolate":"linear","nodata":"","dot":false,"ymin":"-5","ymax":"40","removeOlder":"4","removeOlderPoints":"","removeOlderUnit":"3600","cutout":0,"useOneColor":false,"colors":["#1f77b4","#aec7e8","#ff7f0e","#2ca02c","#98df8a","#d62728","#ff9896","#9467bd","#c5b0d5"],"useOldStyle":false,"x":870,"y":280,"wires":[[],[]]},{"id":"2b6581e6.803236","type":"ui_text","z":"223ea3e3.036484","group":"3a61e161.becb0e","order":2,"width":0,"height":0,"name":"","label":"","format":"{{msg.payload}}","layout":"row-left","x":830,"y":340,"wires":[]},{"id":"4875ad8f.b1cf5c","type":"ui_template","z":"223ea3e3.036484","group":"3a61e161.becb0e","name":"Weather icon","order":1,"width":"4","height":"4","format":"<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n<i class=\"fa-3x wi wi-owm-{{msg.payload}}\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"templateScope":"local","x":850,"y":400,"wires":[[]]},{"id":"73138b98.ae8a04","type":"ui_group","z":"","name":"Gauges","tab":"d37df474.8822c","order":1,"disp":true,"width":"6","collapse":false},{"id":"c77f1dce.efe768","type":"ui_group","z":"","name":"Chart","tab":"d37df474.8822c","order":2,"disp":true,"width":"14","collapse":false},{"id":"3a61e161.becb0e","type":"ui_group","z":"","name":"Description","tab":"d37df474.8822c","order":3,"disp":true,"width":"14","collapse":false},{"id":"d37df474.8822c","type":"ui_tab","z":"","name":"Weather","icon":"dashboard","disabled":false,"hidden":false}]