OpenWeatherMap

Abhängigkeit / dependence: https://flows.nodered.org/node/node-red-node-openweathermap

[{"id":"31d761a1.1a1bbe","type":"comment","z":"e3aa70fa.b265f","name":"Weather Stuhr [weather_stuhr]","info":"","x":140,"y":520,"wires":[]},{"id":"c1f457a9.e8c918","type":"function","z":"e3aa70fa.b265f","name":"Bitmap + Text","func":"var icon = msg.payload.icon;\n//\tclear sky\nif (icon == \"01d\")\n{\n    msg.bmp = \"[0,0,65504,0,0,65504,0,0,0,0,0,0,0,0,0,0,65504,0,65504,65504,65504,65504,0,65504,0,0,65504,65504,65504,65504,0,0,0,0,65504,65504,65504,65504,0,0,65504,0,65504,65504,65504,65504,0,65504,0,0,0,0,0,0,0,0,0,0,65504,0,0,65504,0,0]\"\n}\nif (icon == \"01n\")\n{\n    msg.bmp = \"[0,0,25388,25388,25388,25388,0,0,0,25388,46486,46486,40147,33808,25388,0,25388,46486,40147,59196,46486,59196,46486,25388,25388,59196,46486,46486,46486,46486,46486,25388,25388,40147,40147,46486,40147,46486,40147,25388,25388,46486,59196,46486,46486,63390,46486,25388,0,25388,46486,40147,46486,40147,25388,0,0,0,25388,25388,25388,25388,0,0]\"\n}\n// few clouds\nelse if (icon == \"02d\" || icon == \"02n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,65513,0,0,0,0,65513,0,0,0,65513,65513,65513,46486,46486,0,0,65513,65513,46486,46486,65535,65535,46486,0,65513,46486,65535,65535,65535,65535,46486,0,46486,65535,65535,65535,65535,65535,46486,0,46486,46486,46486,46486,46486,46486,0,0,0,0,0,0,0,0,0]\"\n}\n// scattered clouds\nelse if (icon == \"03d\" || icon == \"03n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,65535,65535,46486,0,0,46486,65535,65535,65535,65535,46486,0,0,46486,65535,65535,65535,65535,46486,0,46486,46486,46486,46486,46486,46486,46486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\"\n}\n// broken clouds\nelse if (icon == \"04d\" || icon == \"04n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,59196,59196,46486,0,0,46486,59196,59196,59196,59196,46486,0,0,46486,59196,59196,59196,59196,46486,0,46486,46486,46486,46486,46486,46486,46486,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]\"\n}\n// shower rain\nelse if (icon == \"09d\" || icon == \"09n\" || icon == \"10n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,59196,59196,46486,0,0,46486,59196,59196,59196,59196,46486,0,0,46486,59196,59196,59196,59196,46486,0,46486,46486,46486,46486,46486,46486,46486,0,6547,0,6547,0,6547,0,6547,6547,0,6547,0,6547,0,6547,0]\"\n}\n// rain\nelse if (icon == \"10d\")\n{\n    msg.bmp = \"[0,65513,0,0,0,0,65513,0,0,65513,65513,65513,65513,46486,46486,0,0,0,65513,46486,46486,65535,65535,46486,0,65513,46486,65535,65535,65535,65535,46486,0,65513,46486,65535,65535,65535,65535,46486,0,46486,46486,46486,46486,46486,46486,46486,0,6547,0,6547,0,6547,0,6547,6547,0,6547,0,6547,0,6547,0]\"\n}\nelse if (icon == \"11d\" || icon == \"11n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,65535,65535,46486,0,0,46486,65535,65535,65516,65535,46486,0,0,46486,65535,65516,65535,65535,46486,0,46486,46486,46486,46486,65516,46486,46486,0,0,0,0,65516,0,0,0,0,0,0,65516,0,0,0,0]\"\n}\nelse if (icon == \"13d\" || icon == \"13n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,65535,65535,46486,0,0,46486,65535,65535,65535,65535,46486,0,0,46486,65535,65535,65535,65535,46486,0,46486,46486,46486,46486,46486,46486,46486,0,65535,0,65535,0,65535,0,65535,65535,0,65535,0,65535,0,65535,0]\"\n}\nelse if (icon == \"50d\" || icon == \"50n\")\n{\n    msg.bmp = \"[0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,0,0,46486,0,0,46486,0,0,0,0,0,46486,46486,0,0,0,0,0,0,0,0,0,0,0,46486,46486,0,0,0,0,46486,46486,0,0,46486,0,0,46486,0,0,0,0,0,46486,46486,0]\"\n}\nmsg.humidity = 7 + (msg.payload.humidity / 4).toFixed(0);\nmsg.temp = msg.payload.tempc.toFixed(1) + \"~\"\n\nreturn msg;\n\n","outputs":1,"noerr":0,"x":360,"y":560,"wires":[["e6cb9f94.46a3d"]]},{"id":"82589adf.3289c8","type":"link out","z":"e3aa70fa.b265f","name":"Weather Stuhr [weather_stuhr] Link","links":["567381de.f98d2","df7f7c66.5d7ce"],"x":1095,"y":560,"wires":[]},{"id":"33819d10.b02a52","type":"openweathermap in","z":"e3aa70fa.b265f","name":"Get Push Weather Stuhr","wtype":"current","lon":"8.776990","lat":"53.016392","city":"","country":"","language":"de","x":130,"y":560,"wires":[["c1f457a9.e8c918"]]},{"id":"e6cb9f94.46a3d","type":"Screen Init","z":"e3aa70fa.b265f","name":"Screen Init","inscreenName":"weather_stuhr","induration":"10","x":530,"y":560,"wires":[["7264b719.f32748"]]},{"id":"7264b719.f32748","type":"Switch Animation","z":"e3aa70fa.b265f","name":"Switch Animation","aktiv":"true","animation":"fade","x":710,"y":560,"wires":[["719e28f3.b4c5f8"]]},{"id":"cbe43e33.dc5db","type":"Bitmap","z":"e3aa70fa.b265f","name":"Bitmap","indata":"{{bmp}}","inposX":"0","inposY":"0","inwidth":"8","inheight":"8","x":1000,"y":560,"wires":[["82589adf.3289c8"]]},{"id":"719e28f3.b4c5f8","type":"Text","z":"e3aa70fa.b265f","name":"Text","intextString":"{{temp}}","inbigFont":"false","inscrollText":"false","inscrollTextDelay":"0","incenterText":"true","inposX":"7","inposY":"1","incolorR":"255","incolorG":"255","incolorB":"255","x":870,"y":560,"wires":[["cbe43e33.dc5db"]]}]