[Released] Rule 4.0

But see, you have to change your thinking slightly. You are putting the conditions first or you're mixing your rules with your conditions. Think of it this way, The phone rings, so you pick it up. It's a robot call, so you hang it up. The phone ringing is the event that cause the something to happen, you picking up the phone. Who's on the other end is the condition that you evaluate and then take action on. So, in your example, arriving home wuld be the trigger. The condition you're going to evaluate is what time of the day (or mode) the system is in.

Ultimately, something has to cause the rule to begin it's work. All of that is based on events generated by devices. If you can think of it that way, you can usually find the correct trigger to use in your rule. Just ask yourself, when I want this to happen, what was the last event that occurred? That will be your trigger. You'll get it...just keep plugging away at it.

I would not put it that way Combining the trigger and the condition with AND is probably going to confuse people. If I were you, I would separate the trigger from the action. I usually put it this way.

TRIGGER:  Presence Arriving

ACTION:
If Mode is Night  Then
     Turn on light
End-If

Separate the trigger from the condition and I think you might find it easier for people to understand.

2 Likes

Fair point, just wanted to distinguish the condition from the action, but it logically flows the way you have put it.

Since AND links two conditions together using it to link the trigger and the conditions might cause confusion, that's all.

2 Likes

And was there for the mental logic, not actual rule logic. i.e. I come home and it's night, so my lights turn on.

As opposed to his iteration which was It's night and I come home.

1 Like

Thanks

1 Like

Ok, I know I need a cancel in here somewhere...

Trigger: Switch A or Switch B changed
Rule: If
Switch A is ON
AND
Switch B is OFF
THEN Turn Switch A OFF - delay 10mins
End-If

But I want to cancel the OFF action if either switches changes again.

Okay, I think I may have a working solution:

23%20PM

So immediately after trigger I cancel delayed actions (should just be the off?)

The light is normally triggered by motion - so its status is usually correct. The fan is ZW (not Plus) switch and often doesn't report physical changes. So I added the refresh and delayed processing for 10 seconds to allow it to correct.

Any thoughts?

What do you want this Rule to do exactly? Having the Cancel Delayed Actions at the top it will always cancel the delay, I believe.

If Fan is on, but Light is off
Turn Fan off after 10 minutes
BUT if Light turns back on - reset the delay

What do you mean by "reset the delay"? Do you want to cancel it, and then restart it when the light turns off again?

Yes.

I think I have it working from my screenshot above - just asking if I did anything obviously wrong.

It will cancel the delay when the light is turned off also.

Ok, but then it will start it again immediately, right?

Yes it would.

Hey Bruce, can you confirm for me that pausing a rule would prevent the rule from being evaluated in relation to it's event triggers?

Yes. Pausing stops the rule from doing anything at all.

So it essentially pauses it within the event subscription system?

No, it still has its event subscriptions, and the rule wakes up to events, only to find that it is paused. Then it exits.

Awesome. Thanks for clarifying. Was just thinking that if someone got to a point with their hub's performance where the number of rules triggering off an event became a bottleneck of sorts that you could pause/unpause sets of rules depending on say the mode. Not that I need that, as my list of rules is pretty small at this stage. :grin: