I’m using Eclipse Smart Home Designer for editing rules as openHAB Designer doesn’t work for openHAB2.
In this IDE, using .state in ‘if’ condition under ‘then’ section of the rule is showing error. Is it some openHAB2 change? The sample rules which I saw on GitHub shows the stuff which I mentioned.
rule "sample rule"
when
Item item1 changed from OFF to ON or
Item item1 changed from NULL to ON
then
if(item2.state == 0){
}
end
The above script is my sample rule. I can’t resolve state of item2 (auto code complete not working). It is being shown as an error in eclipse smart home designer. The items are dynamically created items.
If you downloaded ESH Designer in the past 30 days or so it currently has a bug where Designer no longer recognizes Items. There is an issue opened for this but until this time it is going to act like it doesn’t recognize your Items. I find that Actions and Joda classes are also not recognized.