Are you 100% that 0 is the right value for the dimmer? I know an old dimmer I had didn’t like 0 as a value, it took values 1-99 for brightness and on / off for 0 and 100…
What the state of an Item can be depends on what type of Item it is.
Here, you are comparing it with a string, “0”
Maybe it’s a Dimmer type Item, with a numeric percent state? if ( (LivingSpotsDimmer.state as Number) == 0 )
…at the very end, a little rule which shows you how a comparison with UoM-Items can be done.
rule "Rain warning"
when
Item Dummy changed
then
if(localHourlyForecast3RainVolume.state<0.1 | "mm") {
logInfo("RainVolume","RainVolume with Pattern: " + localHourlyForecast3RainVolume)
} // works
if( (localHourlyForecast3RainVolume.state as Number).floatValue < 0.01) {
logInfo("RainVolume","RainVolume as Float for comparison: " + localHourlyForecast3RainVolume)
} // works
var vRainVol = (localHourlyForecast3RainVolume.state as Number).floatValue
if( vRainVol < 4) {
logInfo("RainVolume","RainVolume with changed Variable: " + vRainVol)
} // works
end