diff --git a/docs/_includes/documentation-menu.html b/docs/_includes/documentation-menu.html index a511ab97ccb..07eabce8ae0 100644 --- a/docs/_includes/documentation-menu.html +++ b/docs/_includes/documentation-menu.html @@ -37,6 +37,7 @@
  • MQTT Generic
  • NTP Time Server
  • OneWire
  • +
  • OpenWeatherMap
  • Philips Hue
  • Serial Button
  • Sonos
  • diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/.classpath b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/.classpath new file mode 100644 index 00000000000..7f457fa4138 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/.project b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/.project new file mode 100644 index 00000000000..70b64d0bd07 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/.project @@ -0,0 +1,33 @@ + + + org.eclipse.smarthome.binding.openweathermap + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + org.eclipse.pde.ds.core.builder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/binding/binding.xml b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/binding/binding.xml new file mode 100644 index 00000000000..a0b623789d5 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/binding/binding.xml @@ -0,0 +1,10 @@ + + + + OpenWeatherMap Binding + OpenWeatherMap - Current weather and forecasts in your city. + Christoph Weitkamp + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/config/config.xml b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/config/config.xml new file mode 100644 index 00000000000..d2908c03c42 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/config/config.xml @@ -0,0 +1,78 @@ + + + + + + + password + + API key to access the OpenWeatherMap API. + + + + Specifies the refresh interval (in minutes). + 60 + + + + Language to be used by the OpenWeatherMap API. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + location + + Location of weather in geographical coordinates (latitude/longitude/altitude). + + + + Number of hours for hourly forecast. + 24 + + + + Number of days for daily forecast. + 6 + + + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap.properties b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap.properties new file mode 100644 index 00000000000..731c05dc3f4 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap.properties @@ -0,0 +1,13 @@ +# thing status +offline.conf-error-missing-apikey = The 'apikey' parameter must be configured. +offline.conf-error-invalid-apikey = Invalid API key. Please see https://openweathermap.org/faq#error401 for more info. +offline.conf-error-not-supported-refreshInterval = The 'refreshInterval' parameter must be at least 10 minutes. +offline.conf-error-not-supported-language = The given 'language' parameter is not supported. + +offline.conf-error-missing-location = The 'location' parameter must be configured. +offline.conf-error-parsing-location = The 'location' parameter could not be split into latitude and longitude. +offline.conf-error-not-supported-number-of-hours = The 'forecastHours' parameter must be between 0 and 120 - increment 3. +offline.conf-error-not-supported-number-of-days = The 'forecastDays' parameter must be between 0 and 16. + +# discovery result +discovery.openweathermap.weather-and-forecast.api.local.label = Local Weather And Forecast diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap_de.properties b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap_de.properties new file mode 100644 index 00000000000..6bacd3b2e2d --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/i18n/openweathermap_de.properties @@ -0,0 +1,213 @@ +# binding +binding.openweathermap.name = OpenWeatherMap Binding +binding.openweathermap.description = OpenWeatherMap - Aktuelles Wetter und Prognosen in Ihrer Stadt. + +# bridge types +thing-type.openweathermap.weather-api.label = OpenWeatherMap Konto +thing-type.openweathermap.weather-api.description = Ermöglicht den Zugriff auf die OpenWeatherMap API. + +# bridge types config +bridge-type.config.openweathermap.weather-api.apikey.label = API Schlüssel +bridge-type.config.openweathermap.weather-api.apikey.description = API Schlüssel für den Zugriff auf die OpenWeatherMap API. + +bridge-type.config.openweathermap.weather-api.refreshInterval.label = Abfrageintervall +bridge-type.config.openweathermap.weather-api.refreshInterval.description = Intervall zur Abfrage der OpenWeatherMap API (in min). + +bridge-type.config.openweathermap.weather-api.language.label = Sprache +bridge-type.config.openweathermap.weather-api.language.description = Sprache zur Anzeige der Daten. +bridge-type.config.openweathermap.weather-api.language.option.ar = Arabisch +bridge-type.config.openweathermap.weather-api.language.option.bg = Bulgarisch +bridge-type.config.openweathermap.weather-api.language.option.ca = Katalanisch +bridge-type.config.openweathermap.weather-api.language.option.cz = Tschechisch +bridge-type.config.openweathermap.weather-api.language.option.de = Deutsch +bridge-type.config.openweathermap.weather-api.language.option.el = Griechisch +bridge-type.config.openweathermap.weather-api.language.option.en = Englisch +bridge-type.config.openweathermap.weather-api.language.option.es = Spanisch +bridge-type.config.openweathermap.weather-api.language.option.fa = Persisch (Farsi) +bridge-type.config.openweathermap.weather-api.language.option.fi = Finnisch +bridge-type.config.openweathermap.weather-api.language.option.fr = Französisch +bridge-type.config.openweathermap.weather-api.language.option.gl = Galizisch +bridge-type.config.openweathermap.weather-api.language.option.hr = Kroatisch +bridge-type.config.openweathermap.weather-api.language.option.hu = Ungarisch +bridge-type.config.openweathermap.weather-api.language.option.it = Italienisch +bridge-type.config.openweathermap.weather-api.language.option.ja = Japanisch +bridge-type.config.openweathermap.weather-api.language.option.kr = Koreanisch +bridge-type.config.openweathermap.weather-api.language.option.la = Lettisch +bridge-type.config.openweathermap.weather-api.language.option.lt = Litauisch +bridge-type.config.openweathermap.weather-api.language.option.mk = Mazedonisch +bridge-type.config.openweathermap.weather-api.language.option.nl = Holländisch +bridge-type.config.openweathermap.weather-api.language.option.pl = Polnisch +bridge-type.config.openweathermap.weather-api.language.option.pt = Portugiesisch +bridge-type.config.openweathermap.weather-api.language.option.ro = Rumänisch +bridge-type.config.openweathermap.weather-api.language.option.ru = Russisch +bridge-type.config.openweathermap.weather-api.language.option.sk = Slowakisch +bridge-type.config.openweathermap.weather-api.language.option.sl = Slowenisch +bridge-type.config.openweathermap.weather-api.language.option.sw = Schwedisch +bridge-type.config.openweathermap.weather-api.language.option.tr = Türkisch +bridge-type.config.openweathermap.weather-api.language.option.ua = Ukrainisch +bridge-type.config.openweathermap.weather-api.language.option.vi = Vietnamesisch +bridge-type.config.openweathermap.weather-api.language.option.zh_cn = Chinesisch - Simplified +bridge-type.config.openweathermap.weather-api.language.option.zh_tw = Chinesisch - Traditional + +# thing types +thing-type.openweathermap.weather-and-forecast.label = Wetterinformationen +thing-type.openweathermap.weather-and-forecast.description = Ermöglicht die Anzeige der aktuellen Wetterinformationen und der Wettervorhersage. + +# thing types config +thing-type.config.openweathermap.weather-and-forecast.location.label = Ort der Wetterdaten +thing-type.config.openweathermap.weather-and-forecast.location.description = Ort der Wetterdaten in geographischen Koordinaten (Breitengrad/Längengrad/Höhe). + +thing-type.config.openweathermap.weather-and-forecast.forecastHours.label = Stunden +thing-type.config.openweathermap.weather-and-forecast.forecastHours.description = Anzahl der Stunden für die Wettervorhersage. + +thing-type.config.openweathermap.weather-and-forecast.forecastDays.label = Tage +thing-type.config.openweathermap.weather-and-forecast.forecastDays.description = Anzahl der Tage für die Wettervorhersage. + +# channel group types +channel-group-type.openweathermap.station.label = Wetterstation +channel-group-type.openweathermap.station.description = Fasst Daten über die Wetterstation oder den Ort zusammen. + +channel-group-type.openweathermap.current.label = Aktuelles Wetter +channel-group-type.openweathermap.current.description = Fasst aktuelle Wetterdaten zusammen. + +channel-group-type.openweathermap.hourlyForecast.label = 3 Stunden Wettervorhersage +channel-group-type.openweathermap.hourlyForecast.description = Fasst Daten der 5 Tage / 3 Stunden Wettervorhersage zusammen. + +channel-group-type.openweathermap.dailyForecast.label = Tägliche Wettervorhersage +channel-group-type.openweathermap.dailyForecast.description = Fasst Daten der 16 Tage / täglichen Wettervorhersage zusammen. + +# channel groups +thing-type.openweathermap.weather-and-forecast.group.forecastHours03.label = Wettervorhersage für 3 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours03.description = Fasst Daten der Wettervorhersage in den nächsten drei Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours06.label = Wettervorhersage für 6 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours06.description = Fasst Daten der Wettervorhersage in sechs Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours09.label = Wettervorhersage für 9 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours09.description = Fasst Daten der Wettervorhersage in neun Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours12.label = Wettervorhersage für 12 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours12.description = Fasst Daten der Wettervorhersage in zwölf Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours15.label = Wettervorhersage für 15 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours15.description = Fasst Daten der Wettervorhersage in 15 Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours18.label = Wettervorhersage für 18 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours18.description = Fasst Daten der Wettervorhersage in 18 Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours21.label = Wettervorhersage für 21 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours21.description = Fasst Daten der Wettervorhersage in 21 Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastHours24.label = Wettervorhersage für 24 Stunden +thing-type.openweathermap.weather-and-forecast.group.forecastHours24.description = Fasst Daten der Wettervorhersage in 24 Stunden zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastToday.label = Wettervorhersage für heute +thing-type.openweathermap.weather-and-forecast.group.forecastToday.description = Fasst Daten der heutigen Wettervorhersage zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastTomorrow.label = Wettervorhersage für morgen +thing-type.openweathermap.weather-and-forecast.group.forecastTomorrow.description = Fasst Daten der morgigen Wettervorhersage zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastDay2.label = Wettervorhersage für übermorgen +thing-type.openweathermap.weather-and-forecast.group.forecastDay2.description = Fasst Daten der übermorgigen Wettervorhersage zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastDay3.label = Wettervorhersage für 3 Tage +thing-type.openweathermap.weather-and-forecast.group.forecastDay3.description = Fasst Daten der Wettervorhersage in drei Tagen zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastDay4.label = Wettervorhersage für 4 Tage +thing-type.openweathermap.weather-and-forecast.group.forecastDay4.description = Fasst Daten der Wettervorhersage in vier Tagen zusammen. + +thing-type.openweathermap.weather-and-forecast.group.forecastDay5.label = Wettervorhersage für 5 Tage +thing-type.openweathermap.weather-and-forecast.group.forecastDay5.description = Fasst Daten der Wettervorhersage in fünf Tagen zusammen. + +# channel types +channel-type.openweathermap.station-id.label = Station-ID +channel-type.openweathermap.station-id.description = Zeigt die ID der Wetterstation oder des Ortes an. + +channel-type.openweathermap.station-name.label = Name +channel-type.openweathermap.station-name.description = Zeigt den Namen der Wetterstation oder des Ortes an. + +channel-group-type.openweathermap.station.channel.location.label = Ort +channel-group-type.openweathermap.station.channel.location.description = Zeigt den Ort der Wetterstation in geographischen Koordinaten (Breitengrad/Längengrad/Höhe) an. + +channel-type.openweathermap.time-stamp.label = Letzte Messung +channel-type.openweathermap.time-stamp.description = Zeigt den Zeitpunkt der letzten Messung an. +channel-type.openweathermap.time-stamp.state.pattern = %1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS + +channel-type.openweathermap.hourly-forecast-time-stamp.label = Vorhersage Zeit +channel-type.openweathermap.hourly-forecast-time-stamp.description = Zeigt den Zeitpunkt der Wettervorhersage an. +channel-type.openweathermap.hourly-forecast-time-stamp.state.pattern = %1$td.%1$tm.%1$tY %1$tH:%1$tM:%1$tS + +channel-type.openweathermap.daily-forecast-time-stamp.label = Vorhersage Datum +channel-type.openweathermap.daily-forecast-time-stamp.description = Zeigt das Datum der Wettervorhersage an. +channel-type.openweathermap.daily-forecast-time-stamp.state.pattern = %1$td.%1$tm.%1$tY + +channel-type.openweathermap.condition.label = Wetterlage +channel-type.openweathermap.condition.description = Zeigt die aktuelle Wetterlage an. + +channel-type.openweathermap.forecasted-condition.label = Vorhergesagte Wetterlage +channel-type.openweathermap.forecasted-condition.description = Zeigt die vorhergesagte Wetterlage an. + +channel-type.openweathermap.condition-id.label = Wetterlage-ID +channel-type.openweathermap.condition-id.description = Zeigt die ID der Wetterlage an. + +channel-type.openweathermap.condition-icon.label = Icon +channel-type.openweathermap.condition-icon.description = Zeigt das Icon der Wetterlage an. + +channel-type.openweathermap.forecasted-outdoor-temperature.label = Vorhergesagte Temperatur +channel-type.openweathermap.forecasted-outdoor-temperature.description = Zeigt die vorhergesagte Außentemperatur an. + +channel-type.openweathermap.forecasted-min-outdoor-temperature.label = Minimale Temperatur +channel-type.openweathermap.forecasted-min-outdoor-temperature.description = Zeigt die vorhergesagte minimale Außentemperatur an. + +channel-type.openweathermap.forecasted-max-outdoor-temperature.label = Maximale Temperatur +channel-type.openweathermap.forecasted-max-outdoor-temperature.description = Zeigt die vorhergesagte maximale Außentemperatur an. + +channel-type.openweathermap.forecasted-barometric-pressure.label = Vorhergesagter Luftdruck +channel-type.openweathermap.forecasted-barometric-pressure.description = Zeigt den vorhergesagten Luftdruck an. + +channel-type.openweathermap.forecasted-atmospheric-humidity.label = Vorhergesagte Luftfeuchtigkeit +channel-type.openweathermap.forecasted-atmospheric-humidity.description = Zeigt die vorhergesagte Luftfeuchtigkeit an. + +channel-type.openweathermap.forecasted-wind-speed.label = Vorhergesagte Windgeschwindigkeit +channel-type.openweathermap.forecasted-wind-speed.description = Zeigt die vorhergesagte Windgeschwindigkeit an. + +channel-type.openweathermap.forecasted-wind-direction.label = Vorhergesagte Windrichtung +channel-type.openweathermap.forecasted-wind-direction.description = Zeigt die vorhergesagte Windrichtung an. + +channel-type.openweathermap.gust-speed.label = Windböengeschwindigkeit +channel-type.openweathermap.gust-speed.description = Zeigt die aktuelle Windböengeschwindigkeit an. + +channel-type.openweathermap.forecasted-gust-speed.label = Vorhergesagte Windböengeschwindigkeit +channel-type.openweathermap.forecasted-gust-speed.description = Zeigt die vorhergesagte Windböengeschwindigkeit an. + +channel-type.openweathermap.cloudiness.label = Bewölkung +channel-type.openweathermap.cloudiness.description = Zeigt die aktuelle Bewölkung an. + +channel-type.openweathermap.forecasted-cloudiness.label = Vorhergesagte Bewölkung +channel-type.openweathermap.forecasted-cloudiness.description = Zeigt die vorhergesagte Bewölkung an. + +channel-type.openweathermap.rain.label = Regen +channel-type.openweathermap.rain.description = Zeigt den kumulierten Regen der letzten drei Stunden an. + +channel-type.openweathermap.forecasted-rain.label = Vorhergesagter Regen +channel-type.openweathermap.forecasted-rain.description = Zeigt den vorhergesagten, kumulierten Regen der nächsten drei Stunden an. + +channel-type.openweathermap.snow.label = Schnee +channel-type.openweathermap.snow.description = Zeigt den kumulierten Schnee der letzten drei Stunden an. + +channel-type.openweathermap.forecasted-snow.label = Vorhergesagter Schnee +channel-type.openweathermap.forecasted-snow.description = Zeigt den vorhergesagten, kumulierten Schnee der nächsten drei Stunden an. + +# thing status +offline.conf-error-missing-apikey = Der Parameter 'API Schlüssel' muss konfiguriert werden. +offline.conf-error-invalid-apikey = Ungültiger 'API Schlüssel'. Mehr Infos unter https://openweathermap.org/faq#error401. +offline.conf-error-not-supported-refreshInterval = Der Parameter 'Abfrageintervall' muss mindestens 10 min betragen. +offline.conf-error-not-supported-language = Der angegebene Parameter 'Sprache' wird nicht unterstützt. + +offline.conf-error-missing-location = Der Parameter 'Ort' muss konfiguriert werden. +offline.conf-error-parsing-location = Der Parameter 'Ort' kann nicht in Latitude und Longitude getrennt werden. +offline.conf-error-not-supported-number-of-hours = Der Parameter 'forecastHours' muss zwischen 0 und 120 liegen - Schrittweite: 3. +offline.conf-error-not-supported-number-of-days = Der Parameter 'forecastDays' muss zwischen 0 und 16 liegen. + +# discovery result +discovery.openweathermap.weather-and-forecast.api.local.label = Lokales Wetter und Wettervorhersage diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/bridge-types.xml b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/bridge-types.xml new file mode 100644 index 00000000000..1f8af9f6c9b --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/bridge-types.xml @@ -0,0 +1,17 @@ + + + + + + + Provides access to the OpenWeatherMap API. + + apikey + + + + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/channel-types.xml b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/channel-types.xml new file mode 100644 index 00000000000..b8abd07b55a --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/channel-types.xml @@ -0,0 +1,270 @@ + + + + + + + This is a weather station. + + + + + Location of the weather station or the city. + + + + + + + This is the current weather. + + + + + + + + + + + + + + + + + + + + This is the 5 day / 3 hour weather forecast. + + + + + + + + + + + + + + + + + + + + This is the 16 day / daily weather forecast. + + + + + + + + + + + + + + + + + + + + + String + + Id of the weather station or the city. + + + + + String + + Name of the weather station or the city. + + + + + DateTime + + Time of data observation. + Time + + + + + DateTime + + Time of data forecasted. + Time + + + + + DateTime + + Date of data forecasted. + Time + + + + + String + + Current weather condition. + Sun_Clouds + + + + + String + + Forecasted weather condition. + Sun_Clouds + + + + + String + + Id of the weather condition. + + + + + Image + + Icon representing the weather condition. + + + + + Number:Temperature + + Forecasted outdoor temperature. + Temperature + + + + + Number:Temperature + + Minimum forecasted outdoor temperature. + Temperature + + + + + Number:Temperature + + Maximum forecasted outdoor temperature. + Temperature + + + + + Number:Pressure + + Forecasted barometric pressure. + Pressure + + + + + Number:Dimensionless + + Forecasted atmospheric relative humidity. + Humidity + + + + + Number:Speed + + Forecasted wind speed. + Wind + + + + + Number:Angle + + Forecasted wind direction expressed as an angle. + Wind + + + + + Number:Speed + + Current gust speed. + Wind + + + + + Number:Speed + + Forecasted gust speed. + Wind + + + + + Number:Dimensionless + + Current cloudiness. + Clouds + + + + + Number:Dimensionless + + Forecasted cloudiness. + Clouds + + + + + Number:Length + + Rain volume for the last 3 hours. + Rain + + + + + Number:Length + + Forecasted rain volume for the next 3 hours. + Rain + + + + + Number:Length + + Snow volume for the last 3 hours. + Snow + + + + + Number:Length + + Forecasted snow volume for the next 3 hours. + Snow + + + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/thing-types.xml b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/thing-types.xml new file mode 100644 index 00000000000..008dd3e18c7 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/ESH-INF/thing/thing-types.xml @@ -0,0 +1,82 @@ + + + + + + + + + + + Provides current weather and forecast data from the OpenWeatherMap API. + + + + + + + This is the weather forecast for the next 3 hours. + + + + This is the weather forecast in 6 hours. + + + + This is the weather forecast in 9 hours. + + + + This is the weather forecast in 12 hours. + + + + This is the weather forecast in 15 hours. + + + + This is the weather forecast in 18 hours. + + + + This is the weather forecast in 21 hours. + + + + This is the weather forecast in 24 hours. + + + + This is the weather forecast for today. + + + + This is the weather forecast for tomorrow. + + + + This is the weather forecast in two days. + + + + This is the weather forecast in three days. + + + + This is the weather forecast in four days. + + + + This is the weather forecast in five days. + + + + location + + + + + diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/META-INF/MANIFEST.MF b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/META-INF/MANIFEST.MF new file mode 100644 index 00000000000..60598cf76d6 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/META-INF/MANIFEST.MF @@ -0,0 +1,37 @@ +Manifest-Version: 1.0 +Bundle-ActivationPolicy: lazy +Bundle-ClassPath: . +Bundle-ManifestVersion: 2 +Bundle-Name: Eclipse SmartHome OpenWeatherMap Binding +Bundle-RequiredExecutionEnvironment: JavaSE-1.8 +Bundle-SymbolicName: org.eclipse.smarthome.binding.openweathermap;singleton:=true +Bundle-Vendor: Eclipse.org/SmartHome +Bundle-Version: 0.10.0.qualifier +Import-Package: + com.google.gson, + com.google.gson.annotations, + javax.measure, + javax.measure.quantity, + org.apache.commons.lang, + org.eclipse.jdt.annotation;resolution:=optional, + org.eclipse.jetty.client, + org.eclipse.jetty.client.api, + org.eclipse.jetty.http, + org.eclipse.jetty.util, + org.eclipse.smarthome.config.core, + org.eclipse.smarthome.config.discovery, + org.eclipse.smarthome.core.cache, + org.eclipse.smarthome.core.i18n, + org.eclipse.smarthome.core.library.types, + org.eclipse.smarthome.core.library.unit, + org.eclipse.smarthome.core.thing, + org.eclipse.smarthome.core.thing.binding, + org.eclipse.smarthome.core.thing.binding.builder, + org.eclipse.smarthome.core.thing.type, + org.eclipse.smarthome.core.types, + org.eclipse.smarthome.io.net.http, + org.osgi.framework, + org.osgi.service.component, + org.slf4j +Service-Component: OSGI-INF/*.xml +Automatic-Module-Name: org.eclipse.smarthome.binding.openweathermap diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/NOTICE b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/NOTICE new file mode 100644 index 00000000000..b8675cd02e8 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/NOTICE @@ -0,0 +1,19 @@ +This content is produced and maintained by the Eclipse SmartHome project. + +* Project home: https://eclipse.org/smarthome/ + +== Declared Project Licenses + +This program and the accompanying materials are made available under the terms +of the Eclipse Public License 2.0 which is available at +https://www.eclipse.org/legal/epl-2.0/. + +== Source Code + +https://github.com/eclipse/smarthome + +== Copyright Holders + +See the NOTICE file distributed with the source code at +https://github.com/eclipse/smarthome/blob/master/NOTICE +for detailed information regarding copyright ownership. diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/OSGI-INF/.gitignore b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/OSGI-INF/.gitignore new file mode 100644 index 00000000000..6722cd96e78 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/OSGI-INF/.gitignore @@ -0,0 +1 @@ +*.xml diff --git a/extensions/binding/org.eclipse.smarthome.binding.openweathermap/README.md b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/README.md new file mode 100644 index 00000000000..0835df86797 --- /dev/null +++ b/extensions/binding/org.eclipse.smarthome.binding.openweathermap/README.md @@ -0,0 +1,269 @@ +--- +layout: documentation +--- + +{% include base.html %} + +# OpenWeatherMap Binding + +This binding integrates the [OpenWeatherMap weather API](https://openweathermap.org/api). + +## Supported Things + +There are two supported things. + +### OpenWeatherMap Account + +First one is a bridge `weather-api` which represents the OpenWeatherMap account. +The bridge holds the mandatory API key to access the OpenWeatherMap API and several global configuration parameters. +If your system language is supported by the OpenWeatherMap API it will be used as default language for the requested data. + +### Current Weather And Forecast + +The second thing `weather-and-forecast` supports the [current weather](https://openweathermap.org/current), [5 day / 3 hour forecast](https://openweathermap.org/forecast5) and optional [16 day / daily forecast](https://openweathermap.org/forecast16) services for a specific location. +It requires coordinates of the location of your interest. +You can add as many `weather-and-forecast` things for different locations to your setup as you like to observe. +**Attention**: The daily forecast is only available for [paid accounts](https://openweathermap.org/price). +The binding tries to request daily forecast data from the OpenWeatherMap API. +If the request fails, all daily forecast channel groups will be removed from the thing and further request will be omitted. + +## Discovery + +If a system location is set, a "Local Weather And Forecast" (`weather-and-forecast`) thing will be automatically discovered for this location. +Once the system location will be changed, the background discovery updates the configuration of "Local Weather And Forecast" accordingly. + +## Thing Configuration + +### OpenWeatherMap Account + +| Parameter | Description | +|-----------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| apikey | API key to access the OpenWeatherMap API. **Mandatory** | +| refreshInterval | Specifies the refresh interval (in minutes). Optional, the default value is 60, the minimum value is 10. | +| language | Language to be used by the OpenWeatherMap API. Optional, valid values are: `ar`, `bg`, `ca`, `de`, `el`, `en`, `es`, `fa`, `fi`, `fr`, `gl`, `hr`, `hu`, `it`, `ja`, `kr`, `la`, `lt`, `mk`, `nl`, `pl`, `pt`, `ro`, `ru`, `sk`, `sl`, `sw`, `tr`, `ua`, `vi`, `zh_cn`, `zh_tw`. | + +### Current Weather And Forecast + +| Parameter | Description | +|----------------|--------------------------------------------------------------------------------------------------------------------------------| +| location | Location of weather in geographical coordinates (latitude/longitude/altitude). **Mandatory** | +| forecastHours | Number of hours for hourly forecast. Optional, the default value is 24 (min="0", max="120", step="3"). | +| forecastDays | Number of days for daily forecast (including todays forecast). Optional, the default value is 6 (min="0", max="16", step="1"). | + +Once the parameters `forecastHours` or `forecastDays` will be changed, the available channel groups on the thing will be created or removed accordingly. + +## Channels + +### Station + +| Channel Group ID | Channel ID | Item Type | Description | +|------------------|------------|-----------|----------------------------------------------| +| station | id | String | Id of the weather station or the city. | +| station | name | String | Name of the weather station or the city. | +| station | location | Location | Location of the weather station or the city. | + +### Current Weather + +| Channel Group ID | Channel ID | Item Type | Description | +|------------------|-----------------|----------------------|---------------------------------------------------| +| current | time-stamp | DateTime | Time of data observation. | +| current | condition | String | Current weather condition. | +| current | condition-id | String | Id of the current weather condition. **Advanced** | +| current | icon | Image | Icon representing the current weather condition. | +| current | temperature | Number:Temperature | Current temperature. | +| current | pressure | Number:Pressure | Current barometric pressure. | +| current | humidity | Number:Dimensionless | Current atmospheric humidity. | +| current | wind-speed | Number:Speed | Current wind speed. | +| current | wind-direction | Number:Angle | Current wind direction. | +| current | gust-speed | Number:Speed | Current gust speed. **Advanced** | +| current | cloudiness | Number:Dimensionless | Current cloudiness. | +| current | rain | Number:Length | Rain volume for the last three hours. | +| current | snow | Number:Length | Snow volume for the last three hours. | + +### 3 Hour Forecast + +| Channel Group ID | Channel ID | Item Type | Description | +|--------------------------------------------------------|----------------|----------------------|------------------------------------------------------| +| forecastHours03, forecastHours06, ... forecastHours120 | time-stamp | DateTime | Time of data forecasted. | +| forecastHours03, forecastHours06, ... forecastHours120 | condition | String | Forecast weather condition. | +| forecastHours03, forecastHours06, ... forecastHours120 | condition-id | String | Id of the forecasted weather condition. **Advanced** | +| forecastHours03, forecastHours06, ... forecastHours120 | icon | Image | Icon representing the forecasted weather condition. | +| forecastHours03, forecastHours06, ... forecastHours120 | temperature | Number:Temperature | Forecasted temperature. | +| forecastHours03, forecastHours06, ... forecastHours120 | pressure | Number:Pressure | Forecasted barometric pressure. | +| forecastHours03, forecastHours06, ... forecastHours120 | humidity | Number:Dimensionless | Forecasted atmospheric humidity. | +| forecastHours03, forecastHours06, ... forecastHours120 | wind-speed | Number:Speed | Forecasted wind speed. | +| forecastHours03, forecastHours06, ... forecastHours120 | wind-direction | Number:Angle | Forecasted wind direction. | +| forecastHours03, forecastHours06, ... forecastHours120 | gust-speed | Number:Speed | Forecasted gust speed. **Advanced** | +| forecastHours03, forecastHours06, ... forecastHours120 | cloudiness | Number:Dimensionless | Forecasted cloudiness. | +| forecastHours03, forecastHours06, ... forecastHours120 | rain | Number:Length | Expected rain volume for the next 3 hours. | +| forecastHours03, forecastHours06, ... forecastHours120 | snow | Number:Length | Expected snow volume for the next 3 hours. | + +### Daily Forecast + +| Channel Group ID | Channel ID | Item Type | Description | +|------------------------------------------------------------------|-----------------|----------------------|------------------------------------------------------| +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | time-stamp | DateTime | Time of data forecasted. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | condition | String | Forecast weather condition. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | condition-id | String | Id of the forecasted weather condition. **Advanced** | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | icon | Image | Icon representing the forecasted weather condition. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | min-temperature | Number:Temperature | Minimum forecasted temperature of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | max-temperature | Number:Temperature | Maximum forecasted temperature of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | pressure | Number:Pressure | Forecasted barometric pressure. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | humidity | Number:Dimensionless | Forecasted atmospheric humidity. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | wind-speed | Number:Speed | Forecasted wind speed. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | wind-direction | Number:Angle | Forecasted wind direction. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | gust-speed | Number:Speed | Forecasted gust speed. **Advanced** | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | cloudiness | Number:Dimensionless | Forecasted cloudiness. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | rain | Number:Length | Expected rain volume of a day. | +| forecastToday, forecastTomorrow, forecastDay2, ... forecastDay16 | snow | Number:Length | Expected snow volume of a day. | + +## Full Example + +### Things + +demo.things + +```java +Bridge openweathermap:weather-api:api "OpenWeatherMap Account" [apikey="AAA", refreshInterval=30, language="de"] { + Thing weather-and-forecast local "Local Weather And Forecast" [location="XXX,YYY", forecastHours=0, forecastDays=7] + Thing weather-and-forecast miami "Weather And Forecast In Miami" [location="25.782403,-80.264563", forecastHours=24, forecastDays=0] +} +``` + +### Items + +demo.items + +```java +String localStationId "ID [%s]" { channel="openweathermap:weather-and-forecast:api:local:station#id" } +String localStationName "Name [%s]" { channel="openweathermap:weather-and-forecast:api:local:station#name" } +Location localStationLocation "Location [%2$s°N %3$s°E]" { channel="openweathermap:weather-and-forecast:api:local:station#location" } + +DateTime localLastMeasurement "Timestamp of last measurement [%1$tY-%1$tm-%1$tdT%1$tH:%1$tM:%1$tS]"