I am having some trouble reproducing min and max temperature as is done in the openhab demo by Kai
I am literally using his code just with a different town.
The temperature is displayed correctly, but the min and max temperature just follow the current temperature.
i have defined my items as follows: (but it is literally from the demo file
items:
Number Weather_Temperature "Buitentemperatuur [%.1f °C]" <temperature> (Weather, Weather_Chart) { channel="yahooweather:weather:Amsterdam:temperature" }
Number Weather_Temp_Max "Todays Maximum [%.1f °C]" <temperature> (Weather, Weather_Chart)
Number Weather_Temp_Min "Todays Minimum [%.1f °C]" <temperature> (Weather, Weather_Chart)
the sitemap looks like this (again, literally from the demo file)
Sitemap
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"]
and my rule looks like this (also literally from the demo file)
rulesfile:
rule "Set daily max and min temperature"
when
Item Weather_Temperature changed or
Time cron "0 0 0 * * ?" or
System started
then
val max = Weather_Temperature.maximumSince(now.withTimeAtStartOfDay)
val min = Weather_Temperature.minimumSince(now.withTimeAtStartOfDay)
if( max != null && min != null) {
postUpdate(Weather_Temp_Max, max.state)
postUpdate(Weather_Temp_Min, min.state)
}
end
In one post I came across the suggestion to define the rule like this:
.....(now.withTimeAtStartOfDay).state
but that just makes the min and max not change at all anymore
Obviously I am overlooking something.
can anybody point me in the right direction?