2019-05-31 23:22:37 +00:00
|
|
|
# OpenWeatherMap Input Plugin
|
2019-05-30 22:17:04 +00:00
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
Collect current weather and forecast data from OpenWeatherMap.
|
2019-05-30 22:17:04 +00:00
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
To use this plugin you will need an [api key][] (app_id).
|
2019-05-30 22:17:04 +00:00
|
|
|
|
2019-10-18 19:48:23 +00:00
|
|
|
City identifiers can be found in the [city list][]. Alternately you
|
|
|
|
can [search][] by name; the `city_id` can be found as the last digits
|
|
|
|
of the URL: https://openweathermap.org/city/2643743. Language
|
|
|
|
identifiers can be found in the [lang list][]. Documentation for
|
|
|
|
condition ID, icon, and main is at [weather conditions][].
|
2019-05-31 23:22:37 +00:00
|
|
|
|
|
|
|
### Configuration
|
2019-05-30 22:17:04 +00:00
|
|
|
|
|
|
|
```toml
|
|
|
|
[[inputs.openweathermap]]
|
2019-05-31 23:22:37 +00:00
|
|
|
## OpenWeatherMap API key.
|
|
|
|
app_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
|
|
|
|
|
|
|
## City ID's to collect weather data from.
|
|
|
|
city_id = ["5391959"]
|
|
|
|
|
2019-10-18 19:48:23 +00:00
|
|
|
## Language of the description field. Can be one of "ar", "bg",
|
|
|
|
## "ca", "cz", "de", "el", "en", "fa", "fi", "fr", "gl", "hr", "hu",
|
|
|
|
## "it", "ja", "kr", "la", "lt", "mk", "nl", "pl", "pt", "ro", "ru",
|
|
|
|
## "se", "sk", "sl", "es", "tr", "ua", "vi", "zh_cn", "zh_tw"
|
|
|
|
# lang = "en"
|
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
## APIs to fetch; can contain "weather" or "forecast".
|
|
|
|
fetch = ["weather", "forecast"]
|
|
|
|
|
|
|
|
## OpenWeatherMap base URL
|
|
|
|
# base_url = "https://api.openweathermap.org/"
|
|
|
|
|
|
|
|
## Timeout for HTTP response.
|
2019-05-30 22:17:04 +00:00
|
|
|
# response_timeout = "5s"
|
2019-05-31 23:22:37 +00:00
|
|
|
|
|
|
|
## Preferred unit system for temperature and wind speed. Can be one of
|
|
|
|
## "metric", "imperial", or "standard".
|
2019-05-30 22:17:04 +00:00
|
|
|
# units = "metric"
|
2019-05-31 23:22:37 +00:00
|
|
|
|
|
|
|
## Query interval; OpenWeatherMap weather data is updated every 10
|
|
|
|
## minutes.
|
|
|
|
interval = "10m"
|
2019-05-30 22:17:04 +00:00
|
|
|
```
|
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
### Metrics
|
2019-05-30 22:17:04 +00:00
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
- weather
|
2019-05-30 22:17:04 +00:00
|
|
|
- tags:
|
|
|
|
- city_id
|
|
|
|
- forecast
|
2019-10-18 19:48:23 +00:00
|
|
|
- condition_id
|
|
|
|
- condition_main
|
2019-05-31 23:22:37 +00:00
|
|
|
- fields:
|
|
|
|
- cloudiness (int, percent)
|
|
|
|
- humidity (int, percent)
|
|
|
|
- pressure (float, atmospheric pressure hPa)
|
|
|
|
- rain (float, rain volume for the last 3 hours in mm)
|
|
|
|
- sunrise (int, nanoseconds since unix epoch)
|
|
|
|
- sunset (int, nanoseconds since unix epoch)
|
|
|
|
- temperature (float, degrees)
|
|
|
|
- visibility (int, meters, not available on forecast data)
|
|
|
|
- wind_degrees (float, wind direction in degrees)
|
|
|
|
- wind_speed (float, wind speed in meters/sec or miles/sec)
|
2019-10-18 19:48:23 +00:00
|
|
|
- condition_description (string, localized long description)
|
|
|
|
- condition_icon
|
2019-05-30 22:17:04 +00:00
|
|
|
|
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
### Example Output
|
2019-05-30 22:17:04 +00:00
|
|
|
|
|
|
|
```
|
2019-10-18 19:48:23 +00:00
|
|
|
> weather,city=San\ Francisco,city_id=5391959,condition_id=800,condition_main=Clear,country=US,forecast=* cloudiness=1i,condition_description="clear sky",condition_icon="01d",humidity=35i,pressure=1012,rain=0,sunrise=1570630329000000000i,sunset=1570671689000000000i,temperature=21.52,visibility=16093i,wind_degrees=280,wind_speed=5.7 1570659256000000000
|
|
|
|
> weather,city=San\ Francisco,city_id=5391959,condition_id=800,condition_main=Clear,country=US,forecast=3h cloudiness=0i,condition_description="clear sky",condition_icon="01n",humidity=41i,pressure=1010,rain=0,temperature=22.34,wind_degrees=249.393,wind_speed=2.085 1570665600000000000
|
|
|
|
> weather,city=San\ Francisco,city_id=5391959,condition_id=800,condition_main=Clear,country=US,forecast=6h cloudiness=0i,condition_description="clear sky",condition_icon="01n",humidity=50i,pressure=1012,rain=0,temperature=17.09,wind_degrees=310.754,wind_speed=3.009 1570676400000000000
|
2019-05-30 22:17:04 +00:00
|
|
|
```
|
|
|
|
|
2019-05-31 23:22:37 +00:00
|
|
|
[api key]: https://openweathermap.org/appid
|
|
|
|
[city list]: http://bulk.openweathermap.org/sample/city.list.json.gz
|
|
|
|
[search]: https://openweathermap.org/find
|
2019-10-18 19:48:23 +00:00
|
|
|
[lang list]: https://openweathermap.org/current#multi
|
|
|
|
[weather conditions]: https://openweathermap.org/weather-conditions
|