Skip to content

OpenWeatherMap_connector

David Nestle edited this page Feb 27, 2020 · 1 revision

OpenWeatherMap connector

Reads weather forecast data from http://openweathermap.org, and writes the forecasts to the respective resources. The driver does not provide a user interface, for the time being.

Icon An API key is required for this driver, please register at http://openweathermap.org/register. The key must be set as system property (e.g. in the rundir file config/ogema.properties):

   * org.ogema.drivers.openweathermap.key*

Usage

Register a service dependency to the interface org.ogema.apps.openweathermap.OpenWeatherMapApplicationI, and create an environment setting as follows

 

@org.apache.felix.scr.annotations.Reference
OpenWeatherMapApplicationI owmUtil;
    
@Override
void start(ApplicationManager appManager) {
    Room environment = (Room) owmUtil.createEnvironment("kasselEnvironment", "Kassel", "de");
    ...
}

The connector will create a set of resources including a TemperatureSensor, SolarIrradiationSensor and HumiditySensor, with the respective forecast schedules, and write the schedule values periodically.

Configuration

Properties that are evaluated (see ogema.properties):

Property key Value Default Explanation
org.ogema.drivers.openweathermap.getWeatherInfoRepeatTime long value, interpreted as time interval in ms 600000000 (10 min) Irradiation schedule calculation period

 

Next


Clone this wiki locally