In openhab 3 is there a way to get the actual item number value out of when working in DSL rules? I know I could split it based on a space and then switch the first half to a number but that seems like a hack. As it stands when using if statements to compare numberLength Item.state is completely impossible as that .state value includes the descriptor of ‘in’ and therefore breaks the comparison. Do I need to append inches to the other side or use some sort of length type variable?
example: Item is defined as Number::Length and the current value is 12
(obviously changing to a plain number item fixes it but that removes some of the value)
If(item.state > 12)
resolves to this:
if( “12 in” > 12)
that obviously isn’t evaluating correctly and therefore my rule is broken