OH3 Rules DSL Calculation for kWh - UoM?

It’s the “as Number” that caused your issue, by treating the Quantity Type values as plain Number values you lost the magic units-of-measurement handling capability.

More about this here, tips’n’tricks for Quantity types -