Fernhill SCADA Connection to OpenWeatherMap
Help Contents
- Fernhill SCADA
- Help
- Drivers
- Data File
- OpenWeatherMap Example
Introduction
The OpenWeatherMap Internet Service provides weather data for most places around the world.
The service provides basic information at no cost, and more detailed information for a fee.
Using the URL Scanner Tag you can:
- Retrieve weather data from the OpenWeatherMap Internet service.
- Write extracted weather data values to I/O Data Point Tags.
This page shows you how to retrieve and store weather data using Fernhill SCADA.
The instructions show you how to:
1. Obtain an API Key from OpenWeatherMap
To read any data from the OpenWeatherMap Service, you need to obtain an API Key. To do this:
- In a web browser, open the page https://openweathermap.org/.
- Click Sign Up. The Create New Account page opens.
- Enter your Username, Email Address and Password.
- Check the required options.
- Click Create Account.
-
You should then receive an email with your API key. A key consists of 32 letters and numbers, for example:
a4ef3b66fe364d43e8e17376063exxxx
2. Create the URL Scanner Tag
In the Configuration Tool, do the following:
-
In the Tag Window, right-click
on the database root and select Add new folder.
- Enter the name OpenWeatherMap.
- Press Return.
-
Right-click the new OpenWeatherMap folder and select Add new tag,
followed by File Driver, followed by URL Scanner.
- Press Return to accept the default name "URL Scanner"
-
In the
Properties Window, enter these values:
Property | Value |
FileType | JSON |
ReadInterval | 3h |
URL | https://api.openweathermap.org/data/2.5/forecast?q=London&APPID=KEY |
Note: Replace the KEY part of the URL with the API key you received in the email in step 1.
-
Check the Configuration Tool Status Monitor to
confirm the URL Scanner is Online. If there is a problem, check the URL property is configured correctly.
3. Configure a Data Point Tag to Show the Temperature in 24 Hours Time
-
In the Tag Window do the following:
- Right-click the OpenWeatherMap folder.
- select Add new tag, followed by Core, followed by I/O Analog Data Point Tag.
- Enter the name Temp +24h.
- Press Return.
-
In the
Properties Window, enter these values:
Property | Value |
MaxScale | 100 |
MinScale | -273 |
RawScaleMax | 373 |
RawScaleMin | 0 |
Note: OpenWeatherMap reports temperatures in Kelvin.
These scaling parameters change the scale to Celsius.
-
In the IODataSource field, click the Browse button
to open
the Browse Tags dialog.
- Select the entry URL Scanner then click OK.
-
In the IOItemName property, click the Browse button
to open
the Browse Property Values dialog.
- Expand the list entry.
-
Expand the [8] entry.
Note: Each entry in the array represents a 3 hour interval. Index 8 represents the weather 24 hours in the future.
- Expand the main entry.
- Select temp entry and click OK.
-
Check the Configuration Tool Status Monitor to
confirm the Temp +24h tag is showing an appropriate value.
If there is a problem, check the IODataSource and IOItemName properties are configured correctly.
Further Information
Data File Driver
For an overview of the Data File Driver.
Glossary
For the meaning of terms used in Fernhill SCADA.