[Released] Rule 4.0

Assuming that you don't want to lock the door if it's open, I think I'd try something like this:

1 Like

Null scene item is fixed, but now possibly another bug.

"Home Occupied" is a virtual presence/motion sensor, which has been working great.

Known bug, reported it a bit ago.

1 Like

Missed it -- okay

That won't work because you don't have a trigger event for the contact sensor. it is always going to lock 5 mins after it unlocks no matter what you do. I would use a wait instead.

Trigger event: Front door unlocked
Action:
If Lock unlocked.
Delay 10 seconds (this is to open the door)
Wait for Contact sensor closed.
Delay 5 seconds
Lock the lock.

Now, if you wanted to have a longer timeout for the lock to lock after closing, say 5 minutes, then you would have to subscribe to the contact sensor as well.

Triggered Event: Contact sensor changed.

 If contact sensor closed and lock unlocked.
     delay 5 mins.
      Lock lock
 If contact sensor open,
      cancel delayed actions

See I knew there was going to be more to this than I thought.

Thank you both for your suggestions. Will try to work this out on my next days off.

I would go with the immediate lock as soon as the door is closed. And actually, if you want to get really fancy......

Trigger: Lock unlocked

Action
WAIT for contact sensor open. or timeout of 5 mins.
Delay 1
Wait for contact sensor closed
wait 5 seconds
lock the lock.

This will mean if you unlock the lock, but don't open the door, it will relock itself after 5 mins.

1 Like

@bravenel, I was just looking for the explanation of Cancel in Rule 4, on the documentation link, and realized none of the screenshots (examples) made it into the Documentation page for Rule 4.0. They are stll referred to in the txt, but the pictures are absent.

Naturally, they are still available in your post above, but they might be helpful for users who actually RTFM! :slight_smile:

S

So what is the purpose of the delay/cancel option when using the "Cancel Delayed Actions"? So in the below example I added the action " cancel delayed actions," but then under that action I can also select "delay" and cancel? What would be the purpose of the delay/cancel option for "Cancel Delayed Actions," if this does not make sense sorry.

You wouldn't want to cancel the delay right after starting it. Usually what you're going to do is put the Cancel Delayed Actions after an ELSE. For example, suppose you have motion sensors triggering the rule, and when they are active you turn on lights, and when they are inactive you turn off the lights after a delay of 2 minutes. For that delay, we'd put the Cancel Delayed Actions in the part after the IF motion-active THEN, because we want to keep the lights on and not turn them off after 2 minutes unless there is no motion for that long.

Based on what you showed above, why would you want to cancel the delay?

is it possible to use a global variable on a delayed action? I tried putting in %variable_name% in the seconds section, but it doesn't take. I want to delay a single action without delaying the rest of the rule.

You are correct in the above example the "Cancel Delayed Actions" should be after an ELSE. But this was not what I was referring to.

If you select "Cancel Delayed Actions" as an action, you then also have a "Delay" radio button for that particular action. What I was really asking is in what circumstance would you need to delay/cancel the action "Cancel Delayed Action" itself.

Sorry this is kinda hard to explain. Below is what I am referring to.

I reckon it's still there if you create a simple triggered action and you want there to be a delay with option to cancel. So in other words, when you're not using conditional actions.

So what? You can delay most actions. I can't think of any circumstance off the top of my head, but that doesn't mean that one doesn't exist.

@bravenel is this possible?

is it possible to use a global variable on a delayed action? I tried putting in %variable_name% in the seconds section, but it doesn't take. I want to delay a single action without delaying the rest of the rule.

Only for Delay Actions. You could stick the action you want to delay in its own rule, run it from the main rule, and delay it in its rule.

hmm. thats a bummer. I'll throw that out there as a feature request then. :grin:

Why is that a bummer? You can get exactly the result you want. Rules are free.

Feature request noted.

@bravenel, Canceling the delay, also cancels any actions after the delay, correct? So, if you were to have an action of delay (w/cancel) followed by another action, the 2nd action would not take place if the delay was canceled, correct?

Correct.