I don’t have a “Maximum wind gust of the day” rule, you do. We can try to help you with it.
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
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)
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.