The openweathermap plugin

Author: Matthias
Available since: 0.9.0

Description

This plugins integrates OpenWeatherMap data.

Settings

For a general understanding of how the configuration files are structured and what elements and attributes are it is recommended to read this section first: Pages and structure of CometVisu.

The behaviour and appearance of the openweathermap plugins can be influenced by using certain attributes and elements. The following tables show the allowed attributes and elements and their possible values. The screenshots show, how both can be edited in the editor.

Attributes underlined by ….. are mandatory, all the others are optional and be omitted.

Allowed attributes in the openweathermap-element

Element

Attribute

Name

Content

Description

openweathermap

lang

en, de or fr

Language / format of the date

appid

string

Personal access key as obtained from https://openweathermap.org/

description

string

Describing text, displays the place name when left empty. “false” disables the display

detailItems

integer

Displays details when set to 1 (default) and hides them when set to 0

forecast24hItems

integer

Number of items to show (0…8)

forecastDailyItems

integer

Number of items to show (0…4)

showSunrise

true or false

Show the sun rise and set information

owID

string

OpenWeatherMap city ID as defined in http://bulk.openweathermap.org/sample/city.list.json.gz

q

string

When owID is not used: City name and country code divided by comma, use ISO 3166 country codes

lat

string

When owID or q is not used: latitude of place

lon

string

When owID or q is not used: longitue of place

refresh

integer

Refresh interval of the data in minutes

class

string

Add this value to the CSS class so that it can be formatted by a user provided style sheet.

Important

The value of the attribute appid has to be replaced by your own key!

The OpenweatherMap uses the web service of https://openweathermap.org/ to fetch the current weather date and forecast. To be able to access this data you need a key that can be obtained free of charge at the homepage and which must be inserted at the appid attribute.

Allowed child-elements and their attributes

None.

Examples

It is possible to manually edit the visu_config.xml and add an entry for the openweathermap plugin.

Caution

Make sure that you only use UTF-8 encoded characters by settings the encoding in your XML-editor to UTF-8 mode!

Important

The value of the attribute appid has to be replaced by your own key!

This minimal example code will create this screen shot:

../../../../_images/weather.png
<meta>
    <plugins>
        <plugin name="openweathermap" />
    </plugins>
</meta>
...
<openweathermap q="Munich" appid="..." />