Skip to main content

Open Weather Map

Whatโ€‹

Shows the current weather of a given location with Open Weather Map.

caution

You must request an API key at the Open Weather Map website. The free tier for Current weather and forecasts collection is sufficient.

Sample Configurationโ€‹

{
"type": "owm",
"style": "powerline",
"powerline_symbol": "๎‚ฐ",
"foreground": "#ffffff",
"background": "#FF0000",
"template": "{{.Weather}} ({{.Temperature}}{{.UnitIcon}})",
"properties": {
"api_key": "<YOUR_API_KEY>",
"location": "AMSTERDAM,NL",
"units": "metric",
"http_timeout": 20,
"cache_timeout": 10
}
}

Propertiesโ€‹

NameTypeDefaultDescription
api_keystring.Your API key from Open Weather Map. Can also be set using the POSH_OWM_API_KEY environment variable.
latitudefloat6491The latitude of the requested location, valid between -90 and 90
longitudefloat64181The longitude of the requested location, valid between -180 and 180
locationstringDe Bilt,NLThe requested location interpretted only if valid coordinates aren't given. Formatted as <City,STATE,COUNTRY_CODE>. City name, state code and country code divided by comma. Please, refer to ISO 3166 for the state codes or country codes
unitsstringstandardUnits of measurement. Available values are standard (kelvin), metric (celsius), and imperial (fahrenheit)
http_timeoutint20in milliseconds, the timeout for http request
cache_timeoutint10in minutes, the timeout for request caching. A value of 0 disables the cache.

Specifying Locationโ€‹

The given location can either be specified through the Latitude and Longitude properties or through the Location property. If both Latitude and Longitude are specified and valid then Location will be ignored if it is included. If Latitude or Longitude are not specified or are invalid then Location will be used.

Template (info)โ€‹

default template
{{ .Weather }} ({{ .Temperature }}{{ .UnitIcon }})

Propertiesโ€‹

NameTypeDescription
.Weatherstringthe current weather icon
.Temperatureintthe current temperature
.UnitIconstringthe current unit icon(based on units property)
.URLstringthe url of the current api call