Suppose you are creating a project that requires weather forecast information. For instance it can be some kind of a weather station or smart clock or something else. This library can help you complete your job supplying the interface to OpenWeatherMap data. At the moment the library supports three data forecast request types:
- current condition
- 5 day forecast (hours period)
- 16 day forecast
The library requires any version of the ESP8266 controller. To run the library you need register on openweathermap.org and get your authentication key.
ExampleThe library has one simple example that prints the forecasts on the serial port as follows:
Current Conditions:
Latitude & Longtitude: <37.62 55.75> @ 6:30 20-11-2017: icon: 04d, temp.: 0.75, press.: 1011
Five days forecast: Entries: 37
9:00 20-11-2017: icon: 13d, temp.: [-0.57, 0.89], press.: 1003.98, descr.: light snow:: snow 0.055000000000001
12:00 20-11-2017: icon: 13d, temp.: [-0.68, 0.41], press.: 1003.92, descr.: light snow:: snow 0.045
15:00 20-11-2017: icon: 13n, temp.: [-2.46, -1.73], press.: 1003.94, descr.: light snow:: snow 0.0675
18:00 20-11-2017: icon: 13n, temp.: [-2.85, -2.49], press.: 1003.63, descr.: light snow:: snow 0.06
21:00 20-11-2017: icon: 13n, temp.: [-3.33, -3.33], press.: 1002, descr.: light snow:: snow 0.04
0:00 21-11-2017: icon: 13n, temp.: [-3.45, -3.45], press.: 1000.44, descr.: light snow:: snow 0.04
3:00 21-11-2017: icon: 01n, temp.: [-2.91, -2.91], press.: 998.55, descr.: clear sky:: snow 0.025
6:00 21-11-2017: icon: 13d, temp.: [-3.01, -3.01], press.: 996.64, descr.: light snow:: snow 0.05
9:00 21-11-2017: icon: 13d, temp.: [-1.72, -1.72], press.: 994.93, descr.: light snow:: snow 0.13
12:00 21-11-2017: icon: 13d, temp.: [-1.51, -1.51], press.: 994.09, descr.: light snow:: snow 0.3525
15:00 21-11-2017: icon: 13n, temp.: [-2.06, -2.06], press.: 993.75, descr.: light snow:: snow 0.1875
18:00 21-11-2017: icon: 13n, temp.: [-2.59, -2.59], press.: 994.12, descr.: light snow:: snow 0.085 21:00
21-11-2017: icon: 13n, temp.: [-3.12, -3.12], press.: 994.71, descr.: light snow:: snow 0.075
0:00 22-11-2017: icon: 13n, temp.: [-3.76, -3.76], press.: 995.91, descr.: light snow:: snow 0.0775
3:00 22-11-2017: icon: 13n, temp.: [-4.37, -4.37], press.: 996.75, descr.: light snow:: snow 0.0575
6:00 22-11-2017: icon: 01d, temp.: [-4.98, -4.98], press.: 997.81, descr.: clear sky:: snow 0.025
9:00 22-11-2017: icon: 13d, temp.: [-2.59, -2.59], press.: 999.24, descr.: light snow:: snow 0.0575
12:00 22-11-2017: icon: 01d, temp.: [-2.92, -2.92], press.: 1000.3, descr.: clear sky:: snow 0.0074999999999994
15:00 22-11-2017: icon: 01n, temp.: [-4.1, -4.1], press.: 1002, descr.: clear sky:: snow 0.015
18:00 22-11-2017: icon: 13n, temp.: [-4.26, -4.26], press.: 1003.62, descr.: light snow:: snow 0.055
21:00 22-11-2017: icon: 13n, temp.: [-4.24, -4.24], press.: 1005.56, descr.: light snow:: snow 0.037500000000001
0:00 23-11-2017: icon: 13n, temp.: [-3.92, -3.92], press.: 1007.6, descr.: light snow:: snow 0.059999999999999
3:00 23-11-2017: icon: 13n, temp.: [-3.92, -3.92], press.: 1009.48, descr.: light snow:: snow 0.077500000000001
6:00 23-11-2017: icon: 13d, temp.: [-3.66, -3.66], press.: 1011.72, descr.: light snow:: snow 0.065
9:00 23-11-2017: icon: 13d, temp.: [-2.43, -2.43], press.: 1013.68, descr.: light snow:: snow 0.0525
12:00 23-11-2017: icon: 13d, temp.: [-2.22, -2.22], press.: 1014.9, descr.: light snow:: snow 0.040000000000001
15:00 23-11-2017: icon: 13n, temp.: [-3.13, -3.13], press.: 1016.25, descr.: light snow:: snow 0.035
18:00 23-11-2017: icon: 13n, temp.: [-3.62, -3.62], press.: 1016.86, descr.: light snow:: snow 0.039999999999999
21:00 23-11-2017: icon: 01n, temp.: [-4.92, -4.92], press.: 1016.92, descr.: clear sky:: snow 0.02
0:00 24-11-2017: icon: 01n, temp.: [-6.2, -6.2], press.: 1016.5, descr.: clear sky:: snow 0.0050000000000008
3:00 24-11-2017: icon: 01n, temp.: [-6.19, -6.19], press.: 1015.08, descr.: clear sky:: snow 0.004999999999999
6:00 24-11-2017: icon: 13d, temp.: [-4.69, -4.69], press.: 1013.65, descr.: light snow:: snow 0.205
9:00 24-11-2017: icon: 13d, temp.: [-2.88, -2.88], press.: 1012.57, descr.: light snow:: snow 0.5
12:00 24-11-2017: icon: 13d, temp.: [-1.87, -1.87], press.: 1011.3, descr.: light snow:: snow 0.42
15:00 24-11-2017: icon: 13n, temp.: [-1.01, -1.01], press.: 1010.77, descr.: light snow:: snow 0.71
18:00 24-11-2017: icon: 10n, temp.: [0.43, 0.43], press.: 1009.9, descr.: light rain:: snow 0.185
21:00 24-11-2017: icon: 10n, temp.: [1.47, 1.47], press.: 1009.73, descr.: light rain:: snow 0.004999999999999
16 days forecast: Entries: 7 .Moscow, RU(524901) <37.6156, 55.7522> :
9:00 20-11-2017: icon: 13d, temp.: {-3.32, 0.89}, temp. change: -3.32 -> 0.75 -> 0.89 -> -1.73; pressure: 1003.98, descr.:light snow
9:00 21-11-2017: icon: 13d, temp.: {-3.11, -1.51}, temp. change: -3.11 -> -2.9 -> -1.72 -> -2.07; pressure: 994.93, descr.:light snow
9:00 22-11-2017: icon: 13d, temp.: {-4.97, -2.59}, temp. change: -4.24 -> -4.38 -> -2.59 -> -4.09; pressure: 999.24, descr.:light snow
9:00 23-11-2017: icon: 13d, temp.: {-5.1, -3.4}, temp. change: -4.7 -> -5.1 -> -3.4 -> -3.69; pressure: 998.26, descr.:light snow
9:00 24-11-2017: icon: 13d, temp.: {-7.38, 1.98}, temp. change: 1.98 -> -7.38 -> -4.38 -> -1.09; pressure: 1006.46, descr.:light snow
9:00 25-11-2017: icon: 10d, temp.: {4.13, 5.33}, temp. change: 4.36 -> 4.13 -> 5.33 -> 5.05; pressure: 998.25, descr.:light rain
9:00 26-11-2017: icon: 01d, temp.: {1.76, 3.57}, temp. change: 1.76 -> 3.12 -> 3.57 -> 1.79; pressure: 1008.18, descr.:sky is clear
Nice creative coding all of you!
Comments