Help With Rules

I am having trouble creating a rule using motion and mode triggering actions.
I have a HUB C7, Software 2.2.5.131.
Simply, if the mode is night and motion is detected I would like a light to turn on while motion is active and also send a text to my phone(I do have texting working with another app).

I have accomplished parts of this, but can't get the rule finished.
My closest iteration (ignoring the text notification for now) involves this rule:
Select Trigger Events
Front Door Interior Motion active
Select Actions to Run
IF (Front Door Interior Motion active(F) AND
Mode is Night(F) [FALSE]) THEN
Dim: Back Porch: 100
ELSE
Dim: Back Porch: 0
END-IF

The Back Porch light will not dim to 0 when motion is inactive nor when mode is set to day.
The log file for this rule indicates:

app:492021-02-28 10:02:19.100 infoAction: END-IF
app:492021-02-28 10:02:19.096 infoAction: Dim: Back Porch: 0 (skipped)
app:492021-02-28 10:02:19.091 infoAction: ELSE (skipping)
app:492021-02-28 10:02:19.023 infoAction: Dim: Back Porch: 100
app:492021-02-28 10:02:19.013 infoAction: IF (Front Door Interior Motion active(T) AND Mode is Night(T) [TRUE]) THEN
app:492021-02-28 10:02:18.873 infoMotion and Alert #1 Triggered
app:49

Any assistance is appreciated,

Gary

Change your trigger from
Front Door Interior Motion active
to
Front Door Interior Motion *changed*

3 Likes

The rule will only trigger when the motion sensor is active. When it goes inactive the rule will not trigger.
Change your TRIGGER to

Front Door Interior Motion changed
This way the rule will trigger when the motion sensor goes active and inactive.

EDIT: Ha Ha. What @aaiyar said above. Beat me to it.

3 Likes

Another thing people are starting to do is something like this.

   Trigger
    Front Door Interior Motion *changed*

Actions
IF Mode is not Night
Exit rule
IF (Front Door Interior Motion active
THEN
Dim: Back Porch: 100
Cancel delayed actions
ELSE
Off: Back Porch delayed 0:00:30secs (cancelable)
END-IF

It just stops the rule from evaluating most of the actions.

Also you may want to put a delay in the turning off part of the ELSE.
If you do, put in a cancel actions as shown.
Up to you really.

1 Like

Thank you very much for the quick replies.
Rewriting the rule with Changed solved my problem.

Now if only I could edit the rule instead of deleting/rewriting...

You can.

3 Likes

Thanks for the tip. I was able to edit my rules, just a matter of understanding the syntax and order.

1 Like