Logic Modification - Direct Edit?

Is there a more direct way to edit a Rule than the (slow) UI?

Like I just completed a rule and tested it. Then I wanted to add "only between sunset and sunrise", but I would have to add it to 3 different conditions. Would be easier to just wrap the whole thing in one nested IF (less processing too since it would never process the other conditions unless it was proper time of day)

However in the UI i cant find a way to add an outer IF to wrap it in.

Without seeing your rule, it's hard to tell if it would work, but you may be able to insert a simple conditional as your first action.
If time is NOT between sunset and sunrise, Then: Exit Rule

Hahah thanks I just figured that out by my self (on accident). But now I like it because I can evaluate conditions up-front and keep the IF logic more simple.

I just wish I could pick from the pre-defined conditions for a simple-condition.

1 Like

As above, it's hard to say without seeing the rule, but it sounds like you might be looking for "Insert Action Before." You can do that to put a new IF ... THEN at the beginning. You will, of course, want to match this up with an END-IF at the right spot, which might be either just adding one to the end of your rule as usual or again using "Insert Action Before" to put it in the right spot (or the above suggestion could work using a simple conditional and action with basically the same result).

You can also edit conditionals and expressions that contain them, but sometimes it's easier to just delete those and start over (again with "Insert Action Before"). Nothing quite like needing to choose parentheses from a drop-down menu after the fact... :slight_smile:

To very directly answer this question: no. However, if you find yourself doing the same thing in rules all the time or find the UI cumbersome (as it can be for complicated action lists), your automation might be a good candidate for a custom (or native) app. If you state your goal, someone may be able to suggest one that already does what you're after, or if you know Groovy and are vaguely familiar with the Hubitat or ST app models, you could try yourself.

You can. There is a toggle to select from the pre-defined conditions.


1 Like

ahhh thanks! didnt notice that