# maximumSince does not show highest value

**URL:** <https://community.openhab.org/t/maximumsince-does-not-show-highest-value/134758>\
**Category:** Scripts & Rules\
**Tags:** rules, openhab3\
**Created:** [April 2, 2022, 3:54pm UTC](https://community.openhab.org/t/maximumsince-does-not-show-highest-value/134758 "2022-04-02T15:54:40Z")\
**Posts on this page:** 1\
**Showing post:** 20

<div class="post-metadata">

**Author:** ![rossko57](https://community.openhab.org/user_avatar/community.openhab.org/rossko57/32/70263_2.png) [@rossko57](https://community.openhab.org/u/rossko57)\
**Post date:** [April 6, 2022, 4:08pm UTC](https://community.openhab.org/t/maximumsince-does-not-show-highest-value/134758/20 "2022-04-06T16:08:57Z")

</div>

> [@maxheartrate](#):
>
> for your “Maximum wind gust of the day” rule:

I don’t have a “Maximum wind gust of the day” rule, you do. We can try to help you with it.

> [@maxheartrate](#):
>
> This is the log error I receive for my 5 minute rule:

Yes. As discussed, `maximumSince()` returns a complex object - which cannot be cast as a Number.  
You’d want to look at its `state` component.

Seeing as you are investigating weirdness, you might find it useful to get the timestamp component as well - which record did it retrieve for you?

Maybe

```auto
var Wind_Max5 = AT_Dachflache_Wind.maximumSince(now.minusMinutes(5), "jdbc")
// this is NOT a number, you cannot beat it into a number shape
// you have to look at its parts
logInfo ("Wind Maximumsince5","Maximum Wind was: " + Wind_Max5.state.toString)    
logInfo ("Wind Maximumsince5","Maximum Wind occurred at " + Wind_Max5.getTimestamp.toString)    

```

> [@maxheartrate](#):
>
> `AT_Dachflache_Wind_Max5.postUpdate( ... )`  
> `logInfo ("Wind Maximumsince5","Maximum Wind was: " + AT_Dachflache_Wind_Max5.state` … )

It has not sunk in about postUpdate() being asynchronous.  
Fetching the state of this Item will get the “old” state, because the postUpdate() in the preceding line has almost certainly not completed yet.

---

_[View the full topic](https://community.openhab.org/t/maximumsince-does-not-show-highest-value/134758)._
