IF (Time between XX Cancel Timed Actions: **This Rule** not working?

Hello,

The screenshot below is just a test. I have set it so that the lamp should turn on and off outside of the specified time.
However, no matter what I do, the circuit keeps working even within the set time.

Below is the full rule. I have adjusted the time to 17:20 as a test, and then I can clearly see "where."

Time :

It's probably something simple, but I’m completely new to Hubitat and its "rules," and honestly, I don't see it right now.

kind regards,

Can you explain (in plain language, not using any concepts from Rule Machine) specifically what you're trying to do?

There are many apps that make lighting automations easy to set up, some even easier for beginners. Rule Machine is not one. :slight_smile: Have you considered something like Motion Lighting, Basic Rule, or Room Lighting instead?

2 Likes

But of course, I probably should have done this right away indeed.

(steps that work perfectly)
Step 01: Door open (contact sensor open) → Light on in the toilet.
Step 02: Door open again (contact sensor open again) → Light off in the toilet.
Step 03: Between 21:00 and 07:00, the above rule must NOT be executed.

Summary: No light on, no actions during these hours.

kind regards,

1 Like

In that case, I would set the time window as either a Required Expression or incorporate it in as a Conditional Trigger, and I'd add "Light = Off" as a second component in that required conditional statement.

ETA -- thinking about it more, I'd use the Time Window as a Required Expression, and then use Light = Off as as Conditional Trigger for the Contact = Open Trigger. That way, the light status is evaluated at every Contact Open, and the Required Expression is just a big-picture gatekeeper.

ETA2 -- I'm inclined now to suggest just using both the time window and light=off as a Required Expression (RE). Or use the time window and a Private Boolean as the RE. I myself avoid using the same event as the trigger and a rule action to avoid these kind of potential-collision headaches, but it should be do-able.

image

1 Like

That's how I'd do it. :slightly_smiling_face:

Edit: For a garage it would work, but as Hydro noted I don't think it works for the logic OP is looking to implement. :slightly_smiling_face:

I initially thought so too, but from what I can tell, the OP keeps this door closed in general... So open to enter (light on), close door while doing business (light stays on), then when door opens again to leave, light goes off (and stays off when door is closed again after exit).

If all that's true, then Contact = Closed is going to be problematic with croweflight's version (light will go off while OP's on the throne). I think, anyway... I'm low on sleep today, so I may be missing something.

1 Like

Oh yes I read too quickly and you're right I wasn't thinking about the fact that the garage logic and the bathroom logic are distinctly different, just liked the structure of the rule. :wink:

I think I'd set the time frame as the required expression, and the trigger is the contact opens.

Then if statement...if the light is on turn it off, else turn it on.

That work?

@ZWL-Andre

A simple rule like the one below will work for your needs:

The logic for this rule is as follows:

  1. The Rule is restricted to run only when the time is NOT between 21:00 - 07:00
  2. When the door is opened, if the light is off, it will be turned on.
  3. When the door is opened a second time (i.e. the light is on), then the light will be turned off when the door is closed.

Edit -

I ran my sample rule with logging turned on, and it behaved exactly as you desire. Here's the log:

2 Likes

Was not a solution but more using a trigger condition to stop the trigger during certain times. The problem could be when operations span the time boundaries.

hi aaiyar

tnx mate, i will try this tonight i wil let you know.

Andre,

1 Like