Is anybody familiar with creating a weather api in node-red please share a example
Here are all the file for openweathermap node which connects to openweathermap api node-red-web-nodes/openweathermap at master · node-red/node-red-web-nodes · GitHub
Sorry - this is too vague, and I got dibs on creativity at the moment!!
What do you mean by "Create a weather API"
APIs exists that you can query with Node RED
are you looking to host a public service powered by Node RED that people can query.
you need to be much clearer on your desires here.
"Create" would suggest you're looking to create your own service
Have moved this to General for the time being
I'm not sure if this is what you want/need but I wrote a weather display thing.
You need open-weather
(key needed)
It is a bit of a dog's breakfast as it still has some testing stuff.
But all in all it does a fairly good job of showing me the weather for the place selected.
THERE IS A SUBFLOW IN IT!
That does all the magic of decoding the weather and displaying the icons.
FOREIGN ICONS ARE USED ALSO!
Sorry, I am not good at documenting things.
[{"id":"9aaa840a.131cf8","type":"subflow","name":"Time Stamp","info":"**3 outputs. 1 - msg.payload holds the time. 2 - msg.time holds the time in a way to be used for reading time in a log file. 3 - outputs nsg.time in a format usable for file names**","category":"","in":[{"x":80,"y":100,"wires":[{"id":"6e2f05f9.3d8634"}]}],"out":[{"x":660,"y":180,"wires":[{"id":"6e2f05f9.3d8634","port":0},{"id":"df2d30dc.4a8ea","port":0}]},{"x":660,"y":230,"wires":[{"id":"6e2f05f9.3d8634","port":0},{"id":"4c048d86.0f87a4","port":0}]},{"x":660,"y":280,"wires":[{"id":"6e2f05f9.3d8634","port":0},{"id":"ebdb6996.ecdbd8","port":0}]}],"env":[],"color":"#FF8888","outputLabels":["For logging use","msg.time","For filename use"],"icon":"node-red/timer.svg"},{"id":"df2d30dc.4a8ea","type":"moment","z":"9aaa840a.131cf8","name":"","topic":"","input":"","inputType":"msg","inTz":"Australia/Sydney","adjAmount":0,"adjType":"days","adjDir":"add","format":"YYYY-MM-DD HH:mm:ss","locale":"en_AU","output":"","outputType":"msg","outTz":"Australia/Sydney","x":400,"y":180,"wires":[["ebdb6996.ecdbd8","c91e62d1.fa5ce"]]},{"id":"ebdb6996.ecdbd8","type":"string","z":"9aaa840a.131cf8","name":"","methods":[{"name":"replaceAll","params":[{"type":"str","value":":"},{"type":"str","value":""}]}],"prop":"payload","propout":"payload","object":"msg","objectout":"msg","x":450,"y":280,"wires":[[]]},{"id":"c91e62d1.fa5ce","type":"change","z":"9aaa840a.131cf8","name":"TOPIC","rules":[{"t":"move","p":"payload","pt":"msg","to":"time","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":230,"wires":[["4c048d86.0f87a4"]]},{"id":"820c4f44.982f38","type":"change","z":"9aaa840a.131cf8","name":"Save","rules":[{"t":"set","p":"origPayload","pt":"msg","to":"payload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":230,"y":140,"wires":[["8ebff2c7.232ed"]]},{"id":"4c048d86.0f87a4","type":"change","z":"9aaa840a.131cf8","name":"Get","rules":[{"t":"set","p":"payload","pt":"msg","to":"origPayload","tot":"msg","dc":true}],"action":"","property":"","from":"","to":"","reg":false,"x":450,"y":230,"wires":[[]]},{"id":"6e2f05f9.3d8634","type":"switch","z":"9aaa840a.131cf8","name":"check topic","property":"topic","propertyType":"msg","rules":[{"t":"eq","v":"TIMESTAMP","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":210,"y":100,"wires":[[],["820c4f44.982f38"]]},{"id":"8ebff2c7.232ed","type":"change","z":"9aaa840a.131cf8","name":"TimeStamp","rules":[{"t":"set","p":"payload","pt":"msg","to":"","tot":"date"}],"action":"","property":"","from":"","to":"","reg":false,"x":210,"y":180,"wires":[["df2d30dc.4a8ea"]]},{"id":"7510c12c.e93d4","type":"link in","z":"ae12fd.00ef75","name":"","links":["fb8f585d.fdb7d"],"x":3225,"y":2140,"wires":[["b6957a86.87808","b9fdd50.65d73a8"]]},{"id":"f46dccbc.746be8","type":"debug","z":"ae12fd.00ef75","name":"Local Readings error list","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":3570,"y":2190,"wires":[]},{"id":"970849c.7072a38","type":"ui_led","z":"ae12fd.00ef75","order":24,"group":"b96110.787fe6f","width":3,"height":1,"label":"","labelPlacement":"left","labelAlignment":"left","colorForValue":[{"color":"#ff0000","value":"false","valueType":"bool"},{"color":"#006400","value":"true","valueType":"bool"}],"allowColorForValueInMessage":false,"shape":"circle","showGlow":true,"name":"","x":3510,"y":2140,"wires":[]},{"id":"b6957a86.87808","type":"change","z":"ae12fd.00ef75","name":"red","rules":[{"t":"set","p":"payload","pt":"msg","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":3370,"y":2140,"wires":[["970849c.7072a38"]]},{"id":"5c27a69b.0a27e","type":"ui_button","z":"ae12fd.00ef75","name":"","group":"b96110.787fe6f","order":23,"width":3,"height":1,"passthru":false,"label":"Ack","tooltip":"","color":"","bgcolor":"grey","icon":"","payload":"lime","payloadType":"str","topic":"","x":3190,"y":2090,"wires":[["d8828567.a2563"]]},{"id":"d8828567.a2563","type":"change","z":"ae12fd.00ef75","name":"lime","rules":[{"t":"set","p":"payload","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":3370,"y":2090,"wires":[["970849c.7072a38"]]},{"id":"abbc2e08.011fe8","type":"inject","z":"ae12fd.00ef75","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2190,"y":1990,"wires":[["34af34ec.a0dc84"]]},{"id":"978901bd.727bb8","type":"openweathermap","z":"ae12fd.00ef75","name":"Thredbo","wtype":"current","lon":"","lat":"","city":"thredbo","country":"australia","language":"en","x":2520,"y":1990,"wires":[["60717333.11753c","c1733e91.0cac3","75b6fe29.ee6c38","e6f8e8f8.703aa8","d091d83.5a79fa8"]]},{"id":"edc156f7.93d31","type":"debug","z":"ae12fd.00ef75","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":2770,"y":1990,"wires":[]},{"id":"75b6fe29.ee6c38","type":"debug","z":"ae12fd.00ef75","name":"Weather","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload.weather","targetType":"msg","x":2780,"y":2050,"wires":[]},{"id":"4a4c7f9.76c338","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":11,"width":4,"height":1,"name":"","label":"Temperature:","format":"{{msg.payload.tempc}} C","layout":"row-spread","x":2800,"y":2490,"wires":[]},{"id":"67be1f42.555f28","type":"ui_template","z":"ae12fd.00ef75","group":"b96110.787fe6f","name":"","order":7,"width":3,"height":2,"format":"<div style=\"display: flex;height: 100%;justify-content: center;align-items: center;\">\n <i style=\"color:{{msg.colour}};\" class=\"{{msg.payload}} fa-4x\"></i>\n</div>","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"local","x":3220,"y":2030,"wires":[["59d5c490.215454"]]},{"id":"59d5c490.215454","type":"debug","z":"ae12fd.00ef75","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","targetType":"full","x":3360,"y":2030,"wires":[]},{"id":"906c3859.de82d8","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":6,"width":3,"height":2,"name":"","label":"Weather:","format":"{{data.weather[0].description}}","layout":"col-center","x":2790,"y":2440,"wires":[]},{"id":"f0ac37f6.ca29","type":"ui_button","z":"ae12fd.00ef75","name":"Reload","group":"b96110.787fe6f","order":4,"width":1,"height":1,"passthru":false,"label":"{{msg.icon}}","tooltip":"","color":"{{msg.font}}","bgcolor":"{{msg.background}}","icon":"","payload":"foo","payloadType":"str","topic":"","x":2360,"y":2040,"wires":[["34af34ec.a0dc84"]]},{"id":"34af34ec.a0dc84","type":"change","z":"ae12fd.00ef75","name":"Spin","rules":[{"t":"set","p":"icon","pt":"msg","to":"<i class=\"fa fa-refresh fa-spin\"></i>","tot":"str"},{"t":"set","p":"background","pt":"msg","to":"#333333","tot":"str"},{"t":"set","p":"font","pt":"msg","to":"red","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2350,"y":1990,"wires":[["978901bd.727bb8","f0ac37f6.ca29"]]},{"id":"60717333.11753c","type":"delay","z":"ae12fd.00ef75","name":"Delay","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":2475,"y":2040,"wires":[["72ea5a75.c48e64"]],"l":false},{"id":"72ea5a75.c48e64","type":"change","z":"ae12fd.00ef75","name":"no spin","rules":[{"t":"set","p":"icon","pt":"msg","to":"<i class=\"fa fa-refresh\"></i>","tot":"str"},{"t":"set","p":"background","pt":"msg","to":"#333333","tot":"str"},{"t":"set","p":"font","pt":"msg","to":"lime","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2190,"y":2040,"wires":[["f0ac37f6.ca29"]]},{"id":"6f172543.c87994","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":17,"width":3,"height":1,"name":"","label":"Humidity:","format":"{{payload.humidity}}%","layout":"row-spread","x":2790,"y":2680,"wires":[]},{"id":"c1733e91.0cac3","type":"link out","z":"ae12fd.00ef75","name":"","links":["afb68846.99bb","132b547f.678304","4f1a1449.ca8a74","cc8a2382.b8b4b8"],"x":2565,"y":2040,"wires":[]},{"id":"afb68846.99bb","type":"link in","z":"ae12fd.00ef75","name":"","links":["c1733e91.0cac3"],"x":2665,"y":2440,"wires":[["4a4c7f9.76c338","906c3859.de82d8","6f172543.c87994","484f4b4c.1d7b2c","47a8d4b8.e1582c","b20839eb.82f1b","2a13a780.e93248","edca1130.af9b88","393f9543.4419f2"]]},{"id":"484f4b4c.1d7b2c","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":14,"width":4,"height":1,"name":"","label":"QNH:","format":"{{data.main.pressure}} mB","layout":"row-spread","x":2780,"y":2590,"wires":[]},{"id":"e6f8e8f8.703aa8","type":"subflow:9aaa840a.131cf8","z":"ae12fd.00ef75","name":"","x":2780,"y":1920,"wires":[["72dc78ed.ecde1"],[],[]]},{"id":"72dc78ed.ecde1","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":5,"width":4,"height":1,"name":"","label":"Last updated","format":"{{msg.payload}}","layout":"col-center","x":2960,"y":1920,"wires":[]},{"id":"11ec7c4c.705c7c","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":18,"width":3,"height":1,"name":"","label":"Rain","format":"{{msg.payload}}","layout":"row-left","x":2960,"y":2720,"wires":[]},{"id":"47a8d4b8.e1582c","type":"change","z":"ae12fd.00ef75","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.main.pressure","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2780,"y":2640,"wires":[["91498ec8.eb4188"]]},{"id":"91498ec8.eb4188","type":"function","z":"ae12fd.00ef75","name":"","func":"var old = context.get(\"previous\") || 0;\nvar valueS = \"\";\nvar value = 0;\nif (msg.payload < old)\n{\n valueS = '<i <span class=\"material-icons\"> trending_down </span></i>';\n} else\nif (msg.payload > old)\n{\n valueS = '<i <span class=\"material-icons\"> trending_up </span></i>';\n} else\nif (msg.payload == old)\n{\n valueS = '<i <span class=\"material-icons\"> trending_flat </span></i>';\n}\ncontext.set(\"previous\",msg.payload);\n\nmsg.payload = valueS;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2970,"y":2640,"wires":[["a6b639dd.48c4f"]]},{"id":"a6b639dd.48c4f","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":15,"width":1,"height":1,"name":"Trending","label":"","format":"{{msg.payload}}","layout":"row-left","x":3160,"y":2640,"wires":[]},{"id":"b20839eb.82f1b","type":"change","z":"ae12fd.00ef75","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"msg.payload.tempc","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2780,"y":2540,"wires":[["1eea9b68.b28735"]]},{"id":"1eea9b68.b28735","type":"function","z":"ae12fd.00ef75","name":"","func":"var old = context.get(\"previous\") || 0;\nvar valueS = \"\";\nvar value = 0;\nif (msg.payload < old)\n{\n valueS = '<i <span class=\"material-icons\"> trending_down </span></i>';\n} else\nif (msg.payload > old)\n{\n valueS = '<i <span class=\"material-icons\"> trending_up </span></i>';\n} else\nif (msg.payload == old)\n{\n valueS = '<i <span class=\"material-icons\"> trending_flat </span></i>';\n}\ncontext.set(\"previous\",msg.payload);\n\nmsg.payload = valueS;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2970,"y":2540,"wires":[["3fdff002.8b9bd"]]},{"id":"3fdff002.8b9bd","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":12,"width":1,"height":1,"name":"Trending","label":"","format":"{{msg.payload}}","layout":"row-left","x":3160,"y":2540,"wires":[]},{"id":"edca1130.af9b88","type":"function","z":"ae12fd.00ef75","name":"","func":"var x = msg.data.wind.gust;\n\nif (x !== undefined)\n{\n msg.payload = msg.data.wind.speed + \" (gusting \" + msg.data.wind.gust + \")\";\n} else\n{\n msg.payload = msg.data.wind.speed;\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2790,"y":2840,"wires":[["ac06705a.384758"]]},{"id":"ac06705a.384758","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":21,"width":4,"height":1,"name":"Wind speed","label":"","format":" @ {{msg.payload}}","layout":"row-left","x":2980,"y":2840,"wires":[]},{"id":"2a13a780.e93248","type":"change","z":"ae12fd.00ef75","name":"set","rules":[{"t":"set","p":"payload","pt":"msg","to":"data.wind.deg","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":2780,"y":2800,"wires":[["ab148541.95f2a"]]},{"id":"8d6706ec.dfc9e","type":"function","z":"ae12fd.00ef75","name":"","func":"var direction = msg.payload;\n\nnode.warn(direction);\n\nif (direction > 338)\n{\n node.warn(\"N\");\n msg.payload = 'N';\n return msg;\n} else\nif (direction < 22)\n{\n node.warn(\"N\");\n msg.payload = 'N';\n return msg;\n} else\nif (direction >=22)\n{\n if (direction < 67)\n {\n node.warn(\"NE\")\n msg.payload = 'NE';\n return msg;\n } else\n if (direction < (67+45))\n {\n node.warn(\"E\")\n msg.payload = 'E';\n return msg;\n } else\n if (direction < (67 + 90))\n {\n node.warn(\"SE\")\n msg.payload = 'SE';\n return msg;\n } else\n if (direction < (67 + 90 + 45))\n {\n node.warn(\"S\")\n msg.payload = 'S';\n return msg;\n } else\n if (direction < (67 + 180))\n {\n node.warn(\"SW\")\n msg.payload = 'SW';\n return msg;\n } else\n node.warn(\"W\")\n msg.payload = 'W';\n return msg;\n}\n//return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2970,"y":2800,"wires":[["a3c2b164.129dc8"]]},{"id":"a3c2b164.129dc8","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":20,"width":3,"height":1,"name":"","label":"Wind: ","format":"{{msg.payload}}","layout":"row-spread","x":3150,"y":2800,"wires":[]},{"id":"ab148541.95f2a","type":"function","z":"ae12fd.00ef75","name":"","func":"var direction = msg.payload;\nif (direction > 338)\n{\n //node.warn(\"N\");\n msg.payload = 'N <span class=\"material-icons\"> south </span>';\n // <i <span class=\"material-icons\"> trending_down </span></i>\n return msg;\n} else\nif (direction < 22)\n{\n //node.warn(\"N\");\n msg.payload = 'N <i <span class=\"material-icons\"> south </span></i>';\n return msg;\n} else\nif (direction >=22)\n{\n if (direction < 67)\n {\n //node.warn(\"NE\")\n msg.payload = 'NE <i <span class=\"material-icons\"> south_west </span></i>';\n return msg;\n } else\n if (direction < (67+45))\n {\n //node.warn(\"E\")\n msg.payload = 'E <i <span class=\"material-icons\"> west </span></i>';\n return msg;\n } else\n if (direction < (67 + 90))\n {\n //node.warn(\"SE\")\n msg.payload = 'SE <i <span class=\"material-icons\"> north_west </span></i>';\n return msg;\n } else\n if (direction < (67 + 90 + 45))\n {\n //node.warn(\"S\")\n msg.payload = 'S <i <span class=\"material-icons\"> north </span></i>';\n return msg;\n } else\n if (direction < (67 + 180))\n {\n //node.warn(\"SW\")\n msg.payload = 'SW <i <span class=\"material-icons\"> north_east </span></i>';\n return msg;\n } else\n //node.warn(\"W\")\n msg.payload = 'W <i <span class=\"material-icons\"> east </span></i>';\n return msg;\n}\n//return msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2970,"y":2760,"wires":[["a3c2b164.129dc8"]]},{"id":"393f9543.4419f2","type":"function","z":"ae12fd.00ef75","name":"","func":"if (msg.data.rain === undefined)\n{\n msg.payload = \"clear\";\n} else\n{\n msg.payload = msg.data.rain[\"1h\"] + \" mm\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2790,"y":2720,"wires":[["11ec7c4c.705c7c","6c9bd7dd.795c58"]]},{"id":"6c9bd7dd.795c58","type":"debug","z":"ae12fd.00ef75","name":"Rain","active":true,"tosidebar":false,"console":false,"tostatus":true,"complete":"payload","targetType":"msg","statusVal":"payload","statusType":"auto","x":2960,"y":2680,"wires":[]},{"id":"91c1623a.30db1","type":"function","z":"ae12fd.00ef75","name":"","func":"//node.warn(\"Here\");\n\n//node.warn(msg.data.rain);\n\n//var x = msg.data.rain;\n\n//node.warn(x);\n\nif (msg.data.rain === undefined)\n{\n msg.payload = \"clear\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2340,"y":2120,"wires":[["4a845a2e.05ca8c"]]},{"id":"132b547f.678304","type":"link in","z":"ae12fd.00ef75","name":"","links":["c1733e91.0cac3"],"x":2225,"y":2120,"wires":[["91c1623a.30db1"]]},{"id":"9e2df0fe.8a6c5","type":"inject","z":"ae12fd.00ef75","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2180,"y":2170,"wires":[["91c1623a.30db1"]]},{"id":"4a845a2e.05ca8c","type":"debug","z":"ae12fd.00ef75","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":2520,"y":2120,"wires":[]},{"id":"2d827603.3d9802","type":"function","z":"ae12fd.00ef75","name":"","func":"var old = context.get(\"previous\") || 0;\nvar valueS = \"\";\nvar value = 0;\nif (msg.payload < old)\n{\n valueS = '<i class=\"fa fa-long-arrow-down\"></i>';\n} else\nif (msg.payload > old)\n{\n valueS = '<i class=\"fa fa-long-arrow-up\"></i>';\n} else\nif (msg.payload == old)\n{\n valueS = '<i class=\"fa fa-long-arrow-right\"></i>';\n}\ncontext.set(\"previous\",msg.payload);\n\nmsg.payload = valueS;\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2970,"y":2500,"wires":[[]]},{"id":"fb8f585d.fdb7d","type":"link out","z":"ae12fd.00ef75","name":"","links":["7510c12c.e93d4"],"x":2915,"y":2370,"wires":[]},{"id":"b5c8fc5.cc809","type":"link in","z":"ae12fd.00ef75","name":"Thredbo weather update","links":["629ed33a.9df88c","9e0c78f26d36c644","d9172fcb.134e48"],"x":2235,"y":1950,"wires":[["34af34ec.a0dc84"]]},{"id":"1db83736.572be9","type":"ui_text","z":"ae12fd.00ef75","group":"b96110.787fe6f","order":10,"width":4,"height":1,"name":"","label":"Cloud coverage","format":"{{msg.payload}}","layout":"row-spread","x":3160,"y":2270,"wires":[]},{"id":"f44803d1.1a7a28","type":"function","z":"ae12fd.00ef75","name":"Cloud","func":"let x = msg.payload;\nif (x == 0)\n{\n msg.payload = \"Clear\";\n return msg;\n} else\n{\n msg.payload = msg.payload + \" %\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":3010,"y":2270,"wires":[["1db83736.572be9"]]},{"id":"4f6965f8.730094","type":"function","z":"ae12fd.00ef75","name":"Set colour","func":"if (msg.colour == undefined)\n{\n msg.colour = \"white\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":3070,"y":2030,"wires":[["67be1f42.555f28"]]},{"id":"f1ce52bf.1a0e58","type":"debug","z":"ae12fd.00ef75","name":"WIND DETECTED","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":3060,"y":2140,"wires":[]},{"id":"9e199af4.bf4058","type":"debug","z":"ae12fd.00ef75","name":"Context set","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":3060,"y":2330,"wires":[]},{"id":"d091d83.5a79fa8","type":"change","z":"ae12fd.00ef75","name":"Wind stuff","rules":[{"t":"set","p":"base.wind.light","pt":"msg","to":"base.wind.light","tot":"flow"},{"t":"set","p":"base.wind.strong","pt":"msg","to":"base.wind.strong","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":2510,"y":2170,"wires":[["edc156f7.93d31","ff254400.7dedb8","c1181362.940e1"]]},{"id":"d7e10729.cd868","type":"inject","z":"ae12fd.00ef75","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":3350,"y":1980,"wires":[["970849c.7072a38"]]},{"id":"7542d04.a30f5b","type":"inject","z":"ae12fd.00ef75","name":"RESET","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"reset","payloadType":"str","x":3190,"y":2230,"wires":[["b9fdd50.65d73a8"]],"icon":"font-awesome/fa-eject"},{"id":"89abbf46.3ec98","type":"inject","z":"ae12fd.00ef75","name":"Next","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"trigger","payloadType":"str","x":3190,"y":2190,"wires":[["b9fdd50.65d73a8"]],"icon":"node-red/trigger.svg"},{"id":"b9fdd50.65d73a8","type":"q-gate","z":"ae12fd.00ef75","name":"qgate","controlTopic":"CONTROL","defaultState":"queueing","openCmd":"Go","closeCmd":"Stop","toggleCmd":"toggle","queueCmd":"queue","defaultCmd":"default","triggerCmd":"trigger","flushCmd":"flush","resetCmd":"reset","peekCmd":"","dropCmd":"","statusCmd":"","maxQueueLength":"50","keepNewest":true,"qToggle":false,"persist":false,"x":3370,"y":2190,"wires":[["f46dccbc.746be8"]]},{"id":"e53d4fda.a88588","type":"comment","z":"ae12fd.00ef75","name":"Bad messages","info":"{\"payload\":{\"id\":601,\"weather\":\"Snow\",\"detail\":\"snow\",\"icon\":\"13d\",\"tempk\":272.02,\"tempc\":-1.1,\"temp_maxc\":-1.1,\"temp_minc\":-1.1,\"humidity\":100,\"pressure\":1016,\"maxtemp\":272.02,\"mintemp\":272.02,\"windspeed\":3.09,\"winddirection\":30,\"location\":\"Cooma\",\"sunrise\":1626642594,\"sunset\":1626678551,\"clouds\":100,\"description\":\"The weather in Cooma at coordinates: -36.2333, 149.1333 is Snow (snow).\"},\"event\":{\"clientX\":975,\"clientY\":198,\"bbox\":[947,225,995,177]},\"socketid\":\"avA216tBMV5ZI5RaAABP\",\"_msgid\":\"9d70a7b.edae058\",\"icon\":\"<i class=\\\"fa fa-refresh fa-spin\\\"></i>\",\"background\":\"#333333\",\"font\":\"red\",\"location\":{\"lon\":149.1333,\"lat\":-36.2333,\"city\":\"Cooma\",\"country\":\"AU\"},\"data\":{\"coord\":{\"lon\":149.1333,\"lat\":-36.2333},\"weather\":[{\"id\":601,\"main\":\"Snow\",\"description\":\"snow\",\"icon\":\"13d\"}],\"base\":\"stations\",\"main\":{\"temp\":272.02,\"feels_like\":268.21,\"temp_min\":272.02,\"temp_max\":272.02,\"pressure\":1016,\"humidity\":100},\"visibility\":10000,\"wind\":{\"speed\":3.09,\"deg\":30},\"snow\":{\"1h\":0.87},\"clouds\":{\"all\":100},\"dt\":1626647713,\"sys\":{\"type\":1,\"id\":9520,\"country\":\"AU\",\"sunrise\":1626642594,\"sunset\":1626678551},\"timezone\":36000,\"id\":2170577,\"name\":\"Cooma\",\"cod\":200},\"time\":\"2021-07-18T22:35:13.000Z\",\"title\":\"Current Weather Information\",\"description\":\"Current weather information at coordinates: -36.2333, 149.1333\",\"base\":{\"wind\":{\"light\":10,\"strong\":40}},\"_event\":\"node:1ac83a63.8be8e6\"}","x":3480,"y":2290,"wires":[]},{"id":"835e3509.4f4818","type":"inject","z":"ae12fd.00ef75","name":"TEST","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2190,"y":2250,"wires":[["ca1cc897.dab5"]]},{"id":"ca1cc897.dab5","type":"function","z":"ae12fd.00ef75","name":"","func":"msg = \n{\"payload\":{\"id\":803,\"weather\":\"Clouds\",\"detail\":\"broken clouds\",\"icon\":\"04d\",\"tempk\":276.26,\"tempc\":3.1,\"temp_maxc\":3.1,\"temp_minc\":3.1,\"humidity\":88,\"pressure\":1018,\"maxtemp\":276.26,\"mintemp\":276.26,\"windspeed\":2.01,\"winddirection\":235,\"location\":\"Thredbo\",\"sunrise\":1626815559,\"sunset\":1626851594,\"clouds\":74,\"description\":\"The weather in Thredbo at coordinates: -36.5, 148.3167 is Clouds (broken clouds).\"},\"topic\":\"\",\"icon\":\"<i class=\\\"fa fa-refresh fa-spin\\\"></i>\",\"background\":\"#333333\",\"font\":\"red\",\"location\":{\"lon\":148.3167,\"lat\":-36.5,\"city\":\"Thredbo\",\"country\":\"AU\"},\"data\":{\"coord\":{\"lon\":148.3167,\"lat\":-36.5},\"weather\":[{\"id\":803,\"main\":\"Clouds\",\"description\":\"broken clouds\",\"icon\":\"04d\"}],\"base\":\"stations\",\"main\":{\"temp\":276.26,\"feels_like\":274.31,\"temp_min\":276.26,\"temp_max\":276.26,\"pressure\":1018,\"humidity\":88,\"sea_level\":1018,\"grnd_level\":860},\"visibility\":10000,\"wind\":{\"speed\":2.01,\"deg\":235,\"gust\":3.96},\"clouds\":{\"all\":74},\"dt\":1626839051,\"sys\":{\"type\":1,\"id\":9520,\"country\":\"AU\",\"sunrise\":1626815559,\"sunset\":1626851594},\"timezone\":36000,\"id\":2146760,\"name\":\"Thredbo\",\"cod\":200},\"time\":\"2021-07-21T03:44:11.000Z\",\"title\":\"Current Weather Information\",\"description\":\"Current weather information at coordinates: -36.5, 148.3167\",\"base\":{\"wind\":{\"light\":10,\"strong\":40}}}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2350,"y":2250,"wires":[["d091d83.5a79fa8"]]},{"id":"c10f872a.2be058","type":"inject","z":"ae12fd.00ef75","name":"Clear night","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"wi wi-darksky-clear-night","payloadType":"str","x":3140,"y":1920,"wires":[["4f6965f8.730094"]]},{"id":"2c8a9f36.1060c8","type":"inject","z":"ae12fd.00ef75","name":"Snow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"wi wi-snow","payloadType":"str","x":3130,"y":1970,"wires":[["4f6965f8.730094"]]},{"id":"1dc3f25.3ae370e","type":"function","z":"ae12fd.00ef75","name":"","func":"msg = \n{\"payload\":{\"id\":601,\"weather\":\"Snow\",\"detail\":\"snow\",\"icon\":\"13d\",\"tempk\":272.02,\"tempc\":-1.1,\"temp_maxc\":-1.1,\"temp_minc\":-1.1,\"humidity\":100,\"pressure\":1016,\"maxtemp\":272.02,\"mintemp\":272.02,\"windspeed\":3.09,\"winddirection\":30,\"location\":\"Cooma\",\"sunrise\":1626642594,\"sunset\":1626678551,\"clouds\":100,\"description\":\"The weather in Cooma at coordinates: -36.2333, 149.1333 is Snow (snow).\"},\"event\":{\"clientX\":975,\"clientY\":198,\"bbox\":[947,225,995,177]},\"socketid\":\"avA216tBMV5ZI5RaAABP\",\"_msgid\":\"9d70a7b.edae058\",\"icon\":\"<i class=\\\"fa fa-refresh fa-spin\\\"></i>\",\"background\":\"#333333\",\"font\":\"red\",\"location\":{\"lon\":149.1333,\"lat\":-36.2333,\"city\":\"Cooma\",\"country\":\"AU\"},\"data\":{\"coord\":{\"lon\":149.1333,\"lat\":-36.2333},\"weather\":[{\"id\":601,\"main\":\"Snow\",\"description\":\"snow\",\"icon\":\"13d\"}],\"base\":\"stations\",\"main\":{\"temp\":272.02,\"feels_like\":268.21,\"temp_min\":272.02,\"temp_max\":272.02,\"pressure\":1016,\"humidity\":100},\"visibility\":10000,\"wind\":{\"speed\":3.09,\"deg\":30},\"snow\":{\"1h\":0.87},\"clouds\":{\"all\":100},\"dt\":1626647713,\"sys\":{\"type\":1,\"id\":9520,\"country\":\"AU\",\"sunrise\":1626642594,\"sunset\":1626678551},\"timezone\":36000,\"id\":2170577,\"name\":\"Cooma\",\"cod\":200},\"time\":\"2021-07-18T22:35:13.000Z\",\"title\":\"Current Weather Information\",\"description\":\"Current weather information at coordinates: -36.2333, 149.1333\",\"base\":{\"wind\":{\"light\":10,\"strong\":40}},\"_event\":\"node:1ac83a63.8be8e6\"}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":3130,"y":1850,"wires":[["4f6965f8.730094"]]},{"id":"39d21198.d3022e","type":"inject","z":"ae12fd.00ef75","name":"TEST","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2970,"y":1850,"wires":[["1dc3f25.3ae370e"]]},{"id":"c3af134e.08cce","type":"inject","z":"ae12fd.00ef75","name":"Snow","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"wi wi-darksky-snow","payloadType":"str","x":3310,"y":1900,"wires":[["4f6965f8.730094"]]},{"id":"ff254400.7dedb8","type":"link out","z":"ae12fd.00ef75","name":"INPUT","links":["25956abb.6db9ce","73ffcaa4.30a5bc","9ac538e5.6701a","58433a2d.f4c25c"],"x":2590,"y":2340,"wires":[],"l":true},{"id":"25956abb.6db9ce","type":"link in","z":"ae12fd.00ef75","name":"","links":["ff254400.7dedb8"],"x":2705,"y":2340,"wires":[[]]},{"id":"556bd663.c1b35","type":"link out","z":"ae12fd.00ef75","name":"","links":["cd0d6b8.6b56798","9b760911.860b6"],"x":2915,"y":1990,"wires":[]},{"id":"cd0d6b8.6b56798","type":"link in","z":"ae12fd.00ef75","name":"","links":["556bd663.c1b35","30c3ff01.889ed8","5c33252b.d3f2f4","a3d1bf56.8acfe8","e7d3528d.cc76f","98bc322e.3bb2c","ea72a4a0.2bde","a79e5c3e.efadf8","4d65ea37.c35194","c9e41962.8127a","dbab3687.faff7","ed5d8f77.e18c18","c5bc662c.f21f88","947f14dd.e79c38","e54db274.3b0b5","c158e029.f1b3d8","9d6dec14.e64228","b5322830.b25a68","422d0972.609948","67e716df.d5a028","673041e2.73aab8","5026004d.75203","d7a52139.0cf928"],"x":2915,"y":2030,"wires":[["4f6965f8.730094"]]},{"id":"612feb2.f42c994","type":"inject","z":"ae12fd.00ef75","name":"A","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"CONTROL","payload":"STOP","payloadType":"str","x":2520,"y":2230,"wires":[["c1181362.940e1","d90a017c.089ec8"]]},{"id":"86529db6.12cee","type":"inject","z":"ae12fd.00ef75","name":"B","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":"1","topic":"CONTROL","payload":"GO","payloadType":"str","x":2520,"y":2270,"wires":[["c1181362.940e1","d90a017c.089ec8"]]},{"id":"d90a017c.089ec8","type":"link out","z":"ae12fd.00ef75","name":"","links":["702da384.629c1c","456bf8fb.f19678","ce886fd6.a4a368"],"x":2645,"y":2230,"wires":[]},{"id":"c1181362.940e1","type":"gate","z":"ae12fd.00ef75","name":"B","controlTopic":"CONTROL","defaultState":"open","openCmd":"GO","closeCmd":"STOP","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"","persist":false,"x":2650,"y":2170,"wires":[["d4617a12.405fe8"]]},{"id":"cdf2a7a8.730928","type":"change","z":"ae12fd.00ef75","name":"Unknown Icon","rules":[{"t":"set","p":"payload","pt":"msg","to":"fa fa-question-circle ","tot":"str"},{"t":"set","p":"colour","pt":"msg","to":"blue","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2915,"y":2330,"wires":[["4f6965f8.730094"]],"l":false},{"id":"24bd657e.1a8b52","type":"inject","z":"ae12fd.00ef75","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":2780,"y":2310,"wires":[["cdf2a7a8.730928"]]},{"id":"b96110.787fe6f","type":"ui_group","name":"Mountains","tab":"de0f6b36.132fa8","order":5,"disp":true,"width":"8","collapse":false},{"id":"de0f6b36.132fa8","type":"ui_tab","name":"Weather","icon":"dashboard","order":10,"disabled":false,"hidden":false}]
Hope this may help with your quest.
As it is so big:
The above is the flow, the SUBFLOW is next.
The SUBFLOW
[{"id":"10fde8b5.a8a82f","type":"subflow","name":"Weather","info":"1 11 2020\nA lot better.\nIcons working as expected.\nThough more testing is needed.\n\nPut in option to set `msg.colour` but not\nimplimented yet.\n\n\n\nSecret stuff\nd8f8c3e28e887076433ae31e5b78a45b","category":"","in":[{"x":540,"y":240,"wires":[{"id":"82fafc1a.b3e21"},{"id":"e779ead8.7386e8"},{"id":"3beba12.b00ef5e"}]}],"out":[{"x":2350,"y":260,"wires":[{"id":"3cb516b6.5757a2","port":0},{"id":"7fb1a81d.4da6a","port":0}]},{"x":2350,"y":370,"wires":[{"id":"e7a1c497.51056","port":0},{"id":"c35495e6.e376e","port":0}]},{"x":2350,"y":530,"wires":[{"id":"4af57184.36b928","port":0},{"id":"e013d5fa.259aa8","port":0}]},{"x":2350,"y":760,"wires":[{"id":"56758975.26f77","port":0},{"id":"16427981.3398f6","port":0},{"id":"c67bbc79.6116a8","port":0},{"id":"8bbff73b.e2e4a","port":0},{"id":"b12861e9.c712c","port":0},{"id":"bd087fda.40cab8","port":0},{"id":"2d19f161.e486b6","port":0}]},{"x":2350,"y":1080,"wires":[{"id":"c125972d.f52058","port":0},{"id":"8eb3fc7c.41e288","port":0},{"id":"4fba7468.c48934","port":0},{"id":"b4b37e81.224e8","port":0}]},{"x":2350,"y":1240,"wires":[{"id":"96598146.3bee48","port":0},{"id":"ad18fd86.0823d8","port":0},{"id":"e1d34ac8.0443f8","port":0}]},{"x":2350,"y":1510,"wires":[{"id":"ba81b366.5f6f1","port":0},{"id":"222bebf1.8372cc","port":0}]},{"x":2350,"y":1700,"wires":[{"id":"c790fb1.e0ea508","port":0},{"id":"b1591fa0.61913","port":0}]},{"x":2350,"y":1820,"wires":[{"id":"627e497555a10c5c","port":0}]},{"x":2350,"y":2410,"wires":[{"id":"3347e292.2479fe","port":0}]},{"x":2350,"y":2460,"wires":[]},{"x":2350,"y":2510,"wires":[{"id":"131947f4.de572","port":0}]},{"x":2350,"y":2560,"wires":[{"id":"6c63bf11.09bb5","port":0}]},{"x":2350,"y":2610,"wires":[{"id":"24151a93.78a12e","port":0}]}],"env":[],"meta":{},"color":"#87A980","outputLabels":["Thunderstorms","Hail","Fog","Rain","Cloudy","Partly cloudy","Fair","Snow","Overcast","TEMP FOR WIND","Intensity of rain","If you want to see the msg.icon","Cloud % coverage","Icon not found"],"icon":"font-awesome/fa-snowflake-o"},{"id":"3cb516b6.5757a2","type":"change","z":"10fde8b5.a8a82f","name":"Day thunderstorm","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-thunderstorm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2060,"y":260,"wires":[["f66104d5.41ab7"]]},{"id":"e7a1c497.51056","type":"change","z":"10fde8b5.a8a82f","name":"Day hail","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-hail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":370,"wires":[["7ee3a01.855406"]]},{"id":"4af57184.36b928","type":"change","z":"10fde8b5.a8a82f","name":"Day fog","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-fog","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":530,"wires":[["ab299ec2.2bd1c"]]},{"id":"8eb3fc7c.41e288","type":"change","z":"10fde8b5.a8a82f","name":"Day cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-cloudy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1060,"wires":[["7e2dd661.f9e88"]]},{"id":"96598146.3bee48","type":"change","z":"10fde8b5.a8a82f","name":"Partly cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-darksky-partly-cloudy-day","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1260,"wires":[["c9ce0127.1b2fc8"]]},{"id":"8b807984.d95c08","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":1240,"wires":[["ad18fd86.0823d8"],["ad18fd86.0823d8"],["96598146.3bee48"]]},{"id":"a54320a9.77d538","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":1280,"wires":[[]]},{"id":"5cdd808a.0d6db8","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":1040,"wires":[["c125972d.f52058"],["c125972d.f52058"],["8eb3fc7c.41e288"]]},{"id":"8a604f63.d8f88","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":1080,"wires":[[]]},{"id":"c125972d.f52058","type":"change","z":"10fde8b5.a8a82f","name":"Night cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-cloudy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1020,"wires":[["7e2dd661.f9e88"]]},{"id":"ad18fd86.0823d8","type":"change","z":"10fde8b5.a8a82f","name":"Partly cloudy (night)","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-cloudy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2070,"y":1220,"wires":[["c9ce0127.1b2fc8"]]},{"id":"2c42bafb.9ca7ce","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":1510,"wires":[["222bebf1.8372cc"],["222bebf1.8372cc"],["ba81b366.5f6f1"]]},{"id":"a03caa10.ce83c","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":1550,"wires":[[]]},{"id":"ba81b366.5f6f1","type":"change","z":"10fde8b5.a8a82f","name":"Clear","rules":[{"t":"set","p":"payload","pt":"msg","to":" wi wi-darksky-clear-day","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2020,"y":1530,"wires":[["14ffc572.d3c78b"]]},{"id":"222bebf1.8372cc","type":"change","z":"10fde8b5.a8a82f","name":"Clear (night)","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-darksky-clear-night","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1490,"wires":[["14ffc572.d3c78b"]]},{"id":"6abc41b9.d7ed4","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":770,"wires":[["16427981.3398f6"],["16427981.3398f6"],["56758975.26f77"]]},{"id":"98a4215b.6a1ef","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":810,"wires":[[]]},{"id":"ac0a4b73.7bbd28","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":510,"wires":[["e013d5fa.259aa8"],["e013d5fa.259aa8"],["4af57184.36b928"]]},{"id":"68a9f25b.562674","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":550,"wires":[[]]},{"id":"19bf43c4.a1f91c","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":350,"wires":[["c35495e6.e376e"],["c35495e6.e376e"],["e7a1c497.51056"]]},{"id":"7dcb52ec.d340d4","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":390,"wires":[[]]},{"id":"8950e243.826b18","type":"comment","z":"10fde8b5.a8a82f","name":"Cloudy","info":"","x":1450,"y":1050,"wires":[]},{"id":"9a371d8e.bd503","type":"comment","z":"10fde8b5.a8a82f","name":"Partly cloudy","info":"","x":1460,"y":1240,"wires":[]},{"id":"c0dbdccf.92a498","type":"comment","z":"10fde8b5.a8a82f","name":"Clear","info":"","x":1580,"y":1510,"wires":[]},{"id":"1ef67c01.68b0d4","type":"comment","z":"10fde8b5.a8a82f","name":"Unknown icon","info":"","x":2460,"y":2610,"wires":[]},{"id":"9995f9a.5649308","type":"comment","z":"10fde8b5.a8a82f","name":"Fog","info":"","x":1580,"y":510,"wires":[]},{"id":"1f48c831.b9d5d","type":"comment","z":"10fde8b5.a8a82f","name":"Hail","info":"","x":1580,"y":350,"wires":[]},{"id":"7a592206.adfa7c","type":"comment","z":"10fde8b5.a8a82f","name":"T Storms","info":"","x":1590,"y":240,"wires":[]},{"id":"a206a1b0.6c1ae","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":240,"wires":[["7fb1a81d.4da6a"],["7fb1a81d.4da6a"],["3cb516b6.5757a2"]]},{"id":"1ef5916f.d41457","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":280,"wires":[[]]},{"id":"f4d9cd97.9a244","type":"comment","z":"10fde8b5.a8a82f","name":"Rain","info":"","x":1700,"y":680,"wires":[]},{"id":"56758975.26f77","type":"change","z":"10fde8b5.a8a82f","name":"Day rain","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-rain","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":790,"wires":[["1e77d751.41fac9"]]},{"id":"16427981.3398f6","type":"change","z":"10fde8b5.a8a82f","name":"Night rain","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-rain","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":750,"wires":[["1e77d751.41fac9"]]},{"id":"736e32dd.75a544","type":"function","z":"10fde8b5.a8a82f","name":"/ 1000","func":"let now = parseInt(msg.now/1000);\nmsg.now = now;\n//node.warn(\"Now \" + now);\n\n//node.warn(\"Detail: \" + msg.payload.detail);\n\nlet wind = msg.payload.windspeed;\nnode.status({text:wind});\n\n//let low = flow.get(\"$parent.base.wind.light\");\n//let strong = flow.get(\"base.wind.strong\");\nlet low = msg.base.wind.light;\nlet strong = msg.base.wind.strong;\n\n\nif (wind < low)\n{\n flow.set(\"windstrength\",\"NO\");\n node.status({text:\"NO\"});\n} else\nif (wind < strong)\n{\n flow.set(\"windstrength\",\"LIGHT\");\n node.status({text:\"LIGHT\"});\n} else\nif (wind > strong)\n{\n flow.set(\"windstrength\",\"STRONG\");\n node.status({text:\"STRONG\"});\n}\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":960,"y":240,"wires":[["977d76d85591988e"]]},{"id":"b6c0418c.e3f6a8","type":"change","z":"10fde8b5.a8a82f","name":"now and clouds","rules":[{"t":"set","p":"now","pt":"msg","to":"","tot":"date"},{"t":"set","p":"CloudCoverage","pt":"flow","to":"msg.data.clouds.all","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":740,"y":240,"wires":[["736e32dd.75a544","29732b22.a849bc"]]},{"id":"3f65d757.5766","type":"function","z":"10fde8b5.a8a82f","name":"","func":"//node.warn(\"here\");\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1735,"y":240,"wires":[["a206a1b0.6c1ae","1ef5916f.d41457","efea611bd2cb6d6c"]],"l":false},{"id":"b7b5b9b9.375af8","type":"function","z":"10fde8b5.a8a82f","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1735,"y":350,"wires":[["19bf43c4.a1f91c","7dcb52ec.d340d4"]],"l":false},{"id":"6173fca5.92bfec","type":"function","z":"10fde8b5.a8a82f","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1735,"y":510,"wires":[["ac0a4b73.7bbd28","68a9f25b.562674"]],"l":false},{"id":"d475af60.586248","type":"function","z":"10fde8b5.a8a82f","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":1595,"y":1240,"wires":[["a54320a9.77d538","441775b8.3d05c4"]],"l":false},{"id":"6c63bf11.09bb5","type":"change","z":"10fde8b5.a8a82f","name":"Clouds","rules":[{"t":"set","p":"payload","pt":"msg","to":"payload.clouds","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1850,"y":2550,"wires":[[]]},{"id":"7fb1a81d.4da6a","type":"change","z":"10fde8b5.a8a82f","name":"Night thunderstorm","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-thunderstorm","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2060,"y":220,"wires":[["f66104d5.41ab7"]]},{"id":"c35495e6.e376e","type":"change","z":"10fde8b5.a8a82f","name":"Night hail","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-hail","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":330,"wires":[["7ee3a01.855406"]]},{"id":"e013d5fa.259aa8","type":"change","z":"10fde8b5.a8a82f","name":"Night fog","rules":[{"t":"set","p":"payload","pt":"msg","to":" wi wi-night-fog","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":490,"wires":[["ab299ec2.2bd1c"]]},{"id":"e3725a0e.43adb8","type":"ui_template","z":"10fde8b5.a8a82f","group":"d141f99f.9e6318","name":"Icons","order":7,"width":0,"height":0,"format":"<link href=\"https://fonts.googleapis.com/icon?family=Material+Icons\" rel=\"stylesheet\">\n<i class=\"wi wi-wu-nt_flurries\"></i>\n<link href=\"https://cdnjs.cloudflare.com/ajax/libs/weather-icons/2.0.10/css/weather-icons.min.css\" rel=\"stylesheet\">\n","storeOutMessages":true,"fwdInMessages":true,"resendOnRefresh":true,"templateScope":"global","className":"","x":960,"y":170,"wires":[[]]},{"id":"131947f4.de572","type":"template","z":"10fde8b5.a8a82f","name":"Icon","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"<i class=\"wi wi-owm-{{payload.icon}}\"></i>","output":"str","x":1840,"y":2500,"wires":[[]]},{"id":"ec9203a5.91ceb8","type":"comment","z":"10fde8b5.a8a82f","name":"If you want to use the `icon` field","info":"","x":2520,"y":2510,"wires":[]},{"id":"a311f142.a12ba","type":"comment","z":"10fde8b5.a8a82f","name":"Needs work *","info":"This is now for ALL cloudy stuff.\n\nSo partly, broken and scattered are also in here","x":1300,"y":1050,"wires":[]},{"id":"1574d141.436ff7","type":"switch","z":"10fde8b5.a8a82f","name":"Type","property":"payload.detail","propertyType":"msg","rules":[{"t":"cont","v":"broken","vt":"str"},{"t":"cont","v":"scattered","vt":"str"},{"t":"cont","v":"partly","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":4,"x":1450,"y":1110,"wires":[["d475af60.586248"],["d475af60.586248"],["d475af60.586248"],["b3316a43.ffa098"]]},{"id":"22880cb5.690604","type":"comment","z":"10fde8b5.a8a82f","name":"Cloud coverage","info":"","x":2470,"y":2560,"wires":[]},{"id":"24151a93.78a12e","type":"delay","z":"10fde8b5.a8a82f","name":"","pauseType":"delay","timeout":"6","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":1850,"y":2600,"wires":[[]]},{"id":"2784a6e1.9d52ba","type":"change","z":"10fde8b5.a8a82f","name":"found","rules":[{"t":"set","p":"reset","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":1340,"y":2550,"wires":[["24151a93.78a12e"]]},{"id":"4710bf87.44d3d8","type":"link in","z":"10fde8b5.a8a82f","name":"Icon found","links":["14ffc572.d3c78b","1e77d751.41fac9","7e2dd661.f9e88","7ee3a01.855406","ab299ec2.2bd1c","c9ce0127.1b2fc8","f66104d5.41ab7","6473a6e.5b8a4d8","85b55e8206bee4b7"],"x":1245,"y":2550,"wires":[["2784a6e1.9d52ba","a8e99d56.7640b8"]]},{"id":"14ffc572.d3c78b","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2275,"y":1540,"wires":[]},{"id":"c9ce0127.1b2fc8","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2265,"y":1330,"wires":[]},{"id":"7e2dd661.f9e88","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2265,"y":1130,"wires":[]},{"id":"1e77d751.41fac9","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2265,"y":840,"wires":[]},{"id":"ab299ec2.2bd1c","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2265,"y":560,"wires":[]},{"id":"7ee3a01.855406","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2265,"y":400,"wires":[]},{"id":"f66104d5.41ab7","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2265,"y":310,"wires":[]},{"id":"441775b8.3d05c4","type":"switch","z":"10fde8b5.a8a82f","name":"Wind","property":"$parent.windstrength","propertyType":"flow","rules":[{"t":"eq","v":"NO","vt":"str"},{"t":"eq","v":"LIGHT","vt":"str"},{"t":"eq","v":"STRONG","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1700,"y":1300,"wires":[["8b807984.d95c08"],["e1d34ac8.0443f8"],["e1d34ac8.0443f8"]]},{"id":"e1d34ac8.0443f8","type":"change","z":"10fde8b5.a8a82f","name":"Partly cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-cloudy-windy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1310,"wires":[["c9ce0127.1b2fc8"]]},{"id":"82fafc1a.b3e21","type":"delay","z":"10fde8b5.a8a82f","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":625,"y":240,"wires":[["b6c0418c.e3f6a8"]],"l":false},{"id":"33f1f1d7.891bde","type":"comment","z":"10fde8b5.a8a82f","name":"Rain intensity","info":"","x":2460,"y":2460,"wires":[]},{"id":"b3316a43.ffa098","type":"switch","z":"10fde8b5.a8a82f","name":"Wind","property":"$parent.windstrength","propertyType":"flow","rules":[{"t":"eq","v":"NO","vt":"str"},{"t":"eq","v":"LIGHT","vt":"str"},{"t":"eq","v":"STRONG","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1620,"y":1130,"wires":[["5cdd808a.0d6db8","8a604f63.d8f88"],["c9f5582e.c6d928"],["c9f5582e.c6d928"]]},{"id":"4fba7468.c48934","type":"change","z":"10fde8b5.a8a82f","name":"Partly cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-cloudy-windy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1170,"wires":[["7e2dd661.f9e88"]]},{"id":"29732b22.a849bc","type":"fan","z":"10fde8b5.a8a82f","name":"Blah","x":1245,"y":2350,"wires":[["6c63bf11.09bb5","131947f4.de572","7ec7cb01.58578c"]],"l":false},{"id":"7ec7cb01.58578c","type":"change","z":"10fde8b5.a8a82f","name":"Wind speed","rules":[{"t":"set","p":"payload","pt":"msg","to":"$parent.wind","tot":"flow"}],"action":"","property":"","from":"","to":"","reg":false,"x":1860,"y":2410,"wires":[["3347e292.2479fe"]]},{"id":"6762e30b.82bc7c","type":"switch","z":"10fde8b5.a8a82f","name":"type of rain","property":"payload.detail","propertyType":"msg","rules":[{"t":"cont","v":"light","vt":"str"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":1510,"y":690,"wires":[["977d1a4f.6190e"],["3489e3d8.8c2474"]]},{"id":"977d1a4f.6190e","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":680,"wires":[["bd087fda.40cab8"],["bd087fda.40cab8"],["c67bbc79.6116a8"]]},{"id":"c67bbc79.6116a8","type":"change","z":"10fde8b5.a8a82f","name":"Day rain","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-sprinkle","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":700,"wires":[["1e77d751.41fac9"]]},{"id":"59c4e660.70a7a8","type":"comment","z":"10fde8b5.a8a82f","name":"Light","info":"","x":1850,"y":610,"wires":[]},{"id":"bd087fda.40cab8","type":"change","z":"10fde8b5.a8a82f","name":"Night rain","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-showers","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2030,"y":660,"wires":[["1e77d751.41fac9"]]},{"id":"3489e3d8.8c2474","type":"switch","z":"10fde8b5.a8a82f","name":"Wind strength","property":"$parent.windstrength","propertyType":"flow","rules":[{"t":"eq","v":"NO","vt":"str"},{"t":"eq","v":"LIGHT","vt":"str"},{"t":"eq","v":"STRONG","vt":"str"}],"checkall":"true","repair":false,"outputs":3,"x":1550,"y":780,"wires":[["6abc41b9.d7ed4","98a4215b.6a1ef"],["8bbff73b.e2e4a"],[]]},{"id":"8bbff73b.e2e4a","type":"change","z":"10fde8b5.a8a82f","name":"Day rain wind","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-day-rain-wind","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2050,"y":860,"wires":[["1e77d751.41fac9"]]},{"id":"e779ead8.7386e8","type":"link out","z":"10fde8b5.a8a82f","name":"","links":["d259347a.92e9c8","1838a6c5.1ddd69"],"x":625,"y":290,"wires":[]},{"id":"1838a6c5.1ddd69","type":"link in","z":"10fde8b5.a8a82f","name":"","links":["e779ead8.7386e8"],"x":1245,"y":2510,"wires":[["631ca14d.1d41c","24151a93.78a12e"]]},{"id":"7b505321.2343ac","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":930,"wires":[["b12861e9.c712c"],["b12861e9.c712c"],["2d19f161.e486b6"]]},{"id":"4f81c64b.4d467","type":"function","z":"10fde8b5.a8a82f","name":"type of...","func":"//var clouds = flow.get(\"clouds\")\nvar clouds = msg.data.clouds;\nif (clouds == undefined)\n{clouds = 0;}\n\nif (clouds < 50)\n{\n msg.payload = \"wi wi-day-sprinkle\";\n} else\n{\n msg.payload = \"wi wi-sprinkle\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1680,"y":930,"wires":[["7b505321.2343ac"]]},{"id":"b12861e9.c712c","type":"change","z":"10fde8b5.a8a82f","name":"night sprinkle","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-sprinkle","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":920,"wires":[["1e77d751.41fac9"]]},{"id":"de695626.0b0eb","type":"comment","z":"10fde8b5.a8a82f","name":"Wind Speed","info":"","x":2460,"y":2410,"wires":[]},{"id":"8f529e80.3778b8","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":1700,"wires":[["c790fb1.e0ea508"],["c790fb1.e0ea508"],["b1591fa0.61913"]]},{"id":"82338e47.aeedb","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"3","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1860,"y":1740,"wires":[[]]},{"id":"b1591fa0.61913","type":"change","z":"10fde8b5.a8a82f","name":"Snow","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-darksky-snow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2020,"y":1720,"wires":[["6473a6e.5b8a4d8"]]},{"id":"c790fb1.e0ea508","type":"change","z":"10fde8b5.a8a82f","name":"Snow (night)","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-snow","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1680,"wires":[["6473a6e.5b8a4d8"]]},{"id":"2d3c69ea.f6728e","type":"comment","z":"10fde8b5.a8a82f","name":"Snow","info":"","x":1580,"y":1700,"wires":[]},{"id":"6473a6e.5b8a4d8","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2275,"y":1730,"wires":[]},{"id":"8f8a1efb.3d823","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"6","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1460,"y":1160,"wires":[[]]},{"id":"631ca14d.1d41c","type":"trigger","z":"10fde8b5.a8a82f","name":"Message","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1350,"y":2470,"wires":[[]]},{"id":"a8e99d56.7640b8","type":"trigger","z":"10fde8b5.a8a82f","name":"Found","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1340,"y":2610,"wires":[[]]},{"id":"3beba12.b00ef5e","type":"trigger","z":"10fde8b5.a8a82f","name":"Message received","op1":"1","op2":"0","op1type":"str","op2type":"str","duration":"10","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":700,"y":340,"wires":[[]]},{"id":"3347e292.2479fe","type":"function","z":"10fde8b5.a8a82f","name":"","func":"if (msg.payload == undefined)\n{\n msg.payload = \"None\";\n}\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":2080,"y":2410,"wires":[[]]},{"id":"accee246.bf592","type":"comment","z":"10fde8b5.a8a82f","name":"Read me *","info":"Work is needed on\n`msg.data.clouds.all`\nto control icon displayed.","x":730,"y":180,"wires":[]},{"id":"c9f5582e.c6d928","type":"switch","z":"10fde8b5.a8a82f","name":"Night / Day","property":"now","propertyType":"msg","rules":[{"t":"lt","v":"payload.sunrise","vt":"msg"},{"t":"gt","v":"payload.sunset","vt":"msg"},{"t":"else"}],"checkall":"true","repair":false,"outputs":3,"x":1870,"y":1150,"wires":[["b4b37e81.224e8"],["b4b37e81.224e8"],["4fba7468.c48934"]]},{"id":"b4b37e81.224e8","type":"change","z":"10fde8b5.a8a82f","name":"Partly cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi wi-night-alt-cloudy-windy","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1130,"wires":[["7e2dd661.f9e88"]]},{"id":"2d19f161.e486b6","type":"function","z":"10fde8b5.a8a82f","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","x":2095,"y":960,"wires":[["1e77d751.41fac9"]],"l":false},{"id":"efea611bd2cb6d6c","type":"trigger","z":"10fde8b5.a8a82f","name":"","op1":"close","op2":"open","op1type":"str","op2type":"str","duration":"2","extend":false,"overrideDelay":false,"units":"s","reset":"","bytopic":"all","topic":"topic","outputs":1,"x":1245,"y":610,"wires":[["cac280363f08f4ca"]],"l":false},{"id":"cac280363f08f4ca","type":"change","z":"10fde8b5.a8a82f","name":"","rules":[{"t":"set","p":"topic","pt":"msg","to":"control","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":1305,"y":610,"wires":[["0dacc3409d1d9eb9"]],"l":false},{"id":"0dacc3409d1d9eb9","type":"gate","z":"10fde8b5.a8a82f","name":"A","controlTopic":"control","defaultState":"open","openCmd":"open","closeCmd":"close","toggleCmd":"toggle","defaultCmd":"default","statusCmd":"","persist":false,"x":1400,"y":610,"wires":[["6762e30b.82bc7c"]]},{"id":"09dad75fd880828c","type":"delay","z":"10fde8b5.a8a82f","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"allowrate":false,"outputs":1,"x":1365,"y":690,"wires":[["0dacc3409d1d9eb9"]],"l":false},{"id":"627e497555a10c5c","type":"change","z":"10fde8b5.a8a82f","name":"Overcast cloudy","rules":[{"t":"set","p":"payload","pt":"msg","to":"wi-day-cloudy-high","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":2040,"y":1820,"wires":[["85b55e8206bee4b7"]]},{"id":"b1c5444eb6c32d92","type":"comment","z":"10fde8b5.a8a82f","name":"Overcast","info":"","x":1580,"y":1820,"wires":[]},{"id":"f8d015c9afb7c356","type":"function","z":"10fde8b5.a8a82f","name":"","func":"\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":1735,"y":1820,"wires":[["627e497555a10c5c"]],"l":false},{"id":"85b55e8206bee4b7","type":"link out","z":"10fde8b5.a8a82f","name":"Icon found","links":["4710bf87.44d3d8"],"x":2285,"y":1870,"wires":[]},{"id":"977d76d85591988e","type":"switch","z":"10fde8b5.a8a82f","name":"weather type","property":"payload.detail","propertyType":"msg","rules":[{"t":"cont","v":"thunder","vt":"str"},{"t":"cont","v":"hail","vt":"str"},{"t":"cont","v":"fog","vt":"str"},{"t":"cont","v":"mist","vt":"str"},{"t":"cont","v":"rain","vt":"str"},{"t":"cont","v":"drizzle","vt":"str"},{"t":"cont","v":"clouds","vt":"str"},{"t":"cont","v":"windy","vt":"str"},{"t":"cont","v":"clear","vt":"str"},{"t":"cont","v":"snow","vt":"str"},{"t":"cont","v":"overcast","vt":"str"}],"checkall":"false","repair":false,"outputs":11,"x":1090,"y":360,"wires":[["3f65d757.5766"],["b7b5b9b9.375af8"],["6173fca5.92bfec"],["6173fca5.92bfec"],["09dad75fd880828c"],["4f81c64b.4d467"],["1574d141.436ff7"],[],["2c42bafb.9ca7ce"],["8f529e80.3778b8"],["f8d015c9afb7c356"]]},{"id":"9e0d9daee45d4b81","type":"comment","z":"10fde8b5.a8a82f","name":"Mist","info":"","x":1580,"y":550,"wires":[]},{"id":"d141f99f.9e6318","type":"ui_group","name":"Default","tab":"a770f02a.b6e3c8","order":1,"disp":true,"width":"9","collapse":false},{"id":"a770f02a.b6e3c8","type":"ui_tab","d":true,"name":"TEST","icon":"dashboard","order":16,"disabled":false,"hidden":false},{"id":"d4617a12.405fe8","type":"subflow:10fde8b5.a8a82f","z":"ae12fd.00ef75","name":"","env":[],"x":2780,"y":2170,"wires":[["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["4f6965f8.730094"],["f1ce52bf.1a0e58"],["9e199af4.bf4058"],[],["f44803d1.1a7a28"],["cdf2a7a8.730928","fb8f585d.fdb7d"]]}]
const data = msg.payload
const topics = [
'tempc',
'humidity',
'maxtemp',
]
const payloads = [
data.tempc,
data.humidity,
data.temp_maxc,
]
const messages = topics.map((topic, index) => ({
topic,
payload: payloads[index]
}))
return [messages]
Can someone verify this code and how can I read location,sunrise, and sunset times in msg.payload
Without seeing what is in msg.payload at the start of that, it's hard to "verify" your code.
What is the point of your topics, payloads and messages arrays?
i use Open-meteo. They have a nice api, and you don't need an api key.
example flow:
[{"id":"3c88a7f7fc89ed7f","type":"inject","z":"4c08fa20cc28f527","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":500,"y":220,"wires":[["843553041cfe62f8"]]},{"id":"61540b63d4f8affe","type":"debug","z":"4c08fa20cc28f527","name":"","active":true,"tosidebar":true,"console":false,"tostatus":true,"complete":"true","targetType":"full","statusVal":"statusCode","statusType":"msg","x":1130,"y":220,"wires":[]},{"id":"ad8b72bfc7b55e58","type":"http request","z":"4c08fa20cc28f527","name":"Open-Meteo.com","method":"GET","ret":"obj","paytoqs":"query","url":"https://api.open-meteo.com/v1/forecast","tls":"","persist":false,"proxy":"","insecureHTTPParser":false,"authType":"","senderr":false,"headers":[],"x":950,"y":220,"wires":[["61540b63d4f8affe"]]},{"id":"843553041cfe62f8","type":"change","z":"4c08fa20cc28f527","name":"","rules":[{"t":"set","p":"payload","pt":"msg","to":"{}","tot":"json"},{"t":"set","p":"payload.latitude","pt":"msg","to":"52.5244","tot":"num"},{"t":"set","p":"payload.longitude","pt":"msg","to":"13.4105","tot":"num"},{"t":"set","p":"payload.current","pt":"msg","to":"temperature_2m,relative_humidity_2m,rain,weather_code,cloud_cover","tot":"str"},{"t":"set","p":"payload.hourly","pt":"msg","to":"temperature_2m","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":710,"y":220,"wires":[["ad8b72bfc7b55e58"]]}]
I did a comparison of API's quite a while back, should be searchable in the forum.
Met Office is what I mostly use for the UK.
But yes, Open Meteo is quite good: Up to 16 days forecast Fair use policy. Maximum 10,000 calls/day No API key required.
This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.