Dimensional number - how to get just value?

Hi,
with OH3 i’ve started to use dimensional interpretation of the numbers, but is eems to be more harsh than goodie.

If I have

Number:Temperature      Weather_Temperature         "Air [%.1f°]"           <temperature>

How in the rules I get just value without °C ?
both of this returns xy °C instead of xy so rules based on values are not working

val Temperature = (Weather_Temperature.state as QuantityType<Temperature>) 
val Temperature = (Weather_Temperature.state as Number) 

Tips

thanks… sounds like I’ll drop dimension number at all as it has no added value to me only more complicated rules everywhere.

You can’t just ignore it. Many bindings supply Quantity types as values to Items. It’s not hard to deal with, just requires care.

If you are having trouble with that particular Item, it may be because there’s an invalid default unit in the [state presentation].

Maybe [%.1f°C] ?
I honestly don’t know what knock-on effects that has. ° would be a valid unit for a Number:Angle but not a Number:Temperature, so it might cause weird effects.

because i know am in Celsius … so i’m not bothered by ° instead of °C and it looks better, but that’s just textual interpratition after number, when using dimensions I don’t even need this f° in the text fields… that’s from OH 2.5.

I’m not giving up, but honestly system should work with dimensions better than currently is … so when i’m comparing NUMBER (no matter if dimensionless or dimension) it should work just with a number and not with unit. It does not make any sense unless on the final displayment…

Well, you can’t compare apples and oranges.
Is 300 W < 0.5 ? Nobody knows. 300W < 0.5 kW is easy, but so much more bother to type.

The trouble is that [%.1f°] is NOT just used for cosmetic display purpose. It’s been purposed as well for default units for that Item. If the Item is a Quantity type, a Number:xxx type, then the framework will look at [state presentation] for a default unit.
I’m pretty sure it ignores nonsense like “bananas” but I don’t know what it does if it finds a valid unit like ° but that unit is not suitable for the Quantity type in question.