How to associate action with condition in Rule Machine?

In the Rule Machine app I've created an action to turn on the porch light. And a condition of 11:55 AM. I don't see how to associate the porch light action with the 11:55 AM condition.

For a single action, you could use a Simple Conditional action:

If you've already created a "regular" action, it's too late. :slight_smile: But you can remove it and re-add it this way.

Alternatively, you can do a "full" conditional, the "IF Expression THEN" option in this same menu. I normally prefer this since it gives you room to expand later if needed, e.g., if you end up wanting more than one action wrapped in the conditional. The end of this block should be indicated with an "END-IF," which you can also add from this menu (you don't see it in my example since it's smart enough to hide it when it can't possibly be needed) or the quick link you may see in the action editor. That would look like:


IF (your condition) THEN
   On: Porch Light Switch
END-IF

And this gives you room to put more in the middle later if needed.

But looking at your rule draft more, I suspect this isn't really what you want (turning on a light in response to some trigger event only if it's exactly 11:55 AM is a bit unusual). Can you describe the automation you're looking to create?

2 Likes

The RM Video Tutorials may also help:

I’d focused on these 2, but the others may help in general too.

Thank you. The 11:55 AM time was just for learning purposes. I'd like to create a rule using the rule machine that turns on the porch light at sunset, then turns it off at 11:45 PM.

I'm completely new to the rule machine, I was not aware you could code logical expressions by hand.

Thanks, I'll definitely check those out! I'm a bit overwhelmed -- Just when I starting creating rules I find there are several rule based applications. If rule machine allows "coding" then it's for me.

Like this:

5 Likes

That is the power of rule machine. Creating complex conditionals. The Eureka moment for me was when the relationship of the triggers, actions, and the operation of the physical device became apparent. Wait until you get into an argument with Rule Machine over a light you control at the wall switch vs A rule which demands otherwise.