Hi.
I’ve found another strange thing that works if written in a .rules file but that doesn’t seem to work when using the rules DSL in the GUI, and that is comparing states of Items. I have two Items that both are Number:Temperature. I’m trying to compare them like this:
if(item1.state < item2.state)
This works fine if it’s in a .rules file (read by OH3). However when I put the exact same line of code into the GUI editor I get the following in the log:
cannot convert from State to Number
I fixed it using this instead:
(item1.state as QuantityType<Number>).doubleValue < (item2.state as QuantityType<Number>).doubleValue
…but it feels like something that shouldn’t be needed for just comparing two states of the same type, or am I wrong?
I might have a similar problem here. but i trie to compare two dimmer states. i dont get an error in the logs and i dont think its a conversion problem.