Wrong Luminance Value

Hi,

i have several Aeon Labs (Aeotec) ZW100 Multisensor 6 items. Since i upgraded to OH 2.4 i’m having problems with my rules.

When a sensor detects motion i’m checking the luminance value of the item to check if the light i necessary or not.

One of my rules:

rule “Kitchen Light ON”

when

Item MultiSensor_Kitchen_MotionAlarm changed from OFF to ON
then
if (MultiSensor_Kitchen_SensorLuminance.state < 30 && now.getHourOfDay >= 7 && now.getHourOfDay < 20)
{
Switch_Light_Kitchen_Switch1.sendCommand(ON)
}
end

before the upgrade i got the plain number value with “MultiSensor_Kitchen_SensorLuminance.state”. Now i also receive the unit as postfix (i’ve seen this when i’ve send the state value via telegram -> 18 % was the value).

Why i’m getting “18 %” instead of “18” and for a zero value “0E+1 %”?
The item is configured as Type “Number” and Dimension “LuminousIntensity”

thank you for your support

A UoM value includes the unit, which for this is %. There are a few ways to strip this. I use uomItem.state.toBigDecimal() with jsr223-Jython.

Here is some more info for UoM in rules…

You can also do arithmetic with QuantityTypes…

uomItem1.state.add(uomItem2.state)
uomItem1.state.add(5 | °F)
uomItem1.state.subtract(uomItem2.state)
uomItem1.state.multiply(5)
uomItem1.state.mutiply(uomItem2.state)
uomItem1.state.divide(5)
uomItem1.state.divide(uomItem2.state)

There are some other useful methods for QuantityType.

I use the item definition without :LuminousIntensity and it works too. But I’m not on stable still on Snapshot 1443.

Hi,

thank you for the quick replies.

I removed the dimension and the value looks good now. Do you know if there was something changed between v2.3 and v2.4?