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
Thanks for the quick feedback - I knew what it was I just had trouble finding it it in the documentation. I had a feeling there was a certain way to deal with it either way but was lost outside of just putting a plain number. Thanks again for your help!