Rick-Jongbloed / ricks-openhab-config

My own openhab configuration
1 stars 0 forks source link

Weather binding configuration incorrect #4

Closed Rick-Jongbloed closed 5 years ago

Rick-Jongbloed commented 5 years ago

Log: 2019-04-26 22:47:17.475 [INFO ] [vice.internal.HttpServiceFactoryImpl] - Binding bundle: [org.openhab.binding.weather_1.14.0.M1 [263]] to http service 2019-04-26 22:47:17.503 [WARN ] [eather.internal.common.WeatherConfig] - Provider with name 'Wunderground' not found. Check the binding config. 2019-04-26 22:47:17.506 [ERROR] [org.apache.felix.configadmin ] - [org.osgi.service.cm.ManagedService, org.osgi.service.event.EventHandler, id=425, bundle=263/mvn:org.openhab.binding/org.openhab.binding.weather/1.14.0.M1]: Updating property weather of configuration org.openhab.weather caused a problem: Provider with name 'Wunderground' not found. Check the binding config. org.osgi.service.cm.ConfigurationException: weather : Provider with name 'Wunderground' not found. Check the binding config. at org.openhab.binding.weather.internal.common.WeatherConfig.getProviderName(WeatherConfig.java:223) ~[?:?] at org.openhab.binding.weather.internal.common.WeatherConfig.parseApiKey(WeatherConfig.java:182) ~[?:?] at org.openhab.binding.weather.internal.common.WeatherConfig.parse(WeatherConfig.java:88) ~[?:?] at org.openhab.binding.weather.internal.bus.WeatherBinding.updated(WeatherBinding.java:82) ~[?:?] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updated(ManagedServiceTracker.java:189) ~[9:org.apache.felix.configadmin:1.9.10] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.updateService(ManagedServiceTracker.java:152) [9:org.apache.felix.configadmin:1.9.10] at org.apache.felix.cm.impl.helper.ManagedServiceTracker.provideConfiguration(ManagedServiceTracker.java:85) [9:org.apache.felix.configadmin:1.9.10] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.provide(ConfigurationManager.java:1113) [9:org.apache.felix.configadmin:1.9.10] at org.apache.felix.cm.impl.ConfigurationManager$ManagedServiceUpdate.run(ConfigurationManager.java:1069) [9:org.apache.felix.configadmin:1.9.10] at org.apache.felix.cm.impl.UpdateThread.run0(UpdateThread.java:138) [9:org.apache.felix.configadmin:1.9.10] at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:105) [9:org.apache.felix.configadmin:1.9.10] at java.lang.Thread.run(Thread.java:748) [?:?]

Rick-Jongbloed commented 5 years ago

Replaced weather1 binding with weatherunderground binding.

Rick-Jongbloed commented 5 years ago

Logger + appender:

Weatherunderground binding

Weatherunderground binding logger

log4j2.logger.Weatherunderground.name = org.openhab.binding.Weatherunderground log4j2.logger.Weatherunderground.level = DEBUG

log4j2.logger.Weatherunderground.level = INFO

log4j2.logger.Weatherunderground.additivity = false log4j2.logger.Weatherunderground.appenderRefs = Weatherunderground log4j2.logger.Weatherunderground.appenderRef.http.ref = WEATHERUNDERGROUND

Weatherunderground appender

log4j2.appender.WEATHERUNDERGROUND.name = WEATHERUNDERGROUND log4j2.appender.WEATHERUNDERGROUND.type = RollingRandomAccessFile log4j2.appender.WEATHERUNDERGROUND.fileName = ${openhab.logdir}/weatherunderground.log log4j2.appender.WEATHERUNDERGROUND.filePattern = ${openhab.logdir}/weatherunderground.log.%i log4j2.appender.WEATHERUNDERGROUND.immediateFlush = true log4j2.appender.WEATHERUNDERGROUND.append = true log4j2.appender.WEATHERUNDERGROUND.layout.type = PatternLayout log4j2.appender.WEATHERUNDERGROUND.layout.pattern = %d{dd-MMM-yyyy HH:mm:ss.SSS} [%-5.5p] [%-50.50c] - %m%n log4j2.appender.WEATHERUNDERGROUND.policies.type = Policies log4j2.appender.WEATHERUNDERGROUND.policies.size.type = SizeBasedTriggeringPolicy log4j2.appender.WEATHERUNDERGROUND.policies.size.size = 10MB log4j2.appender.WEATHERUNDERGROUND.strategy.type = DefaultRolloverStrategy log4j2.appender.WEATHERUNDERGROUND.strategy.max = 10

Rick-Jongbloed commented 5 years ago

Configuration at https://www.openhab.org/addons/bindings/weatherunderground/

Rick-Jongbloed commented 5 years ago

Lines removed from http binding

Weatherwunderground alternative http binding (current conditions)

weatherconditions.url=https://api.wunderground.com/api/-/conditions/q/52.405322,5.299563.json weatherconditions.updateInterval=360000

Weatherwunderground alternative http binding (forecast)

weatherforecast.url=https://api.wunderground.com/api/-/forecast/q/52.405322,5.299563.json weatherforecast.updateInterval=360000

Rick-Jongbloed commented 5 years ago

Weatherunderground is no more.... https://apicommunity.wunderground.com/weatherapi/topics/end-of-service-for-the-weather-underground-api

Rick-Jongbloed commented 5 years ago

Removed code from outdoor.items

