Skip to content
This repository was archived by the owner on Aug 2, 2021. It is now read-only.

Module thc_OpenWeatherMap

Andreas Drollinger edited this page Jun 12, 2016 · 10 revisions

OpenWeatherMap

Introduction and setup

The thc_OpenWeatherMap module implements THC devices that get data from the OpenWeatherMap site.

To get weather data you need first to know a location recognized by OpenWeatherMap. The location can either be defined via the city name, the city ID or by the geographic coordinates. Validate the location on the OpenWeatherMap website: <http://www.openweathermap.org/find?q=x>

The following current weather parameters are available :

  • sunrise - Sunrise time, decimal, UTC
  • sunset - Sunset time, decimal, UTC
  • temp - Temperature, Celsius
  • humidity - Humidity, %
  • pressure - Atmospheric pressure (on the sea level)
  • speed - Wind speed, km/h
  • dir - Wind direction, degrees (meteorological)

The definition of an OpenWeatherMap devices requires the declaration of the 'get' command, using the following syntax:

 {thc_OpenWeatherMap {<Location> <WeatherParameter>}}

Examples

 DefineDevice Bern,temp \
    -name Bern -group Environment -format "%sC" -range {-30 50} -update 10m \
    -get {thc_OpenWeatherMap {"Bern,ch" "temp"}}

Clone this wiki locally