Weather Data Examples

The Weather Data example uses the esi-lcurl-http-client library to fetch weather data from the German Weather Service ("DWD - Deutscher Wetterdienst") servers.

This is an official public server and the data is made available in an HTML file that can be downloaded from this URL: https://www.dwd.de/DWD/wetter/aktuell/deutschland/tabelle/wx_brd_akt.html

A Lua script parses this HTML file and then creates objects in I/O model that contain this data.

Installation

The example can be loaded from a Console Display in DataStudio with the following simple Lua code:

exm=require("esi-examples")
exm:SETUP({{"WeatherData"}})
In Lua Security Mode Restrictive, for the installation script as well as the actual example to work, additional configuration of Lua permissions is required. See Lua Security for background information and examples.

The code above will create a folder structure "Examples/Weather Data" underneath the Core object in I/O Model.

Using the weather data example

After the initial setup, the example will not be active:

Weather Data: Fresh Setup

To activate the simulation, enable the "Fetch Weather Data" object:

Weather Data: Start the example

After the example has been properly activated, a list of official DWD weather stations is retrieved from the DWD servers and a folder named Stations is created and populated with objects representing each weather station and the data provided by that station.

Weather Data: Weather Stations

Furthermore, a table holder object named Weather Table is created, containing a table with all stations and their weather data:

Weather Data: Weather Table

The Generic Item Fetch Weather Warnings will do as its name implies: It fetches available weather warnings from the DWD servers and makes them available:

Weather Data: Weather Warnings

Additionally, the Lua script body of the Fetch Weather Warnings object can be modified to send a formatted HTML email with the weather warnings to a configured recipient:

Weather Data: Send eMail With Weather Warnings