Is this rule right?

Hard to say if we don't know what it's supposed to do, but it looks "right" enough to me. :slight_smile: If the door stays open for four minutes, it will run off() on whatever "Home" is. When the door closes, resumeProgram() will be run on Home (and the four-minute timer will be cancelled). The only thing that might be an issue is that resumeProgram() will run every time the contact sensor is closed, even if it wasn't open for 4+ minutes previously. You may know whether this would actually be a problem in your case with this specific device.

3 Likes


since we're asking about rules what do you think

Like above, it's hard to say if the desired behavior of the rule is not also stated. :slight_smile: But making some guesses, I'd say there is likely to be some undesired behavior, or we're missing part of the picture (do you have another rule that un-pauses this one? it will get stuck there under the rather specific cirumstance of motion being active, the door being closed, and the level being 99% as long as motion doesn't become active in the next 30 minutes).

If you haven't checked out Motion Lighting yet, I'd guess it can do what you might be aiming for here (basic motion lighting plus keeping the light on after physical manipulation?). If not, you may have better luck splitting this rule into more than one (at the very least the pausing or at least resuming might be best done from another rule), though you may want to take advice from someone who already has something set up like this and can speak to any quirks they've found. But starting with an app instead of a rule is usually best if you haven't tried that yet.

1 Like