Is it possible to Edit an existing If statement to add an "AND something"?

I have the below Rule and wish to change the first line to:
IF (Illuminance of Lux Sensor, Mijia is < AccentOnLux AND Accent Lights are off) THEN
On: Accent lights
'
'
I have not found a way to edit this expression in the rule machine editing options.
Is if possible?

I only find the ability to add before this expression

Make a new compound expression, insert it in the IF, then delete the current expression .

I think all you need to do is add the new condition that you want...then edit the IF to add the new condition. (EDIT: And as Bruce notes below there is an even faster way...but either works.)

Existing IF:

24-11-22-911

New condition (the Zooz plug):

Edit IF:

Select the IF statement and add the new AND and the new condition:

Add the AND:
24-11-22-912

Add the new condition:
24-11-22-914

New IF:
24-11-22-916

3 Likes

It is not trivial and very tricky but yes, this is possible. Once you select IF statement you will see an option for erasin, editing and deleting expressions.

Click on “-end-of-rule-“ and it will be obvious.

I got useful info from everyone. @danabw 's was easiest to follow.

Thanks
All

1 Like

I also have the cutest dogs of anyone in the forum, so I got that going for me too. :wink:

Glad you're set to move forward.

1 Like

Um, not possible.

At the ice cream store.

2 Likes

What's shown above is the harder way to do this. When you edit a Conditional Action (IF-THEN), by clicking on the action in the action table, this is what comes up:

And you can see it starts out with a pull-down to add onto it with another AND, or whatever. Only if you need to edit within the expression would you need to do what is described above. After adding AND from the pull-down, you would be right back in the Expression creation flow.

5 Likes

Thank you, Much easier. I clearly didn't catch the dropdown was appending the added elements to the "Expression".

Not sure there is much you could add to this page to help. I will keep this post in my RM hints.

John

Yeah, that UI is ok once you figure it out.

Whenever you create an expression, like IF-THEN, when you've finished before hitting Done with Expression, you would see this, with the dangling AND, OR or XOR pull-down:

The Done with IF Expression button only appears when there is a possibly completed expression, If I do add AND then this would show, the Done button goes away, and I have to define the next expression element,.

The point of all of that being that you will always see that dangling pull-down with a completed expression, both when first creating it, and later when editing it.

2 Likes

What are those, Gremlins, and who did they really eat?!? :wink:

1 Like

Thanks for this. Bookmarking the post. Always have difficulty with the procedure (lack of practice)