Weather Min not showing

I am trying to show the Current, Min and Max temperatures on a sitemap and chart. Yet for some reason, the Min value is always the same as the Max value and the Min value is also not appearing in my chart. In my chart, the Min value should be a green line, yet is missing.

The items look like this

Group gWeather 	(All)
Number Weather_Chart_Period      "Weather Temps"

Number   Weather_Temperature    "Temperature [%.2f °F]"       (gWeather) {weather="locationId=home, type=temperature, property=current, unit=fahrenheit"}
Number   Weather_Temp_Min       "Temperature min [%.2f °F]" (gWeather)  {weather="locationId=home, type=temperature, property=min, unit=fahrenheit"}
Number   Weather_Temp_Max      "Temperature max [%.2f °F]"  (gWeather)  {weather="locationId=home, type=temperature, property=max, unit=fahrenheit"}

And the sitemap has:

Frame label="Weather" {
		Text item=Weather_Temperature valuecolor=[Weather_LastUpdate=="NULL"="lightgray",Weather_LastUpdate>90="lightgray",>25="orange",>15="green",>5="orange",<=5="blue"] {
			Frame {
				Text item=Weather_Temp_Max valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
				Text item=Weather_Temp_Min valuecolor=[>25="orange",>15="green",>5="orange",<=5="blue"]
				Text item=Weather_LastUpdate visibility=[Weather_LastUpdate>30] valuecolor=[Weather_LastUpdate>120="orange", Weather_LastUpdate>300="red"]
			Frame {
				Switch item=Weather_Chart_Period label="Chart Period" icon="chart" mappings=[0="Hour", 1="Day", 2="Week"]
				Chart item=gWeather period=h refresh=600 visibility=[Weather_Chart_Period==0]
				Chart item=gWeather period=D refresh=900 visibility=[Weather_Chart_Period==1, Weather_Chart_Period=="NULL"]
				Chart item=gWeather period=W refresh=3600 visibility=[Weather_Chart_Period==2]


If min and max are the same value, one line is hiding the other, so there is nothing wrong with the chart.
The problem has to be the “false” report for min or max. How are those determined? Are you getting ithem from a weather provider?If yes, turn on the logging for that (problably the weather binding, then “log:set DEBUG”). That way you can see what values are actually reported in the log and compare them with the ones displayed. If min and max are reported the same by the provider, there is nothing you can do besides switching the provider.

Yes, I’m using the Weather 1.1 binding and Yahoo for weather.

When I set the log to Debug, I see that some, but not all values are returning a Null value. It is currently showing a Null for the current temp, min, and max values. I know Yahoo may not have all items like pressureTrend, but the min and max should be showing up?

2017-11-28 16:24:52.799 [DEBUG] [nal.provider.AbstractWeatherProvider] - YAHOO[home]: Weather[Temperature[current=18.0,min=<null>,max=<null>,feel=15.994498698888341,dewpoint=<null>],Atmosphere[humidity=31,visibility=25.91,pressure=33525.26,pressureTrend=<null>,ozone=<null>,uvIndex=<null>],Clouds[percent=<null>],Condition[text=Sunny,lastUpdate=Tue Nov 28 16:24:52 EST 2017,observationTime=Tue Nov 28 16:24:00 EST 2017,id=32,icon=<null>,commonId=sunny],Precipitation[rain=0.0,snow=0.0,probability=<null>,total=<null>],Wind[speed=35.4,direction=SW,degree=215,gust=<null>,chill=64.0],Station[name=<null>,id=<null>,latitude=<null>,longitude=<null>,altitude=<null>],<null>]
2017-11-28 16:24:52.812 [DEBUG] [nal.provider.AbstractWeatherProvider] - YAHOO[home]: Forecast[day=0,Temperature[current=<null>,min=-1.0,max=18.0,feel=<null>,dewpoint=<null>],Atmosphere[humidity=<null>,visibility=<null>,pressure=<null>,pressureTrend=<null>,ozone=<null>,uvIndex=<null>],Clouds[percent=<null>],Condition[text=Mostly Sunny,lastUpdate=Tue Nov 28 16:24:52 EST 2017,observationTime=Tue Nov 28 00:00:00 EST 2017,id=34,icon=<null>,commonId=partly-cloudy-day],Precipitation[rain=0.0,snow=0.0,probability=<null>,total=<null>],Wind[speed=<null>,direction=<null>,degree=<null>,gust=<null>,chill=<null>],Station[name=<null>,id=<null>,latitude=<null>,longitude=<null>,altitude=<null>],<null>]

I also see this in the Event log. Is it possibly the Yahoo weather doesn’t report a Min Temp value?

2017-11-28 09:46:00.467 [vent.ItemStateChangedEvent] - Weather_Temp_Min changed from NULL to UNDEF

Yes, look for consecutive entries if all are showing the Null for min, you have your answer.

I wonder if this could be something with the Weather Binding or Something else. The current Min and Max are often reported as Null and when the do report, the Min value is always the same as the Max value.

I switched my weather over to used Wundergroud in the weather binding and get the same issue. In a sitemap, the Current Min and Max temp values are always the same. But I actually can’t even find the OpenHab log, and seeing this in the Event Log

2017-11-29 14:19:54.490 [vent.ItemStateChangedEvent] - Weather_Temp_Min changed from 41.18 to UNDEF
2017-11-29 14:19:54.522 [vent.ItemStateChangedEvent] - Weather_Temp_Max changed from UNDEF to 41.72
2017-11-29 14:19:54.523 [vent.ItemStateChangedEvent] - Weather_Temp_Min changed from UNDEF to 41.72

And my Items files look correct getting the Min and Max Values

Number   Weather_Temp_Min      "Temperature min [%.2f °F]"  (gWeather)  {weather="locationId=home, type=temperature, property=min, unit=fahrenheit"}
Number   Weather_Temp_Max      "Temperature max [%.2f °F]"  (gWeather)  {weather="locationId=home, type=temperature, property=max, unit=fahrenheit"}

I think I may try the actual wunderground_weather binding itself and see if that makes a difference.

Well. I found my issue/problem and once again… User Error!!!

It turns that my Min and Max Weather rule was not updating to rrdd4j correctly. So once I fixed that with the below, the min and max populated correctly.

rule "Set daily max and min temperature"
	Item Weather_Temperature changed or
		Time cron "0 0 0 * * ?" or
	System started
    val max = (Weather_Temperature.maximumSince(now.withTimeAtStartOfDay, "rrd4j").state as DecimalType).doubleValue
	  val min = (Weather_Temperature.minimumSince(now.withTimeAtStartOfDay, "rrd4j").state as DecimalType).doubleValue

if( max != null && min != null) {

In other words you are not using the max and min provided by the weather provided at all!

Well, perhaps I don’t understand the weather binding that well. I have the Min and Max items defined in an items file per the docs. Yet, the Min and Max values always reported the same as the value. Thus, I think perhaps the Min and Max value’s actually need to computed via rule and persistence?

If you interpret the Yahoo debug log lines you posted you’ll see how it operates. Its result for ‘weather’ line doesn’t have a min and max value just a ‘current’ which makes sense really because it not a forecast it’s the temperature right now, and the concept of what is the temperature right now doesn’t have a min/max it’s an absolute.

The ‘forecast’ line has a min and max value but no current because it’s a forecast so no absolute.

Not all weather providers are created equal so if you want to use Yahoo you have to understand it’s methods although the binding might still be doing some of the hard work for you. I’m not using Yahoo but my weather items for Min and Max have forecast=0 in them.

So you could make that change and remove the rule because you don’t need to calculate the min and max. But it also depends what you want your graph to be showing, clearly the forecasted min and max isn’t the same as plotting real values after the event, I guess it might show how accurate the forecast min/max was against actual.