Required Expression shows True but shows "Required Expression False"

I've had a couple of RM rules fail in the last week. Checking the logs, the rule doesn't run as RM is saying the required expression is False. When I go into the rule it says "Required Expression False" at the top of the page, while in the rule itself it is evaluated as True. Clicking update clears the "Required Expression False" message at the top of the page and everything begins to work as it should.

I've not changed anything in the two rules that this has affected and they've been working fine for some time. One of them failed last week on its own, the other failed this evening on its own. I mention that as they use an identical required expression (so why would one update but not the other?).

Any ideas as to why RM wouldn't update the Required Expression? It's simply looking at the time. I did find another post where someone was having this issue but no fix was detailed other than to ensure the rule had an End-If at the end of a conditional (which the rules both do). My hub is a C-7 and Firmware is version 2.3.020. Screenshots taken while the bug is active:


I believe this is a know issue that has been reported, It only pertains to the UI, however, and does not actually cause rule issues.

One issue I found with timed expressions, but should not usually cause an issue. If you re-boot a hub and a time constraint passes while the hub is down this can cause the rule to be excluded or ran when not intended.

1 Like

That's not the case for me - the rule is not running and if I go into the logs it shows that it is not running because the required expression is false (even though it is true and being evaluated as true). Log shown below - I've purposely left it faulty for now:

Something that seems odd to me. If both of those screenshots are on the same hub at the same location why are the shown times different? They are both sunset -15 to sunrise +30. 16:01 to 08:46 vs 15:56 to 08:49.

As detailed in the first post. They are two screenshots from two different days when the fault has occurred on two different rules.

The first pic is from today Jan 18th - the current fault. The second pic is from Jan 15th - I screenshot it at the time in case the fault re occurred again - which it has.

Just to be crystal clear. Here are the two rules that use the same required expression in the RM child list:

This is the Hall and Stairs now. It's not working as although the conditions for the required expression are true and are evaluated as true, the heading at the top shows false. The log confirms the reason for it not working as required expression false:

This the Landing and Stairs now. It is working. The conditions for the required expression are true, it is evaluated as true:

@bravenel - is this explainable? Two rules with the same required expression. One reporting incorrectly and not working, the other working today. 3 days ago the same happened but that time the issue occurred on the other rule that has the same required expression as shown further up the thread.

There are two separate issues, one pertaining to UI in the display on the Apps list, and the other dealing with the Required Expression itself. The former is understood and will be fixed in the next release. This issue pertains to inconsistent display of things appended to the app name in the Apps List, such as Paused, Required Expression False, etc.

As for the behavior of the Required Expression itself, afaik this is not broken, and I cannot reproduce an error with it using 'Sunset - offset to Sunrise + offset'. However, I will investigate this, as there are some other oddities going on that need to be addressed with Required Expressions.

1 Like

Many thanks. The first issue you mention as @terminal3 says only affects the UI.

However in my case, the rule is failing to run based on/matching that incorrect display as the previous images in this thread show. (evaluated and showing true, displaying "required expression false" and the logs showing "required expression false" as the reason for the rule not running). Clicking update will resolve it.

I'm not sure whether you have the ability to check anything remotely on the hub? I only mention that as I've purposely not "fixed" it by clicking update within the rule and wondered if anything could be diagnosed while the RM rule is in its current non working state if that helped identify an issue.

So, what is the sequence of events that got you to this position? That's key, because the truthfulness (or lack thereof) of the Required Expression is itself event driven. In the case of Between Two Times, it only evaluates its truth at the starting and ending time. If it missed one of those two times, it would be in an incorrect state and stay that way until the next time (or until update is clicked).

1 Like

As you can see further up I have two similar rules that have identical required expressions.

On Jan 15th after sunset one of the two (landing and stairs) failed to work, while the other (hall and stairs) was working normally. In both of the rules, the required expression (sunset -15 to sunset +15) was showing True, yet the rule that wasn't working had the "Required Expression False" message at the top and on checking the logs I found that "Required Expression False" was the reason for it not working.

Today after sunset the rule (hall and stairs) failed to work, while the other (landing and stairs) works normally. Again in both of the rules, the same required expression is showing True, but this time the Hall and Stairs rule has the incorrect "Required Expression False" at the top and again it is detailed in the logs as the reason for the rule not running.

In summary at Sunset -15 both rules show that the required expression is [True] in the "Define Required Expression" box in the rule. However one says "Required Expression False" in the header and in the child app list. You've detailed that this is solely a UI issue but I've demonstrated throughout this thread (all shown in the pictures) that on my system that UI issue stops a rule from running.

It's the same condition (between the same 2 times) to evaluate in both rules. In both cases it evaluates true but one doesn't run because of that UI error.

Edit: If on the other hand you're saying that the [True] in the "Define Required Expression" box always shows the current condition, whereas the "Required Expression False" at the head of the page is the result of the evaluation at the given time (sunset -15) then I understand. So if that's the case, I don't understand why the same expression evaluated true at sunset -15 in one rule but not the other. Is there an issue with having the same time as a required expression in multiple rules?

The UI error has nothing to do with how it evaluates. Also, none of these pages are dynamic, so each must be refreshed to show the actual current state. However, even refresh won't necessarily fix the Apps list page, so it should be ignored.

I don't either. Please turn on all logging for these rules, Events, Triggers and Actions. Events will show the Required Expression evaluations when they occur.

No, not a problem.

Ok that makes sense to me now (I think). The [True] or [False] in the "Define Required Expression" box is the evaluation of that required expression when that rule page is loaded/refreshed. Whereas the presence/lack of the red "Required Expression False" message at the top of the page reflects how the expression was evaluated at the time of the event (in my case sunset -15), unless for some reason the evaluation did not take place/was missed at that time. Clicking update in the rule at a time other than sunset -15 for sunset +15 will evaluate the expression immediately.

As it happens all logging was already turned on for that rule. Unfortunately what I need to see has now gone from the past logs (I have a couple of apps that generate a lot of data in the logs and I'm unable to fix that as the app dev has not provided a means to do so). At the time I was too focused on checking the app and logs for what was going on but didn't think to look at what occurred or didn't at sunset -15. My bad...

I'll keep an eye on it and check the logs sooner if it should happen again.

Actually, what's at the top of the page in the border should agree with what is show for {TRUE] or [FALSE] in the rule itself. If not, that's very odd, and please let me know if this is what you are seeing.

You could temporarily disable these apps if needed... Hidden column for disable shows up with grayed out X in upper right corner of Apps page.

@Bravenel That is exactly what I was seeing. Take a look at the two images in the very first post of this thread. Those screenshoots are dated as I took them when I noticed it was not working. It happened first on the 15th with one rule (but not the other), then again yesterday with the other rule but not the first.

As you can see from those two pics - in the rule itself they both show "Required Expression False" while [True] is shown and so do not match.

OK, I'm not able to reproduce this. Without logs I have no clue what is going on with it. My suggestion is that you remove the rule that this happened for, and recreate it again. Then see what happens with it.

Are you on latest build, and using Rule 5.1?

OK. I'm using 5.1 but I'm build 2.3.020 currently.

This is an old post but I am seeing this with the current revision 2.3.1.129. The rule has one required expression the private Boolean must be true. According to the rule it is true , but the rule says required expression false and the rule has not ran in 2 days. I have opened and exited the rule several times but teh rule will not show as required expression true.

1 Like

What does it show in the Apps list for this rule?

It's kind of small but a screenshot is shown above it says Expression false.

1 Like

Have both pages shown above been refreshed?