Good
Good
"https://assets.weatherstack.com/images/wsymbols01_png_64/wsymbol_0001_sunn
y.png"
],
"weather_descriptions": [
"Sunny"
],
"wind_speed": 0,
"wind_degree": 349,
"wind_dir": "N",
"pressure": 1010,
"precip": 0,
"humidity": 90,
"cloudcover": 0,
"feelslike": 13,
"uv_index": 4,
"visibility": 16
}
}
request > query Returns the exact location identifier query used for this re
request > language Returns the ISO-Code of the language used for this reque
location > name Returns the name of the location used for this request.
Returns the local time of the location used for this reques
location > localtime
(Example: 2019-09-07 08:14)
current > observation_time Returns the UTC time for when the returned whether data
current > temperature Returns the temperature in the selected unit. (Default: Ce
current > wind_speed Returns the wind speed in the selected unit. (Default: kilo
current > pressure Returns the air pressure in the selected unit. (Default: MB
current > uv_index Returns the UV index associated with the current weather
current > visibility Returns the visibility level in the selected unit. (Default: k
Current Location:
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Location Identifier:
Aside from simply passing the name of a city, there are multiple other ways of
passing a location to the API.
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Location Name query = New York The standard way of passing a location nam
Multiple Location:
Use query parameter to pass a single location or multiple semicolon-separated
location identifiers to the API.
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Note: Each location passed to this parameter as part of a bulk query will count
towards your monthly request volume.
Historical WeatherAvailable on: Standard Plan and higher
To look up historical weather data all the way back to 2008, simply pass one date of
your choice (later than July 2008) or multiple semicolon-separated dates to the
weatherstack API's historical endpoint using the historical_date parameter.
Example API Request:
Run API Requesthttp://api.weatherstack.com/historical
? access_key = 326434219471cbee84aa40cb52b52ad1
& query = New York
& historical_date = 2015-01-21
& hourly = 1
Object Description
"https://assets.weatherstack.com/images/wsymbols01_png_64/wsymbol_0001_sunn
y.png"
],
"weather_descriptions": [
"Sunny"
],
"wind_speed": 0,
"wind_degree": 0,
"wind_dir": "N",
"pressure": 1011,
"precip": 0,
"humidity": 78,
"cloudcover": 0,
"feelslike": 15,
"uv_index": 5,
"visibility": 16
},
"historical": {
"2008-07-01": {
"date": "2008-07-01",
"date_epoch": 1214870400,
"astro": {
"sunrise": "05:29 AM",
"sunset": "08:31 PM",
"moonrise": "03:24 AM",
"moonset": "07:37 PM",
"moon_phase": "Waning Crescent",
"moon_illumination": 4
},
"mintemp": 0,
"maxtemp": 0,
"avgtemp": 19,
"totalsnow": 0,
"sunhour": 14.5,
"uv_index": 4,
"hourly": [
{
"time": "0",
"temperature": 27,
"wind_speed": 7,
"wind_degree": 201,
"wind_dir": "SSW",
"weather_code": 113,
"weather_icons": [
"https://assets.weatherstack.com/images/wsymbols01_png_64/wsymbol_0001_sunn
y.png"
],
"weather_descriptions": [
"Sunny"
],
"precip": 1.8,
"humidity": 80,
"visibility": 9,
"pressure": 1011,
"cloudcover": 15,
"heatindex": 25,
"dewpoint": 20,
"windchill": 24,
"windgust": 11,
"feelslike": 25,
"chanceofrain": 0,
"chanceofremdry": 0,
"chanceofwindy": 0,
"chanceofovercast": 0,
"chanceofsunshine": 0,
"chanceoffrost": 0,
"chanceofhightemp": 0,
"chanceoffog": 0,
"chanceofsnow": 0,
"chanceofthunder": 0,
"uv_index": 6
},
{ "time": "300", ... },
{ "time": "600", ... },
// 6 more items
]
}
}
}
Please note: The response objects request, location and current will not be
explained below as they are already mentioned in the Current Weather
Endpoint section above.
API Response Objects:
historical > ... > date Returns the requested historical date.
historical > ... > date_epoch Returns the requested historical date as UNIX timestamp.
astro > sunrise Returns the local sunrise time in the format hh:mm am/pm
astro > sunset Returns the local sunset time in the format hh:mm am/pm
astro > moonrise Returns the local moonrise time in the format hh:mm am/
astro > moonset Returns the local moonset time in the format hh:mm am/p
historical > ... > sunhour Returns the number of sun hours.
historical > ... > uv_index Returns the UV index associated with the current weather
hourly > temperature Returns the temperature in the selected unit. (Default: Ce
hourly > wind_speed Returns the wind speed in the selected unit. (Default: kilo
hourly > visibility Returns the visibility level in the selected unit. (Default: k
hourly > pressure Returns the air pressure in the selected unit. (Default: MB
hourly > dewpoint Returns the dew point temperature in the selected unit. (D
hourly > windchill Returns the wind chill temperature in the selected unit. (D
hourly > uv_index Returns the UV index associated with the current weather
Historical:
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Object Description
Historical Time-Series:
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
const url =
"https://api.weatherstack.com/historical?
access_key={PASTE_YOUR_API_KEY_HERE}&query=New
York&historical_date_start=2015-01-21&historical_date_end=2015-01-25";
const options = {
method: "GET",
};
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Weather ForecastAvailable on: Professional Plan and higher
The weatherstack is capable of returning weather forecast data for up to 14 days
into the future. To get weather forecasts, simply use the API's forecast and define
your preferred number of forecast days using the forecast_days parameter.
Example API Request:
Run API Requesthttp://api.weatherstack.com/forecast
? access_key = 326434219471cbee84aa40cb52b52ad1
& query = New York
& forecast_days = 1
& hourly = 1
Object Description
3 hourly (default)
6 hourly
12 hourly (day/night)
24 hourly (day average)
Note: Each day and location included in your request will count towards your
monthly allowed API request volume.
API Response:
{
"request": {
"type": "City",
"query": "New York, United States of America",
"language": "en",
"unit": "m"
},
"location": {
"name": "New York",
"country": "United States of America",
"region": "New York",
"lat": "40.714",
"lon": "-74.006",
"timezone_id": "America/New_York",
"localtime": "2019-09-07 11:38",
"localtime_epoch": 1567856280,
"utc_offset": "-4.0"
},
"current": {
"observation_time": "03:38 PM",
"temperature": 18,
"weather_code": 113,
"weather_icons": [
"https://assets.weatherstack.com/images/wsymbols01_png_64/wsymbol_0001_sunn
y.png"
],
"weather_descriptions": [
"Sunny"
],
"wind_speed": 0,
"wind_degree": 345,
"wind_dir": "NNW",
"pressure": 1011,
"precip": 0,
"humidity": 58,
"cloudcover": 0,
"feelslike": 18,
"uv_index": 5,
"visibility": 16
},
"forecast": {
"2019-09-07": {
"date": "2019-09-07",
"date_epoch": 1567814400,
"astro": {
"sunrise": "06:28 AM",
"sunset": "07:19 PM",
"moonrise": "03:33 PM",
"moonset": "12:17 AM",
"moon_phase": "First Quarter",
"moon_illumination": 54
},
"mintemp": 17,
"maxtemp": 25,
"avgtemp": 21,
"totalsnow": 0,
"sunhour": 10.3,
"uv_index": 5,
"hourly": [
{
"time": "0",
"temperature": 18,
"wind_speed": 28,
"wind_degree": 15,
"wind_dir": "NNE",
"weather_code": 122,
"weather_icons": [
"https://assets.weatherstack.com/images/wsymbols01_png_64/wsymbol_0004_black
_low_cloud.png"
],
"weather_descriptions": [
"Overcast"
],
"precip": 0,
"humidity": 68,
"visibility": 10,
"pressure": 1008,
"cloudcover": 75,
"heatindex": 18,
"dewpoint": 12,
"windchill": 18,
"windgust": 35,
"feelslike": 18,
"chanceofrain": 0,
"chanceofremdry": 87,
"chanceofwindy": 0,
"chanceofovercast": 90,
"chanceofsunshine": 15,
"chanceoffrost": 0,
"chanceofhightemp": 0,
"chanceoffog": 0,
"chanceofsnow": 0,
"chanceofthunder": 0,
"uv_index": 0
},
{ "time": "300", ... },
{ "time": "600", ... },
// 6 more items
]
}
}
}
Please note: The response objects request, location and current will not be
explained below as they are already mentioned in the Current Weather
Endpoint section.
API Response Objects:
forecast > ... > date Returns the requested forecast date.
forecast > ... > date_epoch Returns the requested forecast date as UNIX timestamp.
astro > sunrise Returns the local sunrise time in the format hh:mm am/pm
astro > sunset Returns the local sunset time in the format hh:mm am/pm
astro > moonrise Returns the local moonrise time in the format hh:mm am/
astro > moonset Returns the local moonset time in the format hh:mm am/p
astro > moon_phase Returns the local moon phase. Possible values:
New Moon
Response Object Description
Waxing Crescent
First Quarter
Waxing Gibbous
Full Moon
Waning Gibbous
Last Quarter
Waning Crescent
forecast > ... > sunhour Returns the number of sun hours.
forecast > ... > uv_index Returns the UV index associated with the current weather
100 = 1:00 AM
200 = 2:00 AM
...
1200 = 12:00 PM
1300 = 1:00 PM
etc.
hourly > temperature Returns the temperature in the selected unit. (Default: Ce
hourly > wind_speed Returns the wind speed in the selected unit. (Default: kilo
hourly > visibility Returns the visibility level in the selected unit. (Default: k
Response Object Description
hourly > pressure Returns the air pressure in the selected unit. (Default: MB
hourly > dewpoint Returns the dew point temperature in the selected unit. (D
hourly > windchill Returns the wind chill temperature in the selected unit. (D
hourly > uv_index Returns the UV index associated with the current weather
Weather Forecast:
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
Location Lookup/AutocompleteAvailable on: Standard Plan and higher
The weatherstack API's location autocomplete endpoint can be used to pinpoint one
or more specific locations and their identifying response objects with the aim of
later passing them to a weather data endpoint. In our example below, we are
looking for London, United Kingdom.
Example API Request:
Run API Requesthttp://api.weatherstack.com/autocomplete
? access_key = 326434219471cbee84aa40cb52b52ad1
& query = london
Object Description
API Response:
A successful API request will return one or multiple results that match your search
query. In our example, the first array object (London, United Kingdom) contains the
correct result. Now that we have our identifying response objects of the target
location we were looking for, we can make sure that the correct location is used by
other API endpoints by using one of the available location identifiers
(ideally: lat and lon) for upcoming queries.
{
"request": {
"query": "london",
"results": 2
},
"results": [
{
"name": "London",
"country": "United Kingdom",
"region": "City of London, Greater London",
"lon": "-0.106",
"lat": "51.517",
"timezone_id": "Europe/London",
"utc_offset": "1.0"
},
{
"name": "London",
"country": "Canada",
"region": "Ontario",
"lon": "-81.250",
"lat": "42.983",
"timezone_id": "America/Toronto",
"utc_offset": "-4.0"
}
]
}
request > query Returns the exact query sent to the API.
Response Object Description
results > lon Returns the longitude coordinates of the resulting location
results > lat Returns the latitude coordinates of the resulting location.
Autocomplete:
JavaScript FetchJavaScript AxiosPython RequestsPython Http.client
try {
const response = await fetch(url, options);
const result = await response.text();
console.log(result);
} catch (error) {
console.error(error);
}
General Options
Units ParameterAvailable on: All plans
By default, the API will return all results in metric units. Aside from metric units,
other common unit formats are supported as well. You can use the units parameter
to switch between the different unit formats Metric, Scientific and Fahrenheit.
m for Metric:
Parameter Units
s for Scientific:
Parameter Units
f for Fahrenheit:
Parameter Units
language = ar Arabic
language = bn Bengali
language = bg Bulgarian
language = cs Czech
language = da Danish
language = nl Dutch
language = fi Finnish
language = fr French
language = de German
language = el Greek
language = hi Hindi
language = hu Hungarian
language = it Italian
language = ja Japanese
Parameter (ISO Code) Language
language = jv Javanese
language = ko Korean
language = mr Marathi
language = pl Polish
language = pt Portuguese
language = pa Punjabi
language = ro Romanian
language = ru Russian
language = sr Serbian
language = si Sinhalese
language = sk Slovak
language = es Spanish
language = sv Swedish
language = ta Tamil
language = te Telugu
Parameter (ISO Code) Language
language = tr Turkish
language = uk Ukrainian
language = ur Urdu
language = vi Vietnamese
language = zu Zulu
200
Business $99.99 1,000,000 0.000149985
0
human-readable weather
Weather overview
summary
1.
On/off button for the display.
Figure 13. Display.
Two microprocessors and a wireless board were installed to handle all the sensors
and the HMI. This solution prevents overheating a single MCU and provides an
easier way to modularize the sub-systems. Following this design, two PCBs were
designed: main PCB (Figure 14) and second PCB (Figure 15).
Figure 14. Main PCB.
Regarding ergonomics, the layout and link analyses were performed simultaneously
on the human–machine interface presented in Figure 12. The first method states
that the components from the same category must be as close as possible. There
were only two categories found: device control and power. On the other hand, the
second method consists of establishing a sequence of actions that would be one of
the most common sequences while using the device in a normal operational mode
and tracing lines between the components following that order [39]. In this case,
the sequence was:
1. Turn on the device.
2. Check the indicator LEDs.
3. Turn on the display.
4. Watch the display and the measurements.
5. Change the measuring interval time to a different value.
Figure 16 depicts the two groups (red for device control and blue for power) and
the lines (green) that follow the order established. The device control group includes
the components labeled B, C, D, and E; the power group includes only component A.
Figure 16. Layout analysis and link analysis.
Once the lines are traced, the method establishes that no line should cross with
another to enhance operability and ergonomics. In this case, line A-E crosses line C-
D, indicating that one or more components should be relocated.
Figure 17 shows the rearrangement of the components that satisfy the link
analysis requirements. Furthermore, it can be observed that the four elements (B, C,
D, and E) are now grouped and satisfy the layout analysis requirements.
Figure 17. Components relocated.
4.3. Data Comparison
The first comparison was between the designed weather station and the Schneider
Electric thermostat. As stated, the two devices were placed together, as shown
in Figure 7. The data from the reference instrument were provided directly by
Schneider´s personnel. Figure 18 shows the two signals; the blue line represents
the measurements performed by the current proposal, and the orange one is the
reference value. At first glance, the two signals seem to have the same direction,
and a monotonic relationship can be inferred.
Figure 18. OSWS and reference device plot in an indoor scenario for temperature.
Statistical parameters were obtained to compare the two signals and determine
their relationship. The first non-parametric value is the Spearman correlation, which
indicates the strength of the association, a number between −1 and 1, and the
direction of the association, which can be positive or negative [40]. Additionally, the
root mean square error (RMSE) and mean absolute percentage error MAPE were
calculated to determine the performance of the measurement process; these
parameters are mainly focused on rating a forecast model’s accuracy, but they can
be applied to quantify the total error of two signals.
Moreover, a Bland–Altman plot was generated to assess the agreement between
these two signals. On the y-axis, the differences between the measurements are
displayed; on the x-axis, the averages of the measurements are plotted. Each plot
on this graph is a pair of measurements taken by the two instruments. Finally, this
Bland–Altman method has two limits of agreement at ±1.96 times the standard
deviation. Ideally, all the points should lie between these two limits, representing an
agreement between them [41]. Figure 19 shows the Bland–Altman plot generated
by comparing the time series.
Figure 20. OSWS and reference device in an indoor scenario for relative humidity.
Figure 21. Bland–Altman plot for relative humidity measured indoors.
The OSWS was juxtaposed with a Purple Air sensor located approximately 2.118 km
away in the outdoor environment. The methodologies employed were consistent
with those used in the indoor experiments. Comprehensive quantitative findings are
enumerated in Table 7. Moreover, Figure 22 depicts the atmospheric pressure
graphs where the upper blue line represents the signal from the proposed station. In
contrast, the red line at the bottom corresponds to the reference sensor. Notably,
the difference in readings between the two signals in Figure 22 could be attributed
to the variance in altitude where each sensor was positioned. Figure 23 highlights
the measurement discrepancy, revealing an average difference of 1.07 hPa. Figure
24 shows a Bland–Altman plot that affirms a notable alignment between the two
signals, with most of the points nestled within the limits of agreement. Additionally,
it is paramount to consider the inherent biases of the sensors, which can introduce
measurement discrepancies. External noise, including environmental factors or
electronic interference, can also influence the readings, affecting the system’s
accuracy.
Figure 22. OSWS and reference device plot in an outdoor scenario for atmospheric
pressure.
Figure 23. Differences between the two pressure time series.
Figure 24. Bland–Altman plot for pressure measured outdoors.
Table 7. Statistical parameters for measurements in an indoor scenario.
5.2. Impact
The revolutionary aspect of the OSWS is its democratization of weather data
through low-cost sensors, facilitating accessible and affordable weather monitoring.
By enabling real-time data sharing, the OSWS fosters timely decisions, which is
crucial for sectors sensitive to weather fluctuations. Apart from real-time weather
monitoring, the broader vision behind the OSWS extends to its application across
diverse sectors like agriculture and urban development. Its educational utility,
offering a tangible tool for learners, further underscores its multifaceted
applicability.
The OSWS, with its potential for regional weather analysis and integration from
multiple units, lays the groundwork for enhanced predictive capabilities, with
notable relevance in sectors relying heavily on accurate weather forecasts.
5.3. Limitations and Future Directions
While the OSWS heralds a transformative shift in weather monitoring, certain
limitations prevail. These encompass the system’s precision, which, while
consistent, might be inherently limited due to its cost-effective approach. Another
pivotal concern is data transmission and security, especially in regions with
unreliable internet connectivity.
Future endeavors related to the OSWS ought to emphasize:
1. Secure and dependable data transmission, particularly in remote settings.
2. ExplorING alternative data transmission channels and offline data
logging/retrieval solutions.
3. Strengthening data security measures to preserve data integrity during
transmission and storage.
4. Investigating durable sensors and materials to withstand environmental
challenges, reinforcing the OSWS’s reliability.
6. Conclusions
The OSWS offers a groundbreaking approach to weather monitoring, harnessing
low-cost sensors to overcome challenges posed by high costs and the need for
expert personnel inherent in existing technologies. Its capacity for real-time
monitoring and forecasting of pivotal environmental variables using the ARIMA
model stands utmost for agriculture, transportation, and air quality monitoring. Its
open-source nature further amplifies data accessibility, fostering informed decisions
essential in our current climate-changing era.
The design and implementation of the OSWS laid the groundwork for the future
evolution of cost-effective and efficient monitoring systems. As we move ahead,
focusing on enhancing data transmission security, diversifying communication
interfaces, and enduring diverse environmental conditions will be pivotal in refining
the OSWS, aiming to bolster environmental sustainability and foster informed
decision-making amidst escalating ecological challenges.
Author Contributions
Conceptualization, A.R., P.P., A.M. (Arturo Molina) and A.M. (Alan Meier);
Methodology, A.R., P.P. and O.M.; Software, A.R., P.P. and A.M. (Arturo Molina);
Validation, A.R., P.P. and O.M.; Formal analysis, A.R., P.P., O.M., A.M. (Arturo Molina)
and A.M. (Alan Meier); Investigation, A.R., P.P., O.M. and A.M. (Alan Meier);
Resources, P.P.; Data curation, A.R., P.P. and A.M. (Arturo Molina); Writing—original
draft, P.P. and A.M. (Alan Meier); Writing—review & editing, A.R. and A.M. (Arturo
Molina); Visualization, A.R.; Supervision, P.P., A.M. (Arturo Molina) and A.M. (Alan
Meier); Project administration, P.P.; Funding acquisition, A.M. (Arturo Molina). All
authors have read and agreed to the published version of the manuscript.
Funding
Institute of Advanced Materials for Sustainable Manufacturing, Tecnológico de
Monterrey.
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Data are contained within the article.
Conflicts of Interest
The authors declare no conflict of interest.
References
1. Effects|Facts—Climate Change: Vital Signs of the Planet. Available
online: https://climate.nasa.gov/effects/ (accessed on 2 October 2023).
2. United Nations. What Is Climate Change? Available
online: https://www.un.org/en/climatechange/what-is-climate-change (
accessed on 2 October 2023).
3. Lai, C. How Does Deforestation Affect the Carbon Cycle? Earth.Org. Available
online: https://earth.org/how-does-deforestation-affect-the-carbon-
cycle/ (accessed on 2 October 2023).
4. US EPA. Causes of Climate Change. Available
online: https://www.epa.gov/climatechange-science/causes-climate-
change (accessed on 2 October 2023).
5. US EPA. Introduction to Indoor Air Quality. Available
online: https://www.epa.gov/indoor-air-quality-iaq/introduction-
indoor-air-quality (accessed on 2 October 2023).
6. How Climate Change Affects Vector-Borne Diseases|News|Wellcome. Available
online: https://wellcome.org/news/how-climate-change-affects-vector-
borne-diseases (accessed on 2 October 2023).
7. Kulkarni, M.A.; Duguay, C.; Ost, K. Charting the Evidence for Climate Change
Impacts on the Global Spread of Malaria and Dengue and Adaptive
Responses: A Scoping Review of Reviews. Glob. Health 2022, 18, 1. [Google
Scholar] [CrossRef] [PubMed]
8. Weather Forecast with Meteodrones Weather Drones|Meteomatics. Available
online: https://www.meteomatics.com/en/meteodrones-weather-
drones/ (accessed on 2 October 2023).
9. Surface Mooring Network in the Kuroshio Extension. Available
online: https://ieeexplore.ieee.org/document/4579297 (accessed on 2
October 2023).
10.Demetillo, A.T.; Japitana, M.V.; Taboada, E.B. A System for Monitoring Water
Quality in a Large Aquatic Area Using Wireless Sensor Network
Technology. Sustain. Environ. Res. 2019, 29, 12. [Google Scholar]
[CrossRef]
11.AE521/AE521: What Is a Wireless Sensor Network? Available
online: https://edis.ifas.ufl.edu/publication/AE521 (accessed on 2
October 2023).
12.Pule, M.; Yahya, A.; Chuma, J. Wireless Sensor Networks: A Survey on
Monitoring Water Quality. J. Appl. Res. Technol. 2017, 15, 562–570. [Google
Scholar] [CrossRef]
13.Newlands, N.K. Model-Based Forecasting of Agricultural Crop Disease Risk at
the Regional Scale, Integrating Airborne Inoculum, Environmental, and
Satellite-Based Monitoring Data. Front. Environ. Sci. 2018, 6, 63. [Google
Scholar] [CrossRef]
14.World Meteorological Organization. Guide to Instruments and Methods of
Observation (WMO-No. 8). Available
online: https://community.wmo.int/en/activity-areas/imop/wmo-no_8 (
accessed on 2 October 2023).