How do I use NOT condition in IF statements properly?

I am having trouble wrapping my brain around using NOT in IF statements. How do I use the NOT statement correctly in this scenario

image

I'd like for the rule to check If the night light isn't in CT mode or not set to ColorTemp 2200k or Not set to 1% brightness.

I am seeing that the CT / ColorTemp are both showing it as TRUE shouldn't it be FALSE?

You can use NOT in one of two ways: as an operator (in which case it negates the value of the condition or expression to its right) or as part of a condition itself. If NOT is not bold, it is being used as an operator ā€” the first case. So, what you have looks correct: color mode is CT (so that's true), then you are negating that with NOT (so it will ultimately ealuate to false, though that particular evaluation isn't displayed here, just that of the condition it's negating) ā€” just to give you one example based on one of your conditions.

If NOT is in bold, then it's part of the condition itself and will be reflected in the evaluation. I don't see that in your screenshot (though it's sometimes hard to tell in dark mode...).

What's making your expression evaluate to true, then, is the last condition. The leve is not 100, so that is false, then it's being negated, so that is ultimately true--and F OR F OR T, as your three evaluations ultimately reduce to, comes out to TRUE. In other words, it sounds like you are using these correctly and that it is evaluating as you describe. There are just (at least) two different ways you could have written something similar.

What would be another way to check?

None of 3 NOT conditions are Bold.

I guess I can eliminate the IF statements completely and just call the commands regardless to the level and colortemp I require for the rule. It was just a means of not sending unnecessary commands to a rate limited device. However, I don't think I'll ever come close to the daily limit, now that I think about it.

Thank you for the reply @bertabcd1234.

Under "Manage Conditions," you could make the NOT part of the condition. In this case, it will appear in bold, and then you don't add it as an operator later.

But that would just get you the same result. It should work as you expect now, based on your description and the current evaluation. Are hi seeing unexpected outcomes?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.