Rule machine not evaluating values correctly

Having some trouble with a rule machine rule, as you can see in the attached images, it is showing false when the condition is actually true, the second image is actually from the log where again it shows values that should be true but is treating it as false. How do I fix this and why is it happening?


What driver are you using for the device? This doesn't look like the built-in driver. My guess is that maybe it's sending values with an unexpected data type (perhaps string).

It's evaluating an OpenWeatherMap variable. All the other variables are working fine and interestingly when I open the conditions list and close it again it updates correctly

What do you mean with this?

This is the device and driver. All of the values are numeric and they all seem to be up to date. When I open the conditions page on RM it changes the true or false correctly but it seems to get stuck many times and cause the rule to fail. I've been using this rule for months, it occasionally fails and when I check on it I have this exact issue every time.

OK, so that is a custom driver as I suspected above, not the built-in. A link to the code may be helpful. I'm still not sure what you mean with "variables," but I'm guessing you just mean tbe event values ("Current States" on the device detail page).

Did you verify the Groovy/Java data type of the event value it's sending?

I'm not sure where that came from - I just changed the driver to the System Driver for OpenWeatherMap - let's see if that helps

Please post a screenshot from a wider device (PC) rather than your phone. I also can't see the whole condition in the rule, since you've lost the earlier portion in the first image. I'm not completely sure what is being AND'd and OR'd.

This is the type of logic I might say can be made easier to understand if you apply the KISS principal. Rather than a complicated IF, create a virtual switch or boolean variable to hold the weather calculation, as well as the combined status of the windows.

@jlv


See the larger screen post attached. My issue is not with the rule itself working correctly, the issue is that the condition is clearly true yet it is showing as false - see first circled image) . (I do use this rule to manage virtual switches like cooling day and heating day, which then in turn manage their respective HVAC settings)

(This screenshot is not showing an error right now- it is intermittent where feelsLike and/or forecastHigh will show a true value yet show (F) after the statement)

@bertabcd1234 the system driver doesn't seem to have all the values I'm looking for, I guess that's how I ended up with the user driver. The two attributes that seem to error out are listed as follows in the groovy file: https://raw.githubusercontent.com/HubitatCommunity/OpenWeatherMap-Alerts-Weather-Driver/master/OpenWeatherMap-Alerts%2520Weather%2520Driver.groovy

attribute 'feelsLike', sNUM
attribute 'forecastHigh', sNUM

When I look at your rule, under "Cooling Day" I see something that appears to be
C1 AND ( C2 OR C3 ) AND ( C4 AND C5 ) OR ( C6 AND C7 )
I wonder if you should to add an explicit subcondition, so that it ends up evaluating as
C1 AND ( C2 OR C3 ) AND ( ( C4 AND C5 ) OR ( C6 AND C7 ) )

Thanks, will do, I don't think it solves the original issue though

You are right, I was completely mistaken on the issue. I see the "79 >= 60 (F)" now.