Noticed conditions can be altered inadvertently

This is more of a PSA that most may or may not know.

I was consolidating some rules into one big rule and used and condition in an if-then, "If shed light is on". Later in the rule, I entered the same condition as a 'New Condition', but meant to say "if shed light is off" so I edited this later if then statement to say "if shed light off". When going back and stepping through the code, I saw that the first "if shed light is on" had somehow changed to "if shed light is off". I changed it back to "if shed light is on" and it changed the second "if shed light is off" to "if shed light is on". Seems the second condition I entered erroneously and then changed had become the same condition as the first even though I had entered it as a new condition the second time. Seems RM recognizes the same condition and reuses it instead of having a duplicate. That seems a bit presumptive to me, but I assume there's a reason.

Interestingly, you can create two identical conditions in the create, edit or delete Conditions area.

Summary

That may be the case for conditions but apparently not in the actual Rules conditions. At least that’s my experience unless I’m interpreting something wrong.

In the 2nd instance, are you sure that you entered the same condition as a "New Condition"?

I found out (the hard way) that selecting an existing condition for a new IF action and changing the comparison (e.g., from a switch being ON to the switch being OFF) directly changed all prior usages of that condition.

In short, it seems that every action that supports a condition should have a unique NEW condition, and one should not attempt to re-use an old condition. That seems to be why the Condition table in RM can show many seeming duplicates or variants of the same condition.

1 Like

I rarely, and in this case pretty sure I did not use an existing condition since I intended to compare to off but forgot to toggle the on to off when creating the condition. If you read my flow in my original post, it states that clearly. I’d take the time to duplicate if I weren’t fairly certain what happened. Either way, your advice is good. I wanted to make others aware that things can change without one realizing if they aren’t careful.

Understood, I was just double-checking....

I tried to reproduce your issue, unsuccessfully.

When creating an ā€œifā€ I have to explicitly select to use an existing condition, otherwise I will create an additional, unique, condition. If I choose the same ā€œthingsā€ as I did for a previous condition, I will get an exact, however unique and unconnected, copy.
Edit to add: … and if I change anything on one of the conditions, the other remains unchanged.

Please give it another go and see if that’s not what happens.

1 Like