Numeric Conditions do not trigger Logicblock

I’ve got a (relatively) simple Logicblock created to control a window fan. The temperature variables are updated pretty frequently (2-3 per minute) and are used in Numeric Conditions that should (in theory) trigger my logic block. However, whenever one of the variables change and a condition becomes true (or false), nothing seems to happen. The Logicblock functions as expected when tested but never evaluates on it’s own.

The conditions are set as trigger conditions and I’ve tried flipping the expression (I’m only using greater than and less than) as I read somewhere that it only triggers based on the first variable changing (Is this still true?). I’m using the complex condition linking with the below expression (Does this matter?).

OR(AND(IndoorGTDesiredCool,OutdoorLTDesiredCool),AND(IndoorLTDesiredHeat,OutdoorGTDesiredHeat))

My current brute force workaround is using a cron time event that runs every minute but this isn’t ideal. Am I missing something somewhere? Any help would be greatly appreciated.

First thing I would check is that the condition shows events in the event log. Otherwise something is not working. If you share a screenshot of the configuration of the condition, that might also help.

I would also try to create a very simple logicblock with that single trigger condition, and check if the logicblock gets ever executed. If it does, there is a problem with your complex condition linking.


This is one of the conditions I am using. The others are basically identical. I checked the event log on the dashboard and there is nothing for any of the conditions including the time event, though that one is triggering the Logicblock.

I also created a Logicblock with only the above condition set to simple AND; it also does not trigger.

After some digging in the documentation, it would appear that conditions are not recorded in the event log at all

I think I have found part of, if not the entire, problem. I created a simple Logicblock shown below.


Using this condition:

Let’s say Var1 = 10 and Var2 = 15, so currently 10<15 so the condition is false.
If Var1 becomes 20, the condition becomes true and the Logicblock triggers.
Now if Var2 becomes 25, the condition becomes false but the Logicblock doesn’t trigger because Var1 didn’t change.
At this point, Var1 = 20, Var2 = 25, the condition is false, and the Logicblock is still in the previous state of true. If Var1 changes to anything that doesn’t change the condition, say 15, the Logicblock never updates to false so the Negative Results Actions never run.
Now if Var1 becomes 30, the condition is now true, the Logicblock triggers as true, and the Positive actions run a second time.

If this was controlling, say, a fan with a single on/off button toggle (like I’m attempting to do) the fan is now on when it’s supposed to be off and vice versa. The obvious fix to this particular issue is the Only Fire Action if Result Changed box, causing the fan to never shut off when it’s supposed to, but I digress.

I believe this, combined with the fact that I am using 4 separate conditions for my Logicblock, each with constantly changing variables, is what’s causing my issue. If I am grossly misunderstanding something or there is a solution to this, please let me know

I think I have a solution:

  1. Create another condition which is exactly the same but choose “less than” instead of “greater than”. Mark it as “trigger condition” too.

  2. Then select that condition in the Conditions list of your logicblock but do not make any change in the Condition linking complex expression. We are only using that new condition to trigger the Logicblock execution when V1<V2.

Thanks to this, the logicblock will execute when “V1>V2” or “V1<V2” events happen.

Repeat this for all conditions.

1 Like

That doesn’t seem to have any effect on the logicblock; the above issue still occurs.
New logicblock:


Conditions:

Flipping the second condition as shown below makes it function normally but it’s a workaround that shouldn’t be needed.

Well it’s not pretty but it works. I’ll find out tonight if it does anything weird. I’d really like to see this fixed as this is entirely unnecessary

Yes, you are right, I’ve made some tests and it looks like conditions with two variables only trigger logicblock executions when the first variable changes. Your idea of flipping the second condition does the trick.

I think @pebneter may want to change that.

2 Likes

Yes, unfortunately that is correct for now. We have identified it as something we want to fix!

I figured this was the case as I thought I read that in an old forum post. Is this also the reason for the issue I encountered when the first variable wasn’t triggering the logicblock if the second variable changed the state of the condition?

Yes, changes in the second variable never trigger a re-evaluation of a condition (hope to be able to change this sometime).