OH1.8: Wunderground config (ditch Yahoo)

Edit: I posted a more complete and up-to-date version here

I thought the default behavior of the loggers was to rotate the log file when it gets over 10 mg and only keep the last ten logs. You shouldn’t have had it fill up your SD card. It could have worn out your SD card with writes but it shouldn’t have filled it up.

Check your /var/lib/openhab2/etc/org.[I don’t remember].logger and look at the settings for the File appender near the bottom. It should define the log rotation problems.

Beyond that, I’ve not forgotten to come back and post. I don’t have my Gogs server back up but I realized I could clone from its files directly. So here is my config.

NOTES:

  • I don’t yet have condition icons configured
  • I don’t have a webview for weather

http.service

weatherConditions.url=http://api.wunderground.com/api/<api key>/conditions/q/pws:<weather station id>.json
weatherConditions.updateInterval=30000

weatherForecast.url=http://api.wunderground.com/api/<api key>/forecast/q/pws:<weather station id>.json
weatherForecast.updateInterval=30000

See the wunderground api for how to format if you use lat/long instead. You cna find the weather station ID by searching in the main wunderground site, click “Change Station”, and you will find the station ID in parens after the name of the station in the list.

Items

Number vWeather_Temp "Outside Temp [%.0f °F]"
    <temperature> (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.temp_f)]" }
    
String vWeather_Conditions "Current Conditions [%s]"
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.weather)]" }

Number vWeather_Humidity "Outside Humidity [%d%%]"
    <humidity> (gChart)
    { http="<[weatherConditions:420000:REGEX(.*\"relative_humidity\":\"(.*)%\".*)]" }
    
String vWeather_Wind "Wind [%s]"
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.wind_string)]" }
    
Number vWeather_Wind_MPH "Wind Speed [%.1f MPH]"
    (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.wind_mph)]" }
    
Number vWeather_Wind_Gusts "Wind Gusts [%.1f MPH]"
    (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.wind_gust_mph)]" }
    
Number vWeather_Pressure "Barometric Pressure [%.1f in]"
    <line> (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.pressure_in)]" }
    
String vWeather_Pressure_Trend "Barometric Pressure Trend [MAP(weather.map):%s]"
    <line>
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.pressure_trend)]" }
    
Number vWeather_Dewpoint "Dew Point [%.1f °F]"
    <temperature> (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.dewpoint_f)]" }
    
Number vWeather_Feel "Feels like [%.0f °F]"
    <temperature> (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.feelslike_f)]" }
    
Number vWeather_Visibility "Visibility [%.1f miles]"
    <sun_clouds>
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.visibility_mi)]" }
    
Number vWeather_SolarRad "Solar Radiation [%d]"
    <sun>
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.solarradiation)]" }

Number vWeather_UV "UV Index [%.1f]"
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.UV)]" }
    
Number vWeather_PrecipToday "Precipitation So Far [%.1f in]"
    <rain> (gChart)
    { http="<[weatherConditions:420000:JSONPATH($.current_observation.precip_today_in)]" }
    
String vWeather_Today_Conditions "Today Conditions [%s]"
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[0].conditions)]" }
    
Number vWeather_Today_TempHigh "Today High [%.0f °F]"
    <temperature>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[0].high.fahrenheit)]" }
    
Number vWeather_Today_TempLow "Today Low [%.0f °F]"
    <temperature>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[0].low.fahrenheit)]" }
    
Number vWeather_Today_QPF "Today Precip QPF [%.1f in]"
    <rain>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[0].qpf_allday.in)]" }
    
Number vWeather_Today_Snow "Today Snow [%.1f in]"
    <climate-on>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[0].snow_allday.in)]" }    

String vWeather_Tomorrow_Conditions "Tomorrow Conditions [%s]"
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[1].conditions)]" }
    
Number vWeather_Tomorrow_TempHigh "Tomorrow High [%.0f °F]"
    <temperature>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[1].high.fahrenheit)]" }
    
