fbpx
Weather Station
MagicBlocks Project

Weather Station

Make a simple weather station with Magicblocks

Introduction

Weather can be interpreted as the mix of events that happen each day in our atmosphere. Weather is different from city to city and it changers every minute. Weather warnings are important forecasts because they are used to protect life and property. Forecasts based on temperature and precipitation are important to agriculture, and therefore to traders within commodity markets.

Weather can include,

  • Temperature,
  • Humidity level,
  • Cloudiness,
  • Atmospheric pressure,
  • Rainfall,
  • Snowfall.

Intended Learning Outcome

  • You will learn how to use an API service to receive data.

 

How to measure Weather?

Weather details can be obtained using satellites and weather stations.

Weather Stations

A weather station is a facility, either on land or sea, with instruments and equipment for measuring atmospheric
conditions to provide information for weather forecasts
and to study the weather.

Weather Satellites.

Sensors on weather satellites scan the Earth, taking measurements of reflected light and infrared temperatures. These measurements are then digitized and sent back to Earth where they can be turned into images.

First, you need the below nodes.

       

Make the following arrangement

First, let’s configure the inject node. Double click on it to access its settings. Make the below settings.

This will display the weather status for every 10 minutes on the dashboard.

Now, let’s configure the HTTP request block.

paste the given link on the URL field:

https://api.openweathermap.org/data/2.5/weather?q=Colombo&appid=5528157866e7c9f2de4ff4d933ac2703

 

  • Set the Method to GET
  • Set the return field as “a parsed JSON object”

Now let’s configure the text node. This node is used to display the weather information on the dashboard.

First, make a new dashboard Tab as “Weather”

Double click on a text node. Make the below changes.

  • Make a new group under Weather as Temperature (k)
  • Set value format to {{msg.payload.main.temp}}
  • Set name to “Temperature”

 

For the Pressure details, make the following changes on another text node.

  • Make a new group under Weather as Pressure (hPa)
  • Set value format to {{msg.payload.main.pressure}}
  • Set name to “pressure”

For the Humidity details, make the following changes on another text node.

  • Make a new group under Weather as Humidity (%)
  • Set value format to {{msg.payload.main.humidity}}
  • Set name to “Humidity”

For the Windspeed details, make the following changes on another text node.

  • Make a new group under Weather as Wind speed (m/s)
  • Set value format to {{msg.payload.main.wind.speed}}
  • Set name to “Wind Speed”

You should have the following Tab groups in your dashboard.

Deploy the Playground and check your dashboard.

You will see the weather details updating here every 10 minutes. (Press the Inject node to immediately get the weather details)

Related Posts
Leave a Reply