Stop running rule if

Hi,

Could you help me with a simple rule?

I have a motion sensor that, when turning to active, turns my tablet display on.

A second rule turns my tablet display off after a 10 seconds delay when motion sensor turns to inactive.

Now here is my question: if within those 10 seconds my motion sensor should turn to active again I dont want that second rule (display off) to be executed. So it should be stopped from being executed.

How can I do that?

Thanks in advance!

You need a single rule like this:

Trigger event:  motion sensor *changed*
Actions:
   IF (motion sensor active) THEN
      On:  tablet display
      Cancel delay
   ELSE
      Off: tablet display delayed by 00:00:10 cancel
   END-IF

If turning on the tablet display when it is already on, for the case where motion happens again, is a problem for some reason, you could do this instead of the simple On: tablet display above:

IF (tablet display is off) On: tablet display

Thanks very much for your quick answer.....I just cant follow your way of putting things in that rule....

What do all those cancel parts mean/do? And how do I put those in a rule in rule machine?

Sorry its a pretty steep learning curve to me....but Im making progress :wink:

To add a delay to an action, you will be presented with the following scree (using off switch as an example):

You can see, you have to switch delay to on, enter the time in seconds and then also enable the cancel. That will allow this delay to be canceled by other part of the rule.

The other option would be to put in a delayed action. This delays all subsequent actions after the delay. This is useful if you have multiple actions that you want to be delayed and not just one.

Ok thanks alot. I think I got it! Just one more general question: I selected "cancel delayed actions" as an action (if motion sensor active then: display on, cancel delayed actions).

Does this cancel all delayed actions I have in rule machine or just the one in the same rule ( that is the "display off" action)?

It only cancels delayed actions within the same rule.

Ok thanks!! Really appreciate the quick help I'm getting here!

Personal note: I do find some of the wording in the rule engine not verbose enough ..
I would have the "cancel" toggle renamed "cancellable"
and I'd have made the Cancel delay say "cancel delayed action in this rule".

basically obeying the "dont make me think" principle

2 Likes

I understand the need to group like actions to make the list shorter and actions easier to find.

The one I don't understand is why "Exit Rule" is under "Delay or Repeat Actions, Wait" and not under "Set Private Boolean, Run/Cancel/Pause Rules". I can never find it.

Actually, I don't understand why "Set Private Boolean" isn't under "Set Mode or Variables, Run Custom Action".

But that's just how my mind works.

With any organization scheme you're never going to please everyone. Just gotta learn what's there and roll with it.

And there goes my second "trigger".
Why can't the same action can't appear under more than one menu? If its purpose is ambiguous then make it so!.

I guess I look at it this way, it's not going to change, so I can either fight it or just learn where things are and I can stop complaining about it. I chose to stop complaining. YMMV.

Hi,

What kind of tablet display can be turned on or off using Hubitat?
Android? IOS?

I have an android tablet. Its turned on or off via the fully kiosk device you can find here. Pretty cool stuff!

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