Number vWeather_Tomorrow_TempLow "Tomorrow Low [%.0f °F]"
    <temperature>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[1].low.fahrenheit)]" }
    
Number vWeather_Tomorrow_QPF "Tomorrow Precip QPF [%.1f in]"
    <rain>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[1].qpf_allday.in)]" }
    
Number vWeather_Tomorrow_Snow "Tomorrow Snow [%.1f in]"
    <climate-on>
    { http="<[weatherForecast:420000:JSONPATH($.forecast.simpleforecast.forecastday[1].snow_allday.in)]" }

And to save you some looking here are example JSON responses I saved in my .items files for reference. It is handy to not have to look the full format up every time.

Note I use a REGEX to strip the “%” off of the relative humidity value but use JSONPATH to pull the rest of the values.

// Example Conditions

{
  "response": {
    "version":"0.1",
    "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
    "features": {
      "conditions": 1
    }
      }
  , "current_observation": {
              "image": {
                "url":"http://icons.wxug.com/graphics/wu2/logo_130x80.png",
                "title":"Weather Underground",
                "link":"http://www.wunderground.com"
              },
              "display_location": {
                "full":"Monument, CO",
                "city":"Monument",
                "state":"CO",
                "state_name":"Colorado",
                "country":"US",
                "country_iso3166":"US",
                "zip":"80132",
                "magic":"1",
                "wmo":"99999",
                "latitude":"<latitude>",
                "longitude":"<longitude>",
                "elevation":"2126.6"
              },
              "observation_location": {
                "full":"Jackson Creek/ Baptist Road, Monument, Colorado",
                "city":"Jackson Creek/ Baptist Road, Monument",
                "state":"Colorado",
                "country":"",
                "country_iso3166":"US",
                "latitude":"<latitude>",
                "longitude":"<longitude>",
                "elevation":"7010 ft"
              },
              "estimated": {
              },
              "station_id":"<station id>",
              "observation_time":"Last Updated on January 15, 11:22 AM MST",
              "observation_time_rfc822":"Sun, 15 Jan 2017 11:22:39 -0700",
              "observation_epoch":"1484504559",
              "local_time_rfc822":"Sun, 15 Jan 2017 11:22:47 -0700",
              "local_epoch":"1484504567",
              "local_tz_short":"MST",
              "local_tz_long":"America/Denver",
              "local_tz_offset":"-0700",
              "weather":"Snow",
              "temperature_string":"29.3 F (-1.5 C)",
              "temp_f":29.3,
              "temp_c":-1.5,
              "relative_humidity":"86%",
              "wind_string":"Calm",
              "wind_dir":"East",
              "wind_degrees":89,
              "wind_mph":0.0,
              "wind_gust_mph":0,
              "wind_kph":0,
              "wind_gust_kph":0,
              "pressure_mb":"1017",
              "pressure_in":"30.03",
              "pressure_trend":"-",
              "dewpoint_string":"25.6 F (-3.6 C)",
              "dewpoint_f":25.6,
              "dewpoint_c":-3.6,
              "heat_index_string":"NA",
              "heat_index_f":"NA",
              "heat_index_c":"NA",
              "windchill_string":"NA",
              "windchill_f":"NA",
              "windchill_c":"NA",
              "feelslike_string":"29.3 F (-1.5 C)",
              "feelslike_f":"29.3",
              "feelslike_c":"-1.5",
              "visibility_mi":"4.0",
              "visibility_km":"6.4",
              "solarradiation":"77",
              "UV":"0.0","precip_1hr_string":"0.00 in (0.0 mm)",
              "precip_1hr_in":"0.00",
              "precip_1hr_metric":"0.0",
              "precip_today_string":"0.00 in (0 mm)",
              "precip_today_in":"0.00",
              "precip_today_metric":"0",
              "icon":"snow",
              "icon_url":"http://icons.wxug.com/i/c/k/snow.gif",
              "forecast_url":"http://www.wunderground.com/US/CO/Monument.html",
              "history_url":"http://www.wunderground.com/weatherstation/WXDailyHistory.asp?ID=<station id>",
              "ob_url":"http://www.wunderground.com/cgi-bin/findweather/getForecast?query=<latitude,longitude>",
              "nowcast":""
      }
}

