Editing a Conditional Expression - Rule Machine 4.0

Hello Again,

Is there a way to edit a Conditional Expression that is incorrect, without erasing the expression and re-creating it?

Thank You
Matt

You can either add to it with additional AND's or OR's and conditions but you cannot selectively edit the individual conditions. The UI is not that complicated. It's a pain, I know, but one that Hubitat is well aware of. Do a quick search on Rule Machine UI here on the forum and you'll see the number of posts.

Actually, you can edit the individual conditions in the section called Manage or Create Conditions. Each condition in a Conditional Expression is listed in this section. Editing a condition here, will modify it in the Conditional Expression. What you can't edit, short of erasing, is the logical expression built up with AND, OR, (, ), and individual conditions. But each of those individual conditions can be edited.

1 Like

Is there any harm in an accumulation of unused conditions in a rule? I frequently have a bunch left over as I'm optimizing the rules.

Me too. Including a number a condition that use devices that may not even be in the final rule.

I hope the rule isn't actually subscribing to events from those devices that are unused in the final rule...

My point was that you cannot edit the order or grouping (parensing). My apologies for being vague.

You could easily tell in the Rule's properties page. All the event subscriptions for the rule will be listed.

True. Good point. I'll have to look sometime.

None whatsoever. Conditions do not create subscriptions. Only Trigger Events and Waits create subscriptions. Trigger Event subscriptions persist, while Wait subscriptions expire with the Wait.

2 Likes

That makes sense. Thanks!

An unused device will be shown as "In Use By" a rule if left in an unused condition.

All this does is give you a warning should you remove that device. Belts and suspenders.

Yes, you also will get many unused conditions when cloning a rule.

Does this mean if I I have a rule to say 'IF time is between Sunset and Sunrise then do a dance' and I edit the condition of 'Time between Sunset and Sunrise' to Sunset and 8:00am' will the IF statement change within the logical expression?

Yes.

Wow! There was me editing the IF conditions and I could have just changed the conditions

@bravenel is there any safeguard in case you delete a conditional expression that you thought was unused but is used. I have had an issue before where I deleted a rule variable that was in use and I got a null expectation when trying to re-edit the rule.

No, there are no safeguards against messing things up by mistake.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.