Simple delayed Extractor but in Rule 4.0

Hi all again
I am currently converting Rules to Rules 4.0
The one I am struggling with was simple before

ON motion turn light on, wait x secs, if still active turn extractor on
else
delay and then turn off both

Any suggestions?

@nigelmwilliams7

I think the following should work as an RM4 rule equivalent to what you are currently using.

Trigger:

mZone-Bathroom *changed*

Actions:

IF (mZone-Bathroom inactive) THEN
    Cancel Delayed Actions
ELSE
    On: BathroomLights
    IF (Quiet-Mode is off) THEN
        On: BathroomExtractor -> delayed 0:03:00 (cancelable)
    END-IF
END-IF
2 Likes

How are the switches turned off in this please?

@nigelmwilliams7

You're right - there's an error in my sample rule. Change the actions as indicated below:

Actions:

IF (mZone-Bathroom is inactive) THEN
    Cancel Delayed Actions
    Off: BathroomLights, BathroomExtractor
ELSE
    On: BathroomLights
    IF (Quiet-Mode is off) THEN
        On: BathroomExtractor -> delayed 0:03:00 (cancelable)
    END-IF
END-IF

Thanks I thought as much.
How can we now improve to include a delay of say 60 secs on the switches Off?
I added a cancelable delay of 10 secs to test but if the motion goes idle and reactivates within 10 secs then the original inactive causes the switches to go off not the second.

Any ideas?