// Example Forecast

{
  "response": {
    "version":"0.1",
    "termsofService":"http://www.wunderground.com/weather/api/d/terms.html",
    "features": {
      "forecast": 1
    }
      }
              ,
      "forecast":{
              "txt_forecast": {
                "date":"12:03 PM MST",
                "forecastday": [
                  {
                    "period":0,
                    "icon":"snow",
                    "icon_url":"http://icons.wxug.com/i/c/k/snow.gif",
                    "title":"Sunday",
                    "fcttext":"Occasional snow showers. Temps nearly steady in the low to mid 30s. Winds N at 10 to 15 mph. Chance of snow 50%.",
                    "fcttext_metric":"Occasional snow showers. High around 0C. Winds N at 15 to 25 km/h. Chance of snow 50%.",
                    "pop":"50"
                  }
                  ,
                  {
                    "period":1,
                    "icon":"nt_snow",
                    "icon_url":"http://icons.wxug.com/i/c/k/nt_snow.gif",
                    "title":"Sunday Night",
                    "fcttext":"Variable clouds with snow showers. Low near 25F. Winds NNW at 10 to 20 mph. Chance of snow 70%. Snowfall around one inch.",
                    "fcttext_metric":"Variably cloudy with snow showers. Low -4C. Winds NNW at 15 to 30 km/h. Chance of snow 60%. 2-3cm of snow expected.",
                    "pop":"70"
                  }
                  ,
                  {
                    "period":2,
                    "icon":"snow",
                    "icon_url":"http://icons.wxug.com/i/c/k/snow.gif",
                    "title":"Monday",
                    "fcttext":"Variable clouds and windy at times with snow showers. High 32F. Winds NNW at 20 to 30 mph. Chance of snow 70%. Snowfall around one inch.",
                    "fcttext_metric":"Windy early...occasional snow showers. High near 0C. Winds NNW at 25 to 40 km/h. Chance of snow 70%. Snow accumulations less than 2cm.",
                    "pop":"70"
                  }
                  ,
                  {
                    "period":3,
                    "icon":"nt_partlycloudy",
                    "icon_url":"http://icons.wxug.com/i/c/k/nt_partlycloudy.gif",
                    "title":"Monday Night",
                    "fcttext":"Cloudy skies early will become partly cloudy later at night. Low 17F. Winds WNW at 10 to 15 mph.",
                    "fcttext_metric":"Cloudy early with partial clearing expected late. Low -8C. Winds WNW at 15 to 25 km/h.",
                    "pop":"10"
                  }
                  ,
                  {
                    "period":4,
                    "icon":"clear",
                    "icon_url":"http://icons.wxug.com/i/c/k/clear.gif",
                    "title":"Tuesday",
                    "fcttext":"Sunny. High 47F. Winds WSW at 5 to 10 mph.",
                    "fcttext_metric":"Sunny skies. High 8C. Winds WSW at 10 to 15 km/h.",
                    "pop":"10"
                  }
                  ,
                  {
                    "period":5,
                    "icon":"nt_clear",
                    "icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
                    "title":"Tuesday Night",
                    "fcttext":"Clear skies. Low 23F. Winds WNW at 5 to 10 mph.",
                    "fcttext_metric":"Clear. Low around -5C. Winds WNW at 10 to 15 km/h.",
                    "pop":"0"
                  }
                  ,
                  {
                    "period":6,
                    "icon":"clear",
                    "icon_url":"http://icons.wxug.com/i/c/k/clear.gif",
                    "title":"Wednesday",
                    "fcttext":"Sunny. High 53F. Winds W at 5 to 10 mph.",
                    "fcttext_metric":"Sunny skies. High 12C. Winds WSW at 10 to 15 km/h.",
                    "pop":"0"
                  }
                  ,
                  {
                    "period":7,
                    "icon":"nt_clear",
                    "icon_url":"http://icons.wxug.com/i/c/k/nt_clear.gif",
                    "title":"Wednesday Night",
                    "fcttext":"A mostly clear sky. Low 29F. Winds WNW at 5 to 10 mph.",
                    "fcttext_metric":"A mostly clear sky. Low -1C. Winds WNW at 10 to 15 km/h.",
                    "pop":"0"
                  }
                ]
              },
              "simpleforecast": {
                "forecastday": [
                  {"date":{
                "epoch":"1484532000",
                "pretty":"7:00 PM MST on January 15, 2017",
                "day":15,
                "month":1,
                "year":2017,
                "yday":14,
                "hour":19,
                "min":"00",
                "sec":0,
                "isdst":"0",
                "monthname":"January",
                "monthname_short":"Jan",
                "weekday_short":"Sun",
                "weekday":"Sunday",
                "ampm":"PM",
                "tz_short":"MST",
                "tz_long":"America/Denver"
          },
                  "period":1,
                  "high": {
                    "fahrenheit":"32",
                    "celsius":"0"
                  },
                  "low": {
                    "fahrenheit":"25",
                    "celsius":"-4"
                  },
                  "conditions":"Snow Showers",
                  "icon":"snow",
                  "icon_url":"http://icons.wxug.com/i/c/k/snow.gif",
                  "skyicon":"",
                  "pop":50,
                  "qpf_allday": {
                    "in": 0.11,
                    "mm": 3
                  },
                  "qpf_day": {
                    "in": 0.00,
                    "mm": 0
                  },
                  "qpf_night": {
                    "in": 0.10,
                    "mm": 3
                  },
                  "snow_allday": {
                    "in": 1.1,
                    "cm": 2.8
                  },
                  "snow_day": {
                    "in": 0.0,
                    "cm": 0.0
                  },
                  "snow_night": {
                    "in": 1.0,
                    "cm": 2.5
                  },
                 "maxwind": {
                    "mph": 15,
                    "kph": 24,
                    "dir": "N",
                    "degrees": 349
                  },
                  "avewind": {
                    "mph": 11,
                    "kph": 18,
                    "dir": "N",
                    "degrees": 349
                  },
                  "avehumidity": 85,
                  "maxhumidity": 0,
                  "minhumidity": 0
                }
                ,
              {"date":{
      "epoch":"1484618400",
      "pretty":"7:00 PM MST on January 16, 2017",
      "day":16,
      "month":1,
      "year":2017,
      "yday":15,
      "hour":19,
      "min":"00",
      "sec":0,
      "isdst":"0",
      "monthname":"January",
      "monthname_short":"Jan",
      "weekday_short":"Mon",
      "weekday":"Monday",
      "ampm":"PM",
      "tz_short":"MST",
      "tz_long":"America/Denver"
},
              "period":2,
              "high": {
              "fahrenheit":"32",
              "celsius":"0"
              },
              "low": {
              "fahrenheit":"17",
              "celsius":"-8"
              },
              "conditions":"Snow Showers",
              "icon":"snow",
              "icon_url":"http://icons.wxug.com/i/c/k/snow.gif",
              "skyicon":"",
              "pop":70,
              "qpf_allday": {
              "in": 0.08,
              "mm": 2
              },
              "qpf_day": {
              "in": 0.08,
              "mm": 2
              },
              "qpf_night": {
              "in": 0.00,
              "mm": 0
              },
              "snow_allday": {
              "in": 0.8,
              "cm": 2.0
              },
              "snow_day": {
              "in": 0.8,
              "cm": 2.0
              },
              "snow_night": {
              "in": 0.0,
              "cm": 0.0
              },
              "maxwind": {
              "mph": 30,
              "kph": 48,
              "dir": "NNW",
              "degrees": 334
              },
              "avewind": {
              "mph": 20,
              "kph": 32,
              "dir": "NNW",
              "degrees": 334
              },
              "avehumidity": 77,
              "maxhumidity": 0,
              "minhumidity": 0
              }
              ,
              {"date":{
      "epoch":"1484704800",
      "pretty":"7:00 PM MST on January 17, 2017",
      "day":17,
      "month":1,
      "year":2017,
      "yday":16,
      "hour":19,
      "min":"00",
      "sec":0,
      "isdst":"0",
      "monthname":"January",
      "monthname_short":"Jan",
      "weekday_short":"Tue",
      "weekday":"Tuesday",
      "ampm":"PM",
      "tz_short":"MST",
      "tz_long":"America/Denver"
},
              "period":3,
              "high": {
              "fahrenheit":"47",
              "celsius":"8"
              },
              "low": {
              "fahrenheit":"23",
              "celsius":"-5"
              },
              "conditions":"Clear",
              "icon":"clear",
              "icon_url":"http://icons.wxug.com/i/c/k/clear.gif",
              "skyicon":"",
              "pop":10,
              "qpf_allday": {
              "in": 0.00,
              "mm": 0
              },
              "qpf_day": {
              "in": 0.00,
              "mm": 0
              },
              "qpf_night": {
              "in": 0.00,
              "mm": 0
              },
              "snow_allday": {
              "in": 0.0,
              "cm": 0.0
              },
              "snow_day": {
              "in": 0.0,
              "cm": 0.0
              },
              "snow_night": {
              "in": 0.0,
              "cm": 0.0
              },
              "maxwind": {
              "mph": 10,
              "kph": 16,
              "dir": "WSW",
              "degrees": 255
              },
              "avewind": {
              "mph": 9,
              "kph": 14,
              "dir": "WSW",
              "degrees": 255
              },
              "avehumidity": 45,
              "maxhumidity": 0,
              "minhumidity": 0
              }
              ,
              {"date":{
      "epoch":"1484791200",
      "pretty":"7:00 PM MST on January 18, 2017",
      "day":18,
      "month":1,
      "year":2017,
      "yday":17,
      "hour":19,
      "min":"00",
      "sec":0,
      "isdst":"0",
      "monthname":"January",
      "monthname_short":"Jan",
      "weekday_short":"Wed",
      "weekday":"Wednesday",
      "ampm":"PM",
      "tz_short":"MST",
      "tz_long":"America/Denver"
},
              "period":4,
              "high": {
              "fahrenheit":"53",
              "celsius":"12"
              },
              "low": {
              "fahrenheit":"29",
              "celsius":"-2"
              },
              "conditions":"Clear",
              "icon":"clear",
              "icon_url":"http://icons.wxug.com/i/c/k/clear.gif",
              "skyicon":"",
              "pop":0,
              "qpf_allday": {
              "in": 0.00,
              "mm": 0
              },
              "qpf_day": {
              "in": 0.00,
              "mm": 0
              },
              "qpf_night": {
              "in": 0.00,
              "mm": 0
              },
              "snow_allday": {
              "in": 0.0,
              "cm": 0.0
              },
              "snow_day": {
              "in": 0.0,
              "cm": 0.0
              },
              "snow_night": {
              "in": 0.0,
              "cm": 0.0
              },
              "maxwind": {
              "mph": 10,
              "kph": 16,
              "dir": "W",
              "degrees": 259
              },
              "avewind": {
              "mph": 8,
              "kph": 13,
              "dir": "W",
              "degrees": 259
              },
              "avehumidity": 37,
              "maxhumidity": 0,
              "minhumidity": 0
              }
              ]
              }
      }
}
2 Likes