[Solved] RM4 conditions don't seem to work

Hi All,

It's possible I'm missing something silly here as I'm trying to do something that should be straight-forward but just doesn't seem to work as I think it should. I'm trying to turn on a switch (for a towel heater) based on a motion sensor, but only if it detects motion between 5-9am, and only if the towel heater is currently switched off.

Therefore I have a trigger that detects motion, an action to turn the switch on, and two conditions for the action: Time should be between 5-9am and switch should be off. (see image below)

However, the rule turns the switch on every time it detects motion, even when the condition is not met. e.g. right now, when the rule clearly shows this condition to be false.

Is this because the conditions work on an "OR" basis rather than "AND", or have I misunderstood how they are supposed to work?

As a secondary question, I see lots of people pasting pictures of the boolean statements that make up their rules. Is there a way to show (or even write) RM4 rules in this format that I can access?

Any help/advice appreciated. Cheers!

Your conditions need to be contained within an IF statement.

IF ((Time between 05:00 and 09:00) AND (Towel heater(off)) THEN
Turn on Towel Heater
ENDIF

Ahhh.... this is all making sense now. You create the conditions, and then separately add a "conditional action" that can refer to these conditions. This wasn't at all clear to me previously, but I see now.

Thank you!

4 Likes

If you still have a question about this, I'm not sure what you mean. Could you explain more or provide a link to a post like what you're talking about if you're still wondering?

Now I understand how the conditional actions work I can see the logical statements being built in the hubitat interface, so all is good. Thank you!

A quick follow-up question though, when you do start to build conditional statements, is there any way to move lines in the script up and down after they have been set? (e.g. move an action outside of the "IF")

No, not at this time. You can delete an action, and you can insert one anywhere in the list. That's it for changing the script order.

Cool, thanks.