Unexpectedly High Value from sumSince() After Upgrade to OH5

Hi everyone,

After upgrading from OpenHAB 4 to 5, I’ve encountered a strange issue with a database query using sumSince().

Here’s the line of code I’m using:

val base = now.withMonth(1).withDayOfMonth(1).withHour(0).withMinute(0).withSecond(0).withNano(0)

var Number SolarProd = (SE_day_production.sumSince(base.withYear(2020).withMonth(5))) as QuantityType<Energy>

Before the update, this returned reasonable values. But now, the result is way too high. OpenHAB reports:

80485106430.1 W

However, when I manually check the database, I get:

22356.974 W

That’s a massive discrepancy. I’ve double-checked the persistence data and the timestamps, and everything looks fine on the database side.

Has anyone else seen this behavior after upgrading to OH5? Could this be a change in how QuantityType is handled, or maybe a unit conversion issue?

Any tips or ideas would be greatly appreciated!

Thanks in advance,
Tit

Here are a few additional comments.
I use Maria DB and the number format uses a period for decimal separation.
9.43 W = 9,43 W