Get min (smallest) Value from last 30 min from Weatherstation

Hi, I have the following question and unfortunately have not found anything.

About my problem. I have a weather station that unfortunately has strange temperature jumps in the morning from time to time. Unfortunately can not find out why. However.
I have a rule that brings down my blinds at a certain temperature. Now I want to create an item which gives me the MIN value of the last half hour. And based on this I want to control my blinds. (Actually makes more sense than the direct temperature value of the weather station in my opinion).

Does anyone know (preferably with an example) how I get these values and assign them to the item? I will certainly not be the first with such an idea.

Thanks and in advance a still pleasant weekend.

I think you are looking for the <item>.minimumSince(ZonedDateTime)
function.

You can get the lowest value and post update it to another item.

1 Like

Thanks a lot, is there an example how to use ?

Should be looking like this:


rule "lowest temp 15min"
when
  Item YourTempItem received update
then

  sendCommand(ItemLowestTemp, YourTempItem.minimumSince(now.minusMinutes(15)))
  
end

1 Like

Thanks a lot, i will try

Hi i get an error:
Type missmatch: Cannot convert from historicItem to command

this is the code:

sendCommand(TempAvarageWeatherStation, WeatherCompanyObservations_Temperature.minimumSince(now.minusMinutes(30)))

normaly i use the actual temp like that:
var ActualTemp = (WeatherCompanyObservations_Temperature.state as QuantityType).doubleValue

Any idea ?

I am only guessing, but maybe you have to change the sendCommand to postUpdate?

minimumSince() returns a historicItem type object. This has state and timestamp information. You’d be interested in the state part.

TempAvarageWeatherStation.postUpdate(WeatherCompanyObservations_Temperature.minimumSince(now.minusMinutes(30).state.toString)

Sure about the spelling of TempAvarageWeatherStation ? Sure about the name at all - that’s not an average. You can get an average if you prefer.

1 Like

:smiley: , yes you are right. First i wanted to use the avarage, i created the member and after that i saw the min function. so sure i will relace the name. :wink:

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.