Garage Motion Rule with Required Expression

I set this rule up to evaluate 2 factors.
Garage Motion and/ or Light on.
I have had issues using the mZone with the 3 motion sensors so I'm trying to evaluate if the rule has issues or if i should go back to utilizing the 3 sensor themselves.

Im trying to learn about cancel and pause but its one step at a time.

Does anyone see an issue with this rule.

Yes.

I didn't read beyond the required expression and trigger, but that alone is enough: your rule will never trigger. The required expression must be true in order for the rule to trigger. So, that means the motion sensor must be inactive. But your trigger is motion inactive, which can only happen if the sensor was previously active (motion sensors only have two possible states). Your required expression will be false while that is the case. So, no trigger.

See the Rule Machine docs for more on how required expressions and trigger events work:

If you need more help, I'd suggest explaining what you want the rule to do (and maybe the problem you're trying to solve--should it work as-is without a rule to compensate?).

1 Like

I think the "Define Required Expression" is not needed, and causing issues. If it were deleted the Trigger Event will:

trigger when mZone goes inactive and does not go active for 30 minutes, at the end of the 30 minutes the defined actions will be executed. However, you have a further mZone requirement in the initial "if". I think this requirement is superfluous as a few milliseconds previous the mZone was inactive.
Same in the else-if, again the mZone was inactive milliseconds prior.

@bertabcd1234 - Thank you - I will read up more. i think im getting some of this backwards

@JohnRob - Thank you as well. I was thinking i needed motion in the IF and ELSE.

I have reworked this rule for testing.

The intent-
IF garage door, either, is open
and motion inactive, but light is on, wait for light to turn off, for X minutes, before closing doors.

IF motion inactive and light is off, close doors without delay in the actions.

Reasoning- i work in the garage often and come inside and the light stays on but the motion sensors go inactive. The light has another rule for delay to turn off.. I may be in the house 10-15 minutes but i do not want the garage doors to close.

But, IF i do stay in too long, go ahead and close because I'm, most likely, done working.

I wanted this sequence to restart, basically, if motion became active again.

Your rule should work as written but an IF-THEN should be closed with an END-IF.
Since both your IF-THEN and ELSE-IF contain the same close action, I'll offer this simplification.

Actions to Run
IF (Garage Light is on) Wait for event: Garage Light turns off and stays that way for: 0:15:00
Close: Garage Door Large, Garage Door Small

Note that the IF is a simple condition so THEN and END-IF aren't used. But does the light always turn on when you're working in the garage? If not then you'll probably want to use a Wait for expression instead of Wait for event.

2 Likes

I've found it easier to write the Actions in a text editor, then when you have the logic laid out it becomes easier to enter into RM. In the text editor you can move, delete and add without needing to follow the RM entry rules. Something like the below.

Select Trigger Events:

Garage OH  Door, Garage Rear Door any *changed*


SelectActions to Run:

IF (Garage OH Door open) THEN
     setStatusLED('7', '1', '0') on Accent Light (FP WallWash)
END-IF
IF (Garage OH Door open) THEN
     setStatusLED('7', '1 ', '1 ') on Accent Light (FP WallWash)
END-IF
IF (Garage OH Door, Garage Rear Door all closed) THEN
     setStatusLED('7', '0', '0') on Accent Light (FP WallWash)
END-1F
1 Like

@pseudonym
The light operates at night, when I am in garage with motion. I have noticed that it has a time out period if you loose motion and return to garage quickly. I thought it was due to the time out period on the zone itself...
I rewrote the rule to simplify because it felt there was to much redundancy in it.
I thought this was needed but now i am finding it may cause issues.

Since I want the garage door to close only if the light is of, This should work as intended,,, hopefully

I

As a thought, and my conclusion that garage motion sensors cannot solve light controls, i have a different approach to suggest. I use a counter. So for a simple case, if i go into the garage via a hallway door, the door opening turns the lights on, the counter increments by 1. (Starts at 0). I can work in the garage as long as i want, the lights will remain on. However, when i go back into the house, the hall door closes causing the counter to increment to 2. My logic is that for a counter of >=2, the lights will turn off, the hall door will lock itself. The next case is if i enter the garage via the hall door, counter gets set to 1, lights get turned on with the door opening. I open the bay door. The lights will always stay on with the bay door open. The counter increments on a closure. If i go into the house, the counter increments every time but will not execute any light control until all doors are closed. There are many more features i have programmed, if away, close bay doors if still open. The bay doors are also on timers .. security is a primary concern. If i want to over ride the timer knowingly staying in the garage longer, I can triple tap the garage light switch which turns on a digital lock. Etc. i do have a motion sensor in use, if all doors are closed, and i am in the house or away, the lights will stay on until the motion becomes inactive. Lot s of info here, maybe it can help solve some issues.