General Rule EDIT Help

This is a general shoutout for help. While Rule Machine is amazing 🫶, it is also incredible convoluted :flushed:.

I created a rule back in March that has (what should be a simple) IF statement that basically says:
If sunrise+30 minutes is later (greater >) than 6:50 am THEN do some things (turn on lights). Simple.

Now I want to reuse that same expression, except change it for the evening (something like IF sunset is earlier than 8pm, do some things (turn lights on).

I copied/pasted the original expression to a different part of my rule and am now trying to edit it. This is where it all falls apart.

I literally can't figure out how I probably created it in the first place and therefore can't figure out how to edit it now. Again, convoluted. (I love Hubitat, but y'all need some really good technical UX/UI designers :sweat_smile:).

So here's the Expression being edited (y'all have seen this):

I don't want to insert anything, I want to edit the IF ((Variable SunrisePlusN(2023-10-03 7:45 AM) > 6:50 AM(T)) [TRUE]) THEN to something else. Just change the values. How? How do I do this easily? :grimacing: Why isn't there an Edit Expression element that lets me select the part I want to change and just let me change it?

Side questions:

  1. Why, when I edit a expression, does it break with **Broken Condition**?? that seems broken in and of itself.
    image
  2. Is there a doc/video on Best Practices for Rule Machine for things like, "When to use a subroutine!" Or, "Your Rule is 50 lines long?? Here's how to make shorter!" or, "The TOP 20 most performed Rules and how to optimize them!" :man_shrugging:

You need to find the Manage Conditions box and edit the original there if you want to change it in all places where the condition is used: Rule 5.1 | Hubitat Documentation. Alternatively, if you want to create a new condition, you can either do so there as well, or the UI provides a way to create one on the fly. You'll have to use Inser before Expression element to put one into your existing IF, then you can use the Delete Expression element(s) option to remove the "old" one you don't want in that expression anymore.

1 Like