diff --git a/bundles/binding/org.openhab.binding.weather/README.md b/bundles/binding/org.openhab.binding.weather/README.md index 6dff9cf2513..fd06169ecb5 100644 --- a/bundles/binding/org.openhab.binding.weather/README.md +++ b/bundles/binding/org.openhab.binding.weather/README.md @@ -4,8 +4,6 @@ The Weather binding collects current and forecast weather data from different pr ![](https://farm4.staticflickr.com/3946/15407522168_7ea34d51e1_o.png) -There is also a binding specifically openHAB 2 [here](https://www.openhab.org/addons/bindings/yahooweather/) for Yahoo! Weather. - ## Table of Contents @@ -42,7 +40,6 @@ Before you can use a weather provider, you need to register a free apikey on the The apikey for the different weather providers, at least one must be specified. > [Hamweather](http://hamweather.com) has two apikeys (client_id, secret_id). -> [Yahoo](https://weather.yahoo.com) does not need an apikey. | Property | Description | |---------------------------|-------------| @@ -63,9 +60,8 @@ You can specify multiple locations by repeating these properties with different | Property | Description | |----------------------------------------|-------------| | location.``.name | the name of the location, useful for displaying in html layouts (optional) | -| location.``.latitude | the latitude the weather is retrieved from (not required for Yahoo) | -| location.``.longitude | the longitude the weather is retrieved from (not required for Yahoo) | -| location.``.woeid | required for Yahoo, the numeric Where On Earth ID, found at end of your weather.yahoo.com URL | +| location.``.latitude | the latitude the weather is retrieved from | +| location.``.longitude | the longitude the weather is retrieved from | | location.``.provider | reference to a provider name | | location.``.language | the language of the weather condition text (see provider homepage for supported languages) | | location.``.updateInterval | the interval in minutes the weather is retrieved | @@ -75,13 +71,13 @@ You can specify multiple locations by repeating these properties with different ### Configuration Example -Let's display the current temperature and humidity in Salzburg (AT) from Yahoo. +Let's display the current temperature and humidity in Salzburg (AT). services/weather.cfg ``` location.home.woeid=547826 -location.home.provider=Yahoo +location.home.provider=ForecastIo location.home.language=de location.home.updateInterval=10 ``` @@ -93,8 +89,6 @@ Number Temperature "Temperature [%.2f °C]" {weather="locationId=home, typ Number Humidity "Humidity [%d %%]" {weather="locationId=home, type=atmosphere, property=humidity"} ``` -For Yahoo, you don't need an apikey, but you do need a woeid (which you can find as the numeric digits at the end of your weather.yahoo.com URL). The location has the locationId *home* and updates the weather data every 10 minutes. - In the items file, you reference the `` and the type and property to display (see below for more). Let's say you want to switch to another provider, ForecastIo. All you have to do is register your apikey, configure it, supply your latitude and longitude, and change the provider in your location: @@ -308,7 +302,6 @@ Each provider sends different forecast days. - WorldWeatherOnline: 5 days (0-4) - Wunderground: 10 days (0-9) - Hamweather: 5 days (0-4) -- Yahoo: 10 days (0-9) **Note:** If you omit the forecast property, the *current* conditions are shown, if you specify forecast=0, the forecast for *today* is shown. diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/LocationConfig.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/LocationConfig.java index 85425e6f50c..9097560dbac 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/LocationConfig.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/LocationConfig.java @@ -166,11 +166,7 @@ public boolean isValid() { return false; } - if (providerName == ProviderName.YAHOO) { - return woeid != null; - } else { - return latitude != null && longitude != null; - } + return latitude != null && longitude != null; } /** diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/WeatherConfig.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/WeatherConfig.java index 3044bc77edb..f5d96f543d2 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/WeatherConfig.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/common/WeatherConfig.java @@ -37,18 +37,16 @@ * #weather:apikey2.Hamweather= * * # location configuration, you can specify multiple locations - * #weather:location..latitude= (not required for Yahoo provider) - * #weather:location..longitude= (not required for Yahoo provider) + * #weather:location..latitude= + * #weather:location..longitude= * #weather:location..provider= - * #weather:location..woeid= (required for Yahoo provider) * #weather:location..language= * #weather:location..updateInterval= (optional, defaults to 240) * #weather:location..units= (optional; defaults to "si") * - * #weather:location..latitude= (not required for Yahoo provider) - * #weather:location..longitude= (not required for Yahoo provider) + * #weather:location..latitude= + * #weather:location..longitude= * #weather:location..provider= - * #weather:location..woeid= (required for Yahoo provider) * #weather:location..language= * #weather:location..updateInterval= (optional, defaults to 240) * #weather:location..units= (optional; defaults to "si") @@ -100,7 +98,7 @@ public void parse(Dictionary properties) throws ConfigurationExceptio "Incomplete location config for locationId '" + lc.getLocationId() + "'. Check openhab.cfg."); } - if (lc.getProviderName() != ProviderName.YAHOO && !providerConfigs.containsKey(lc.getProviderName())) { + if (!providerConfigs.containsKey(lc.getProviderName())) { parseCompleted = true; logger.warn("No apikey found for provider '{}'. Check openhab.cfg.", lc.getProviderName()); throw new ConfigurationException("weather", diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Atmosphere.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Atmosphere.java index 3a2cbbea644..368ecf6a861 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Atmosphere.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Atmosphere.java @@ -28,7 +28,6 @@ public class Atmosphere { @Provider(name = ProviderName.OPENWEATHERMAP, property = "humidity"), @Provider(name = ProviderName.FORECASTIO, property = "humidity", converter = ConverterType.FRACTION_INTEGER), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "humidity"), - @Provider(name = ProviderName.YAHOO, property = "atmosphere.humidity"), @Provider(name = ProviderName.HAMWEATHER, property = "humidity"), @Provider(name = ProviderName.METEOBLUE, property = "relative_humidity_avg") }) private Integer humidity; @@ -37,7 +36,6 @@ public class Atmosphere { @Provider(name = ProviderName.WUNDERGROUND, property = "current_observation.visibility_km"), @Provider(name = ProviderName.FORECASTIO, property = "visibility"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "visibility"), - @Provider(name = ProviderName.YAHOO, property = "atmosphere.visibility"), @Provider(name = ProviderName.HAMWEATHER, property = "visibilityKM") }) private Double visibility; @@ -46,7 +44,6 @@ public class Atmosphere { @Provider(name = ProviderName.OPENWEATHERMAP, property = "pressure"), @Provider(name = ProviderName.FORECASTIO, property = "pressure"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "pressure"), - @Provider(name = ProviderName.YAHOO, property = "atmosphere.pressure"), @Provider(name = ProviderName.HAMWEATHER, property = "pressureMB"), @Provider(name = ProviderName.METEOBLUE, property = "pressure_hpa") }) private Double pressure; diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Condition.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Condition.java index de787a13ebe..0eb96357f9d 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Condition.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Condition.java @@ -31,7 +31,6 @@ public class Condition { @Provider(name = ProviderName.FORECASTIO, property = "currently.summary"), @Provider(name = ProviderName.FORECASTIO, property = "daily.data.summary"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "weatherDesc.value"), - @Provider(name = ProviderName.YAHOO, property = "text"), @Provider(name = ProviderName.HAMWEATHER, property = "weather") }) private String text; @@ -42,8 +41,6 @@ public class Condition { @Provider(name = ProviderName.FORECASTIO, property = "time", converter = ConverterType.UNIX_DATE), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "localObsDateTime", converter = ConverterType.UTC_DATE), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "date", converter = ConverterType.DATE), - @Provider(name = ProviderName.YAHOO, property = "lastBuildDate", converter = ConverterType.FULL_UTC_DATE), - @Provider(name = ProviderName.YAHOO, property = "forecast.date", converter = ConverterType.SIMPLE_DATE), @Provider(name = ProviderName.HAMWEATHER, property = "ob.timestamp", converter = ConverterType.UNIX_DATE), @Provider(name = ProviderName.HAMWEATHER, property = "periods.timestamp", converter = ConverterType.UNIX_DATE), @Provider(name = ProviderName.METEOBLUE, property = "last_model_update", converter = ConverterType.JSON_DATE) }) @@ -51,7 +48,6 @@ public class Condition { @ProviderMappings({ @Provider(name = ProviderName.OPENWEATHERMAP, property = "weather.id"), - @Provider(name = ProviderName.YAHOO, property = "code"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "weatherCode"), @Provider(name = ProviderName.HAMWEATHER, property = "weatherPrimaryCoded", converter = ConverterType.MULTI_ID), @Provider(name = ProviderName.METEOBLUE, property = "pictocode"), diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/ProviderName.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/ProviderName.java index acec0aec830..345c64a698a 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/ProviderName.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/ProviderName.java @@ -19,7 +19,6 @@ public enum ProviderName { OPENWEATHERMAP, FORECASTIO, WORLDWEATHERONLINE, - YAHOO, HAMWEATHER, METEOBLUE; @@ -37,8 +36,6 @@ public static ProviderName parse(String name) { return FORECASTIO; } else if (WORLDWEATHERONLINE.toString().equalsIgnoreCase(name)) { return WORLDWEATHERONLINE; - } else if (YAHOO.toString().equalsIgnoreCase(name)) { - return YAHOO; } else if (HAMWEATHER.toString().equalsIgnoreCase(name)) { return HAMWEATHER; } else if (METEOBLUE.toString().equalsIgnoreCase(name)) { diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Temperature.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Temperature.java index c76637ac70f..4bc8a5b491c 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Temperature.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Temperature.java @@ -27,7 +27,6 @@ public class Temperature { @Provider(name = ProviderName.OPENWEATHERMAP, property = "temp.day"), @Provider(name = ProviderName.FORECASTIO, property = "currently.temperature"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "temp_C"), - @Provider(name = ProviderName.YAHOO, property = "condition.temp"), @Provider(name = ProviderName.HAMWEATHER, property = "tempC"), @Provider(name = ProviderName.METEOBLUE, property = "temperature") }) private Double current; @@ -38,7 +37,6 @@ public class Temperature { @Provider(name = ProviderName.OPENWEATHERMAP, property = "temp.min"), @Provider(name = ProviderName.FORECASTIO, property = "temperatureMin"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "tempMinC"), - @Provider(name = ProviderName.YAHOO, property = "forecast.low"), @Provider(name = ProviderName.HAMWEATHER, property = "minTempC"), @Provider(name = ProviderName.METEOBLUE, property = "temperature_min") }) private Double min; @@ -49,7 +47,6 @@ public class Temperature { @Provider(name = ProviderName.OPENWEATHERMAP, property = "temp.max"), @Provider(name = ProviderName.FORECASTIO, property = "temperatureMax"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "tempMaxC"), - @Provider(name = ProviderName.YAHOO, property = "forecast.high"), @Provider(name = ProviderName.HAMWEATHER, property = "maxTempC"), @Provider(name = ProviderName.METEOBLUE, property = "temperature_max") }) private Double max; diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Weather.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Weather.java index 591994daebc..9e2c0e7b51f 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Weather.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Weather.java @@ -45,7 +45,6 @@ public class Weather { @Provider(name = ProviderName.OPENWEATHERMAP, property = "message"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "data.error.msg"), @Provider(name = ProviderName.WUNDERGROUND, property = "response.error.type"), - @Provider(name = ProviderName.YAHOO, property = "error.description"), @Provider(name = ProviderName.METEOBLUE, property = "error_message") }) private String error; @@ -58,7 +57,6 @@ public class Weather { @Forecast(provider = ProviderName.WUNDERGROUND, property = "forecast.simpleforecast.forecastday"), @Forecast(provider = ProviderName.FORECASTIO, property = "daily.data"), @Forecast(provider = ProviderName.WORLDWEATHERONLINE, property = "data.weather"), - @Forecast(provider = ProviderName.YAHOO, property = "query.results.channel.item.forecast"), @Forecast(provider = ProviderName.HAMWEATHER, property = "response.responses.response.periods"), @Forecast(provider = ProviderName.METEOBLUE, property = "forecast") }) private List forecast = new ArrayList(); diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Wind.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Wind.java index f5ee6a9538e..4fbedf8ffc9 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Wind.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/model/Wind.java @@ -29,7 +29,6 @@ public class Wind { @Provider(name = ProviderName.OPENWEATHERMAP, property = "speed", converter = ConverterType.WIND_MPS), @Provider(name = ProviderName.FORECASTIO, property = "windSpeed", converter = ConverterType.WIND_MPS), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "windspeedKmph"), - @Provider(name = ProviderName.YAHOO, property = "wind.speed"), @Provider(name = ProviderName.HAMWEATHER, property = "windSpeedKPH"), @Provider(name = ProviderName.METEOBLUE, property = "wind_speed"), @Provider(name = ProviderName.METEOBLUE, property = "wind_speed_max") }) @@ -46,7 +45,6 @@ public class Wind { @Provider(name = ProviderName.OPENWEATHERMAP, property = "deg"), @Provider(name = ProviderName.FORECASTIO, property = "windBearing"), @Provider(name = ProviderName.WORLDWEATHERONLINE, property = "winddirDegree"), - @Provider(name = ProviderName.YAHOO, property = "wind.direction"), @Provider(name = ProviderName.HAMWEATHER, property = "windDirDEG") }) private Integer degree; @@ -60,7 +58,6 @@ public class Wind { private Double gust; @ProviderMappings({ - @Provider(name = ProviderName.YAHOO, property = "wind.chill"), @Provider(name = ProviderName.WUNDERGROUND, property = "windchill_c"), @Provider(name = ProviderName.HAMWEATHER, property = "windchillC") }) private Double chill; diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/WeatherProviderFactory.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/WeatherProviderFactory.java index c1adb66a4ae..d050fc33a14 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/WeatherProviderFactory.java +++ b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/WeatherProviderFactory.java @@ -29,7 +29,6 @@ public class WeatherProviderFactory { weatherProviders.put(ProviderName.OPENWEATHERMAP, OpenWeatherMapProvider.class); weatherProviders.put(ProviderName.WORLDWEATHERONLINE, WorldWeatherOnlineProvider.class); weatherProviders.put(ProviderName.WUNDERGROUND, WundergroundProvider.class); - weatherProviders.put(ProviderName.YAHOO, YahooProvider.class); weatherProviders.put(ProviderName.METEOBLUE, MeteoBlueProvider.class); } diff --git a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/YahooProvider.java b/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/YahooProvider.java deleted file mode 100644 index 2adc217e3a1..00000000000 --- a/bundles/binding/org.openhab.binding.weather/src/main/java/org/openhab/binding/weather/internal/provider/YahooProvider.java +++ /dev/null @@ -1,44 +0,0 @@ -/** - * Copyright (c) 2010-2016 by the respective copyright holders. - * - * All rights reserved. This program and the accompanying materials - * are made available under the terms of the Eclipse Public License v1.0 - * which accompanies this distribution, and is available at - * http://www.eclipse.org/legal/epl-v10.html - */ -package org.openhab.binding.weather.internal.provider; - -import org.openhab.binding.weather.internal.model.ProviderName; -import org.openhab.binding.weather.internal.parser.JsonWeatherParser; - -/** - * Yahoo weather provider. - * - * @author Gerhard Riegler - * @since 1.6.0 - */ -public class YahooProvider extends AbstractWeatherProvider { - // SELECT * FROM weather.forecast WHERE woeid='[WOEID]' - private static final String URL = "http://query.yahooapis.com/v1/public/yql?format=json&q=SELECT%20*%20FROM%20weather.forecast%20WHERE%20u%3D'c'%20AND%20woeid%20%3D%20'[WOEID]'"; - - public YahooProvider() { - super(new JsonWeatherParser()); - } - - /** - * {@inheritDoc} - */ - @Override - public ProviderName getProviderName() { - return ProviderName.YAHOO; - } - - /** - * {@inheritDoc} - */ - @Override - protected String getWeatherUrl() { - return URL; - } - -} diff --git a/bundles/binding/org.openhab.binding.weather/src/main/resources/weather/common-id-mappings.xml b/bundles/binding/org.openhab.binding.weather/src/main/resources/weather/common-id-mappings.xml index 0917bb0c41a..11a8640fec1 100644 --- a/bundles/binding/org.openhab.binding.weather/src/main/resources/weather/common-id-mappings.xml +++ b/bundles/binding/org.openhab.binding.weather/src/main/resources/weather/common-id-mappings.xml @@ -1,7 +1,6 @@ - @@ -10,34 +9,28 @@ - - - - - - @@ -45,13 +38,11 @@ - - @@ -60,23 +51,19 @@ - - - - @@ -85,19 +72,16 @@ - - - @@ -106,17 +90,14 @@ - - - @@ -125,21 +106,17 @@ - - - - @@ -148,12 +125,10 @@ - - @@ -162,27 +137,20 @@ - - - - - - -