Very Basic Rule Machine Help Needed

I'm almost embarrassed to ask this super simple question. I installed my Hubitat C8 hub on Saturday to control 6 Bali shades. The installation went well, and I've successfully created rules in Rule Machine 5.1 to open and close particular shades at particular times. Previously, I had been having problems with some of the batteries dying too soon and the shade just stops working so, I wanted to set up a rule that once a day (at 8:00) checks the battery and closes the shade halfway when the battery level falls to 40% or below.

When the rule runs, the shade closes to halfway regardless of battery state. What have I done wrong? Thanks.

You created the desired Condition, but you haven't actually used it in the rule as an If-Then conditional element -- that's why it's indicating "unused".

I sympathize that's not super obvious, but the point of that Manage Conditions "holding pen" is so that you can create desired conditions ahead of time (as you've done here) and then just call them up as you're building the rule Actions.

For rules with multiple conditions, doing that can help make the rule building faster & less choppy. But creating conditions ahead of time isn't required - you can build those as go in the rule too. They'll still end up in the holding pen either way.

Plus, if/when you need to later update a condition, it's more convenient to do it from that holding pen instead of parsing through the rule's actions.

ETA -- Welcome to the community! Keep asking questions :slight_smile: The Hubitat Documentation site ("Documentation" link in upper right corner of this page) is very good, and can be a great resource as you're getting your feet under you.

4 Likes

Thanks so much for that explanation. It makes perfect sense! I had assumed that the If/Then expression was being built in the background.

Despite making sense it took me a bit of playing around to find where to go to build the expression. Once I realized that the if statement is actually an action that I can use, it became obvious that I needed to add a new action to create the statement. And as I looked for an EndIf expression, I saw that it was provided below the action box.

I look forward to getting more devices to attach and developing more complex rules. This is fun!

3 Likes

Love it! And I'm very glad you've glommed on to using "End If"... You can get away with not using it sometimes, but I always encourage folks to always close out every If with an End-If -- that way, it'll never burn you.

Rule Machine rocks, and it's very powerful -- it's a bit intimidating at first, but it's all I use to build rules. The Documentation for Rule 5.1 is very helpful, especially when you're trying to figure out a particular functionality or nuance.

Welcome aboard! :+1:

1 Like

I'm in the same boat. When the "Manage Conditions" box showed up in a firmware revision maybe a year ago, it really confused me for a long time. I still don't use it because it just makes the GUI harder to use.