// not valid anymore. need to use another example // // weather wunderground example from https://community.openhab.org/t/comprehensive-wunderground-using-http-binding-example/33267 // Number vWeather_Temp "Outside Temp [%.0f °F]" (g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:JSONPATH($.current_observation.temp_f)]" } // Number vWeather_Temp_Max "Max Outside Temp [%.0f °F]" (g_weather_underground) // Number vWeather_Temp_Min "Min Outside Temp [%.0f °F]" (g_weather_underground) // String vWeather_Conditions "Current Conditions [%s]" (g_weather_underground) { http="<[weatherConditions:360000:JSONPATH($.current_observation.weather)]" } // Switch vIsCloudy "Sunlight" (g_weather_underground) // Number vWeather_Humidity "Outside Humidity [%d%%]" ((g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:REGEX(.\"relative_humidity\":\"(.)%\".*)]" } // String vWeather_Wind "Wind [%s]" { http="<[weatherConditions:360000:JSONPATH($.current_observation.wind_string)]" } // Number vWeather_Wind_MPH "Wind Speed [%.1f MPH]" (g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:JSONPATH($.current_observation.wind_mph)]" } // Number vWeather_Wind_Gusts "Wind Gusts [%.1f MPH]" (g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:JSONPATH($.current_observation.wind_gust_mph)]" } // Number vWeather_Pressure "Barometric Pressure [%.1f in]" (g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:JSONPATH($.current_observation.pressure_in)]" } // String vWeather_Pressure_Trend "Barometric Pressure Trend [MAP(weather.map):%s]" (g_weather_underground) { http="<[weatherConditions:360000:JSONPATH($.current_observation.pressure_trend)]" } // Number vWeather_Dewpoint "Dew Point [%.1f °F]" (g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:JSONPATH($.current_observation.dewpoint_f)]" } // Number vWeather_Feel "Feels like [%.0f °F]" (g_weather_underground, g_chart, g_elastic_mqtt) { http="<[weatherConditions:360000:JSONPATH($.current_observation.feelslike_f)]" } // Number vWeather_Visibility "Visibility [%.1f miles]" (g_weather_underground) { http="<[weatherConditions:360000:JSONPATH($.current_observation.visibility_mi)]" } // Number vWeather_SolarRad "Solar Radiation [%d]" (g_weather_underground) { http="<[weatherConditions:360000:JSONPATH($.current_observation.solarradiation)]" }
// Number vWeather_UV "UV Index [JS(uv.js):%s]" (g_weather_underground) { http="<[weatherConditions:360000:JSONPATH($.current_observation.UV)]" } // Number vWeather_PrecipToday "Precipitation So Far [%.1f in]" (g_weather_underground, g_chart) { http="<[weatherConditions:360000:JSONPATH($.current_observation.precip_today_in)]" } // String vWeather_Today_Conditions "Today Conditions [%s]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[0].conditions)]" }
// Number vWeather_Today_TempHigh "Today High [%.0f °F]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[0].high.fahrenheit)]" }
// Number vWeather_Today_TempLow "Today Low [%.0f °F]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[0].low.fahrenheit)]" }
// Number vWeather_Today_QPF "Today Precip QPF [%.1f in]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[0].qpf_allday.in)]" } // Number vWeather_Today_Snow "Today Snow [%.1f in]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[0].snow_allday.in)]" }
// String vWeather_Tomorrow_Conditions "Tomorrow Conditions [%s]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[1].conditions)]" } // Number vWeather_Tomorrow_TempHigh "Tomorrow High [%.0f °F]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[1].high.fahrenheit)]" } // Number vWeather_Tomorrow_TempLow "Tomorrow Low [%.0f °F]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[1].low.fahrenheit)]" } // Number vWeather_Tomorrow_QPF "Tomorrow Precip QPF [%.1f in]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[1].qpf_allday.in)]" } // Number vWeather_Tomorrow_Snow "Tomorrow Snow [%.1f in]" (g_weather_underground) { http="<[weatherForecast:360000:JSONPATH($.forecast.simpleforecast.forecastday[1].snow_allday.in)]" }

Rick-Jongbloed commented 5 years ago

Transformed into ticket to add the same functionality via the old weather binding.

Rick-Jongbloed commented 5 years ago

created 030_weather_test.items, creating a change request to make it better

Rick-Jongbloed commented 5 years ago

however it's still not working. Created logger and appender

weather binding

weather binding logger

log4j2.logger.weather.name = org.openhab.binding.weather log4j2.logger.weather.level = TRACE

log4j2.logger.weather.level = INFO

log4j2.logger.weather.additivity = false log4j2.logger.weather.appenderRefs = weather log4j2.logger.weather.appenderRef.http.ref = WEATHER

weather binding appender

log4j2.appender.WEATHER.name = WEATHER log4j2.appender.WEATHER.type = RollingRandomAccessFile log4j2.appender.WEATHER.fileName = ${openhab.logdir}/weather.log log4j2.appender.WEATHER.filePattern = ${openhab.logdir}/weather.log.%i log4j2.appender.WEATHER.immediateFlush = true log4j2.appender.WEATHER.append = true log4j2.appender.WEATHER.layout.type = PatternLayout log4j2.appender.WEATHER.layout.pattern = %d{dd-MMM-yyyy HH:mm:ss.SSS} [%-5.5p] [%-50.50c] - %m%n log4j2.appender.WEATHER.policies.type = Policies log4j2.appender.WEATHER.policies.size.type = SizeBasedTriggeringPolicy log4j2.appender.WEATHER.policies.size.size = 10MB log4j2.appender.WEATHER.strategy.type = DefaultRolloverStrategy log4j2.appender.WEATHER.strategy.max = 10

Rick-Jongbloed commented 5 years ago

Got OpenWeatherMap, WeatherBit and ForecastIO (DarkSky) running and showing data. All bugs are fixed, will continue another time, this ticket can be closed.