Mode Change Rule

Should this rule work?

Not as written. The nested IF statement will never be evaluated unless it is Nap Time. Move that out from under the first IF statement. Something like this.

Looks like a nested IF instead of an ELSE. i.e. If mode is naptime then mute else unmute.

That’s what I was afraid of. Can I edit the nested action to un-nest it?

Just delete that line and the END IF it will make it easier. Then add the ELSE statement and add the END IF back in.

Better?

1 Like

That should work.

It won't matter here, but I'd get in the habit of closing out all your IF THENs with an END-IF. Since yours goes as the last action anyway, Rule Machine will infer it for you, sort of like how we can infer missing punctuation at the end of a sentence

...but it's still better to put it there. :slight_smile: And when you start to make more complicated rules (like if you had more actions after this that you want to happen regardless of what the mode changed to), properly starting and ending your conditionals (and other "block" statements like Repeat/End Repeat) will matter.